mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Revert r191049/r191059 as it can produce wrong code (see PR17975).
It has already been reverted on the 3.4 branch in r196521. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3555,27 +3555,6 @@ SDNode *DAGCombiner::MatchRotatePosNeg(SDValue Shifted, SDValue Pos,
|
||||
HasPos ? Pos : Neg).getNode();
|
||||
}
|
||||
|
||||
// fold (or (shl (*ext x), (*ext y)),
|
||||
// (srl (*ext x), (*ext (sub 32, y)))) ->
|
||||
// (*ext (rotl x, y)) or (*ext (rotr x, (sub 32, y)))
|
||||
//
|
||||
// fold (or (shl (*ext x), (*ext (sub 32, y))),
|
||||
// (srl (*ext x), (*ext y))) ->
|
||||
// (*ext (rotr x, y)) or (*ext (rotl x, (sub 32, y)))
|
||||
if (Shifted.getOpcode() == ISD::ZERO_EXTEND ||
|
||||
Shifted.getOpcode() == ISD::ANY_EXTEND) {
|
||||
SDValue InnerShifted = Shifted.getOperand(0);
|
||||
EVT InnerVT = InnerShifted.getValueType();
|
||||
bool HasPosInner = TLI.isOperationLegalOrCustom(PosOpcode, InnerVT);
|
||||
if (HasPosInner || TLI.isOperationLegalOrCustom(NegOpcode, InnerVT)) {
|
||||
if (matchRotateSub(InnerPos, InnerNeg, InnerVT.getSizeInBits())) {
|
||||
SDValue V = DAG.getNode(HasPosInner ? PosOpcode : NegOpcode, DL,
|
||||
InnerVT, InnerShifted, HasPosInner ? Pos : Neg);
|
||||
return DAG.getNode(Shifted.getOpcode(), DL, VT, V).getNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user