[llvm] [BOLT] Fix fixed pic handling in indirect jumps (PR #178578)

Haibo Jiang via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 17:52:58 PST 2026


Jianghibo wrote:

Thanks for your review, I am reading your diff, and there is a issue here: when `ArrayStart` and `EntryAddress` are equal, the already deleted JumpTable(`JT`) is being used at
```
BC.deleteJumpTable(EntryAddress);

assert(JT && "Must have a containing jump table for PIC fixed branch");
BC.MIB->replaceMemOperandDisp(*FixedEntryLoadInstr, JT->getFirstLabel(),
                              EntryAddress - ArraryStart, &*BC,Ctx);
```

> @Jianghibo thanks for PR, I think that excluding zero entry can be the fix, but i think it's better to check that JT already exist and delete it in this case because we can't be sure that all entries are analyzed correctly. also if JT is not exist yet go to further and analyzeMemoryAt(ArrayStart), verify JTTYPE, create the JT and replace memory operand for movslq after all. The diff of described functionality is attached, I took your libc.zip for checking. [jt.diff.txt](https://github.com/user-attachments/files/25016839/jt.diff.txt) @aaupov @maksfb can you take a look either ?



https://github.com/llvm/llvm-project/pull/178578


More information about the llvm-commits mailing list