)]}'
{
  "commit": "2661e995ceebd6fd083e5b62aeff21e67b28e9a4",
  "tree": "b7c23ce41e45b5fb8686d5cd0c0d9f674bbbef9b",
  "parents": [
    "5c551cbe462ea1b22bfe7e42e248ca29ea5c334c"
  ],
  "author": {
    "name": "PiJoules",
    "email": "6019989+PiJoules@users.noreply.github.com",
    "time": "Thu May 15 11:52:25 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu May 15 11:52:25 2025 -0700"
  },
  "message": "[llvm] Ensure propagated constants in the vtable are aligned (#136630)\n\nIt\u0027s possible for virtual constant propagation in whole program\ndevirtualization to create unaligned loads. We originally saw this with\n4-byte aligned relative vtables where we could store 8-byte values\nbefore/after the vtable. But since the vtable is 4-byte aligned and we\nunconditionally do an 8-byte load, we can\u0027t guarantee that the stored\nconstant will always be aligned to 8 bytes. We can also see this with\nnormal vtables whenever a 1-byte char is stored in the vtable because\nthe offset calculation for the GEP doesn\u0027t take into account the\noriginal vtable alignment.\n\nThis patch introduces two changes to virtual constant propagation:\n1. Do not propagate constants whose preferred alignment is larger than\nthe vtable alignment. This is required because if the constants are\nstored in the vtable, we can only guarantee the constant will be stored\nat an address at most aligned to the vtable\u0027s alignment.\n2. Round up the offset used in the GEP before the load to ensure it\u0027s at\nan address suitably aligned such that we can load from it.\n\nThis patch updates tests to reflect this alignment change and adds some\ncases for relative vtables.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "49c9515fa6a0b06bf1ee85f7dad273e38aa00d94",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp",
      "new_id": "aa527aec622bf217b3cdcdd55a9c873e10762595",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp"
    },
    {
      "type": "modify",
      "old_id": "b6adf1b40acf755bb52da78a9b71976ca42ae6d4",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll",
      "new_id": "2654b70b90e8529dbf15a9d6d070895f987bf567",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll"
    },
    {
      "type": "modify",
      "old_id": "40adabbe38400a4b01c6f778493d81d826a0d1ad",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll",
      "new_id": "d8f5c912e9a50a6925cfecc73c891f2ddd55e19d",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll"
    },
    {
      "type": "modify",
      "old_id": "e0f9b6dbe2ac523b15c6bc970bc1035d3bc869ed",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll",
      "new_id": "dd91ff6e6f3aabc2c2cdc33393b9cf5a5f001fec",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll"
    },
    {
      "type": "modify",
      "old_id": "fd703712ceb2c34777c1d79969ca1b002d983298",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-small-alignment-32.ll",
      "new_id": "ab76f2c22e343d916c4ea0446898463a51d1604c",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-small-alignment-32.ll"
    },
    {
      "type": "modify",
      "old_id": "ce4a0180dfc9258a4f842cd260d652db59b800c2",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-small-alignment-64.ll",
      "new_id": "c83fbc6ed5a1971ed143a3bc84fef0ac5fff3dc1",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-small-alignment-64.ll"
    },
    {
      "type": "modify",
      "old_id": "8fae05bef2ae1373e84d63172e430a333e27c762",
      "old_mode": 33188,
      "old_path": "llvm/unittests/Transforms/IPO/WholeProgramDevirt.cpp",
      "new_id": "59cc5bc2c4e6fe687d693138ea5968b34f0247d8",
      "new_mode": 33188,
      "new_path": "llvm/unittests/Transforms/IPO/WholeProgramDevirt.cpp"
    }
  ]
}
