[llvm] r192123 - X86: Fix type check. Just because an integer type is illegal doesn't mean it's i64.

Benjamin Kramer benny.kra at googlemail.com
Mon Oct 7 12:11:35 PDT 2013


Author: d0k
Date: Mon Oct  7 14:11:35 2013
New Revision: 192123

URL: http://llvm.org/viewvc/llvm-project?rev=192123&view=rev
Log:
X86: Fix type check. Just because an integer type is illegal doesn't mean it's i64.

Fixes PR17495, where an i24 triggered this code. It's intended to
optimize i64 loads on 32 bit x86.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/test/CodeGen/X86/2011-06-03-x87chain.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=192123&r1=192122&r2=192123&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct  7 14:11:35 2013
@@ -18823,7 +18823,7 @@ static SDValue PerformSINT_TO_FPCombine(
     if (!Ld->isVolatile() && !N->getValueType(0).isVector() &&
         ISD::isNON_EXTLoad(Op0.getNode()) && Op0.hasOneUse() &&
         !XTLI->getSubtarget()->is64Bit() &&
-        !DAG.getTargetLoweringInfo().isTypeLegal(VT)) {
+        VT == MVT::i64) {
       SDValue FILDChain = XTLI->BuildFILD(SDValue(N, 0), Ld->getValueType(0),
                                           Ld->getChain(), Op0, DAG);
       DAG.ReplaceAllUsesOfValueWith(Op0.getValue(1), FILDChain.getValue(1));

Modified: llvm/trunk/test/CodeGen/X86/2011-06-03-x87chain.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2011-06-03-x87chain.ll?rev=192123&r1=192122&r2=192123&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2011-06-03-x87chain.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2011-06-03-x87chain.ll Mon Oct  7 14:11:35 2013
@@ -29,3 +29,21 @@ entry:
   store float %conv, float* %f, align 4
   ret float %conv
 }
+
+define void @PR17495() {
+entry:
+  br i1 undef, label %while.end, label %while.body
+
+while.body:                                       ; preds = %while.body, %entry
+  %x.1.copyload = load i24* undef, align 1
+  %conv = sitofp i24 %x.1.copyload to float
+  %div = fmul float %conv, 0x3E80000000000000
+  store float %div, float* undef, align 4
+  br i1 false, label %while.end, label %while.body
+
+while.end:                                        ; preds = %while.body, %entry
+  ret void
+
+; CHECK-LABEL: @PR17495
+; CHECK-NOT: fildll
+}





More information about the llvm-commits mailing list