[llvm] [MachineOutliner] Don't outline ADRP pair to avoid incorrect ICF (PR #160232)

Pranav Kant via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 09:58:49 PDT 2025


pranavk 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 part of candidates but doesn't seem a perfect fit if you want to allow the whole sequence to be outlined but not parts of it.

`getOutliningCandidateInfo` certainly sounds like a better place to do what @smithp35 suggested above. This is under the assumption that LDR/ADD always follow ADRP which should generally happen as suggested above. @davemgreen I am curious under what conditions they won't be scheduled together. I'd like to avoid the correctness issue exposed by linker ICF. So it may be worth it to avoid this as well if possible.

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


More information about the llvm-commits mailing list