git: 8d4cb93316be - stable/13 - Apply fix for asm constraint error in www/php80-opcache

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 04 Jun 2022 12:01:14 UTC
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=8d4cb93316be6e6ce5f8dedb1555c3857b80cdbe

commit 8d4cb93316be6e6ce5f8dedb1555c3857b80cdbe
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-02-17 21:49:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-06-04 11:59:37 +0000

    Apply fix for asm constraint error in www/php80-opcache
    
    Merge commit 027c16bef4b7 from llvm git (by Nick Desaulniers):
    
      [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
    
    (cherry picked from commit 8885dff6cec52378084211fdd9366a73833eceee)
---
 contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
index 9a08586958cd..f21f6107a640 100644
--- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -54621,8 +54621,9 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
 
     // In any sort of PIC mode addresses need to be computed at runtime by
     // adding in a register or some sort of table lookup.  These can't
-    // be used as immediates.
-    if (Subtarget.isPICStyleGOT() || Subtarget.isPICStyleStubPIC())
+    // be used as immediates. BlockAddresses are fine though.
+    if ((Subtarget.isPICStyleGOT() || Subtarget.isPICStyleStubPIC()) &&
+        !isa<BlockAddressSDNode>(Op))
       return;
 
     // If we are in non-pic codegen mode, we allow the address of a global (with