[llvm-commits] [llvm] r155992 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/select.ll
Manman Ren
mren at apple.com
Wed May 2 08:24:32 PDT 2012
Author: mren
Date: Wed May 2 10:24:32 2012
New Revision: 155992
URL: http://llvm.org/viewvc/llvm-project?rev=155992&view=rev
Log:
Revert r155853
The commit is intended to fix rdar://10961709.
But it is the root cause of PR12720.
Revert it for now.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/select.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=155992&r1=155991&r2=155992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed May 2 10:24:32 2012
@@ -8651,22 +8651,6 @@
SDValue Y = isAllOnes(Op2) ? Op1 : Op2;
SDValue CmpOp0 = Cmp.getOperand(0);
- // further optimization for special cases
- // (select (x != 0), -1, 0) -> neg & sbb
- // (select (x == 0), 0, -1) -> neg & sbb
- if (ConstantSDNode *YC = dyn_cast<ConstantSDNode>(Y))
- if (YC->isNullValue() &&
- (isAllOnes(Op1) == (CondCode == X86::COND_NE))) {
- SDVTList VTs = DAG.getVTList(CmpOp0.getValueType(), MVT::i32);
- SDValue Neg = DAG.getNode(ISD::SUB, DL, VTs,
- DAG.getConstant(0, CmpOp0.getValueType()),
- CmpOp0);
- SDValue Res = DAG.getNode(X86ISD::SETCC_CARRY, DL, Op.getValueType(),
- DAG.getConstant(X86::COND_B, MVT::i8),
- SDValue(Neg.getNode(), 1));
- return Res;
- }
-
Cmp = DAG.getNode(X86ISD::CMP, DL, MVT::i32,
CmpOp0, DAG.getConstant(1, CmpOp0.getValueType()));
Cmp = ConvertCmpIfNecessary(Cmp, DAG);
Modified: llvm/trunk/test/CodeGen/X86/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/select.ll?rev=155992&r1=155991&r2=155992&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/select.ll (original)
+++ llvm/trunk/test/CodeGen/X86/select.ll Wed May 2 10:24:32 2012
@@ -218,24 +218,3 @@
; CHECK-NEXT: ret
}
-; rdar://10961709
-define i32 @test15(i32 %x) nounwind {
-entry:
- %cmp = icmp ne i32 %x, 0
- %sub = sext i1 %cmp to i32
- ret i32 %sub
-; CHECK: test15:
-; CHECK: negl
-; CHECK: sbbl
-}
-
-define i32 @test16(i32 %x) nounwind {
-entry:
- %c = icmp eq i32 %x, 0
- %d = select i1 %c, i32 0, i32 -1
- ret i32 %d
-; CHECK: test16:
-; CHECK: negl
-; CHECK: sbbl
-}
-
More information about the llvm-commits
mailing list