From 900622e099054da4a213074581d8501ac27e7ea7 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 20 May 2013 00:28:36 +0000 Subject: [PATCH] Mark i64 SETCC as expand so it is turned into a SELECT_CC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182227 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcISelLowering.cpp | 2 ++ test/CodeGen/SPARC/64bit.ll | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/Target/Sparc/SparcISelLowering.cpp b/lib/Target/Sparc/SparcISelLowering.cpp index 3863e2cc1ca..d470fb312dc 100644 --- a/lib/Target/Sparc/SparcISelLowering.cpp +++ b/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/test/CodeGen/SPARC/64bit.ll b/test/CodeGen/SPARC/64bit.ll index dd6cee30b15..e10237b7d8a 100644 --- a/test/CodeGen/SPARC/64bit.ll +++ b/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 +} -- 2.34.1