[X86ISelLowering] permit BlockAddressSDNode "i" constraints for PIC
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 17 Feb 2022 18:43:12 +0000 (10:43 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Thu, 17 Feb 2022 18:54:46 +0000 (10:54 -0800)
commit027c16bef4b727095eea00bbef9266f1f4a78c27
tree217d7f69361c746647842c82a4e231e1c25c1873
parent5824d2bb0f036e631419ae0993fd03d633398266
[X86ISelLowering] permit BlockAddressSDNode "i" constraints for PIC

When building 32b x86 code as PIC, the existing handling of "i"
constraints is conservative since generally we have to go through the
GOT to find references to functions.

But generally, BlockAddresses from C code refer to the Function in the
current TU.  Permit BlockAddresses to be used with the "i" constraint
for those cases.

I regressed this in
commit 4edb9983cb8c ("[SelectionDAG] treat X constrained labels as i for asm")

Fixes: https://github.com/llvm/llvm-project/issues/53868

Reviewed By: efriedma, MaskRay

Differential Revision: https://reviews.llvm.org/D119905
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/inline-asm-pic.ll