mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-24 20:44:09 +00:00
[DAG] Remove pointless peephole from refineUniformBase [nfc]
No need to special case add 0, N. SelectionDAG::getNode contains the canonicalization and simplification for this case, so no need to duplicate it here.
This commit is contained in:
parent
e9e1892b83
commit
61757fbd04
@ -11650,10 +11650,7 @@ bool refineUniformBase(SDValue &BasePtr, SDValue &Index, bool IndexIsScaled,
|
||||
if (SDValue SplatVal = DAG.getSplatValue(Index);
|
||||
SplatVal && !isNullConstant(SplatVal) &&
|
||||
SplatVal.getValueType() == VT) {
|
||||
if (isNullConstant(BasePtr))
|
||||
BasePtr = SplatVal;
|
||||
else
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
Index = DAG.getSplat(Index.getValueType(), DL, DAG.getConstant(0, DL, VT));
|
||||
return true;
|
||||
}
|
||||
@ -11663,19 +11660,13 @@ bool refineUniformBase(SDValue &BasePtr, SDValue &Index, bool IndexIsScaled,
|
||||
|
||||
if (SDValue SplatVal = DAG.getSplatValue(Index.getOperand(0));
|
||||
SplatVal && SplatVal.getValueType() == VT) {
|
||||
if (isNullConstant(BasePtr))
|
||||
BasePtr = SplatVal;
|
||||
else
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
Index = Index.getOperand(1);
|
||||
return true;
|
||||
}
|
||||
if (SDValue SplatVal = DAG.getSplatValue(Index.getOperand(1));
|
||||
SplatVal && SplatVal.getValueType() == VT) {
|
||||
if (isNullConstant(BasePtr))
|
||||
BasePtr = SplatVal;
|
||||
else
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
BasePtr = DAG.getNode(ISD::ADD, DL, VT, BasePtr, SplatVal);
|
||||
Index = Index.getOperand(0);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user