summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-05-20 00:28:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-05-20 00:28:36 +0000
commit751e9b84077dd3b5cf6f5d5812f2054071a5179c (patch)
treedf20b70d040e849581bd72ec7d327e92d3c0ecef /llvm
parent8bad66e586103a2ca59c98f423f270dbfec131e0 (diff)
downloadbcm5719-llvm-751e9b84077dd3b5cf6f5d5812f2054071a5179c.tar.gz
bcm5719-llvm-751e9b84077dd3b5cf6f5d5812f2054071a5179c.zip
Mark i64 SETCC as expand so it is turned into a SELECT_CC.
llvm-svn: 182227
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/Sparc/SparcISelLowering.cpp2
-rw-r--r--llvm/test/CodeGen/SPARC/64bit.ll10
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index 3863e2cc1ca..d470fb312dc 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -1300,6 +1300,8 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
if (Subtarget->is64Bit()) {
+ setOperationAction(ISD::SELECT, MVT::i64, Expand);
+ setOperationAction(ISD::SETCC, MVT::i64, Expand);
setOperationAction(ISD::BR_CC, MVT::i64, Custom);
setOperationAction(ISD::SELECT_CC, MVT::i64, Custom);
}
diff --git a/llvm/test/CodeGen/SPARC/64bit.ll b/llvm/test/CodeGen/SPARC/64bit.ll
index dd6cee30b15..e10237b7d8a 100644
--- a/llvm/test/CodeGen/SPARC/64bit.ll
+++ b/llvm/test/CodeGen/SPARC/64bit.ll
@@ -191,3 +191,13 @@ entry:
}
declare void @g(i8*)
+
+; CHECK: expand_setcc
+; CHECK: subcc %i0, 1,
+; CHECK: movl %xcc, 1,
+define i32 @expand_setcc(i64 %a) {
+ %cond = icmp sle i64 %a, 0
+ %cast2 = zext i1 %cond to i32
+ %RV = sub i32 1, %cast2
+ ret i32 %RV
+}
OpenPOWER on IntegriCloud