forked from OSchip/llvm-project
[X86] Remove unneeded code that looks for (and (i8 (X86setcc_c))
I don't believe we use this construct anymore so I don't think we need to look for it.
This commit is contained in:
parent
e53bbf1213
commit
cd14b4a62b
|
@ -43869,28 +43869,10 @@ static SDValue combineFMADDSUB(SDNode *N, SelectionDAG &DAG,
|
||||||
static SDValue combineZext(SDNode *N, SelectionDAG &DAG,
|
static SDValue combineZext(SDNode *N, SelectionDAG &DAG,
|
||||||
TargetLowering::DAGCombinerInfo &DCI,
|
TargetLowering::DAGCombinerInfo &DCI,
|
||||||
const X86Subtarget &Subtarget) {
|
const X86Subtarget &Subtarget) {
|
||||||
// (i32 zext (and (i8 x86isd::setcc_carry), 1)) ->
|
|
||||||
// (and (i32 x86isd::setcc_carry), 1)
|
|
||||||
// This eliminates the zext. This transformation is necessary because
|
|
||||||
// ISD::SETCC is always legalized to i8.
|
|
||||||
SDLoc dl(N);
|
SDLoc dl(N);
|
||||||
SDValue N0 = N->getOperand(0);
|
SDValue N0 = N->getOperand(0);
|
||||||
EVT VT = N->getValueType(0);
|
EVT VT = N->getValueType(0);
|
||||||
|
|
||||||
if (N0.getOpcode() == ISD::AND &&
|
|
||||||
N0.hasOneUse() &&
|
|
||||||
N0.getOperand(0).hasOneUse()) {
|
|
||||||
SDValue N00 = N0.getOperand(0);
|
|
||||||
if (N00.getOpcode() == X86ISD::SETCC_CARRY) {
|
|
||||||
if (!isOneConstant(N0.getOperand(1)))
|
|
||||||
return SDValue();
|
|
||||||
return DAG.getNode(ISD::AND, dl, VT,
|
|
||||||
DAG.getNode(X86ISD::SETCC_CARRY, dl, VT,
|
|
||||||
N00.getOperand(0), N00.getOperand(1)),
|
|
||||||
DAG.getConstant(1, dl, VT));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SDValue NewCMov = combineToExtendCMOV(N, DAG))
|
if (SDValue NewCMov = combineToExtendCMOV(N, DAG))
|
||||||
return NewCMov;
|
return NewCMov;
|
||||||
|
|
||||||
|
|
|
@ -349,13 +349,6 @@ def : Pat<(i32 (sext (i8 (X86setcc_c X86_COND_B, EFLAGS)))),
|
||||||
def : Pat<(i64 (sext (i8 (X86setcc_c X86_COND_B, EFLAGS)))),
|
def : Pat<(i64 (sext (i8 (X86setcc_c X86_COND_B, EFLAGS)))),
|
||||||
(SETB_C64r)>;
|
(SETB_C64r)>;
|
||||||
|
|
||||||
// We canonicalize 'setb' to "(and (sbb reg,reg), 1)" on the hope that the and
|
|
||||||
// will be eliminated and that the sbb can be extended up to a wider type. When
|
|
||||||
// this happens, it is great. However, if we are left with an 8-bit sbb and an
|
|
||||||
// and, we might as well just match it as a setb.
|
|
||||||
def : Pat<(and (i8 (X86setcc_c X86_COND_B, EFLAGS)), 1),
|
|
||||||
(SETCCr (i8 2))>;
|
|
||||||
|
|
||||||
// Patterns to give priority when both inputs are zero so that we don't use
|
// Patterns to give priority when both inputs are zero so that we don't use
|
||||||
// an immediate for the RHS.
|
// an immediate for the RHS.
|
||||||
// TODO: Should we use a 32-bit sbb for 8/16 to push the extract_subreg out?
|
// TODO: Should we use a 32-bit sbb for 8/16 to push the extract_subreg out?
|
||||||
|
|
Loading…
Reference in New Issue