[llvm] 77d9b7b - [X86] Query constant pool object alignment instead of hardcoding.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 14:47:38 PST 2020


Author: Craig Topper
Date: 2020-02-26T14:45:39-08:00
New Revision: 77d9b7b2cdbc401ded68970bc83efc6d1e179318

URL: https://github.com/llvm/llvm-project/commit/77d9b7b2cdbc401ded68970bc83efc6d1e179318
DIFF: https://github.com/llvm/llvm-project/commit/77d9b7b2cdbc401ded68970bc83efc6d1e179318.diff

LOG: [X86] Query constant pool object alignment instead of hardcoding.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 68ef0b17b48c..4289234e94b4 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -19627,6 +19627,7 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op,
   APInt FF(64, 0x5F80000000000000ULL);
   SDValue FudgePtr = DAG.getConstantPool(
       ConstantInt::get(*DAG.getContext(), FF), PtrVT);
+  unsigned CPAlignment = cast<ConstantPoolSDNode>(FudgePtr)->getAlignment();
 
   // Get a pointer to FF if the sign bit was set, or to 0 otherwise.
   SDValue Zero = DAG.getIntPtrConstant(0, dl);
@@ -19638,7 +19639,7 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op,
   SDValue Fudge = DAG.getExtLoad(
       ISD::EXTLOAD, dl, MVT::f80, Chain, FudgePtr,
       MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), MVT::f32,
-      /* Alignment = */ 4);
+      CPAlignment);
   Chain = Fudge.getValue(1);
   // Extend everything to 80 bits to force it to be done on x87.
   // TODO: Are there any fast-math-flags to propagate here?


        


More information about the llvm-commits mailing list