mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
[DAG] getNode() - begin generalizing the (zext (trunc (assertzext x))) -> (assertzext x) fold.
We'll need to generalize this fold to check for any zero upperbits to address some of the D155472 regressions, but this exposes a number of issues. For now, just use the general MaskedValueIsZero test instead of the assertzext.
This commit is contained in:
parent
aa8601dc6d
commit
b2ffc867ad
@ -5695,8 +5695,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
|
||||
SDValue OpOp = N1.getOperand(0);
|
||||
if (OpOp.getValueType() == VT) {
|
||||
if (OpOp.getOpcode() == ISD::AssertZext && N1->hasOneUse()) {
|
||||
EVT ExtVT = cast<VTSDNode>(OpOp.getOperand(1))->getVT();
|
||||
if (N1.getScalarValueSizeInBits() >= ExtVT.getSizeInBits()) {
|
||||
APInt HiBits = APInt::getBitsSetFrom(VT.getScalarSizeInBits(),
|
||||
N1.getScalarValueSizeInBits());
|
||||
if (MaskedValueIsZero(OpOp, HiBits)) {
|
||||
transferDbgValues(N1, OpOp);
|
||||
return OpOp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user