[llvm] [MachineOutliner] Don't outline ADRP pair to avoid incorrect ICF (PR #160232)
David Tellenbach via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 4 14:18:41 PDT 2025
dtellenbach wrote:
I'm wondering if it would make sense to do this in `getOutliningCandidateInfo` and just remove the candidates that split up a `adrp, add, ldr` sequence. `getOutliningTypeImpl` is better suited for preventing individual instructions to be considered as candidates but doesn't seem a perfect fit if you want to allow the whole sequence to be outlined but not parts of it.
For detecting that a sequence has been split, you can do what @smithp35 mentioned earlier.
> If we have in an outline candidate:
add x0, x0, :got_lo12: sym or ldr x0, [x0, :got_lo12:sym] but no preceeding adrp x0 :got: sym in the outline candidate, then we know that an adrp, add or adrp, ldr sequence has been split up as the add x0, x0, :got_lo12: sym and ldr x0, [x0, :got_lo12:sym] don't make any sense on their own.
https://github.com/llvm/llvm-project/pull/160232
More information about the llvm-commits
mailing list