[llvm] Jump table annotations for Linux (PR #112606)

Daniel Paoliello via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 16:29:43 PDT 2024


dpaoliello wrote:

> where the relocation is no longer attached to the jmp instruction but to the preceding mov instruction

Yeah, this is one of the problems with pseudo instructions: weird things can happen when instructions are inserted or combined. Ideally this would be stored as metadata on the jump, but that's not really a thing in LLVM.

You either need to teach the code that is adding the `mov` to place it before the pseudo instruction (which will still be fragile to other changes), or make the code looking for the pseudo instruction walk backwards from the jump to see if there are any in the current block (which is the approach I took). 

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


More information about the llvm-commits mailing list