mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Revert r155853
The commit is intended to fix rdar://10961709. But it is the root cause of PR12720. Revert it for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155992 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
37cb9acac5
commit
e2849851b2
@ -8651,22 +8651,6 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
|
||||
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);
|
||||
|
@ -218,24 +218,3 @@ define i32 @test14(i32 %a, i32 %b) nounwind {
|
||||
; 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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user