[llvm] r189948 - [Sparc] Fix an assertion failure while lowering fcmp on long double.
Venkatraman Govindaraju
venkatra at cs.wisc.edu
Wed Sep 4 08:15:21 PDT 2013
Author: venkatra
Date: Wed Sep 4 10:15:20 2013
New Revision: 189948
URL: http://llvm.org/viewvc/llvm-project?rev=189948&view=rev
Log:
[Sparc] Fix an assertion failure while lowering fcmp on long double.
This assertion is triggered because an integer constant is created with wrong
type.
Modified:
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
llvm/trunk/test/CodeGen/SPARC/fp128.ll
Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=189948&r1=189947&r2=189948&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Wed Sep 4 10:15:20 2013
@@ -1816,7 +1816,7 @@ SparcTargetLowering::LowerF128Compare(SD
return DAG.getNode(SPISD::CMPICC, DL, MVT::Glue, Result, RHS);
}
case SPCC::FCC_ULE: {
- SDValue RHS = DAG.getTargetConstant(2, LHS.getValueType());
+ SDValue RHS = DAG.getTargetConstant(2, Result.getValueType());
SPCC = SPCC::ICC_NE;
return DAG.getNode(SPISD::CMPICC, DL, MVT::Glue, Result, RHS);
}
Modified: llvm/trunk/test/CodeGen/SPARC/fp128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/fp128.ll?rev=189948&r1=189947&r2=189948&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/fp128.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/fp128.ll Wed Sep 4 10:15:20 2013
@@ -76,3 +76,23 @@ entry:
%ret = select i1 %cond, i32 %a, i32 %b
ret i32 %ret
}
+
+; HARD-LABEL: f128_compare2
+; HARD: fcmpq
+; HARD: fb{{ule|g}}
+
+; SOFT-LABEL: f128_compare2
+; SOFT: _Q_cmp
+; SOFT: cmp
+
+define i32 @f128_compare2() {
+entry:
+ %0 = fcmp ogt fp128 undef, 0xL00000000000000000000000000000000
+ br i1 %0, label %"5", label %"7"
+
+"5": ; preds = %entry
+ ret i32 0
+
+"7": ; preds = %entry
+ ret i32 1
+}
More information about the llvm-commits
mailing list