Skip to content

[DAG][ARM] computeKnownBitsForTargetNode - add handling for ARMISD VORRIMM\VBICIMM nodes #149494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions llvm/lib/Target/ARM/ARMISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20106,6 +20106,31 @@ void ARMTargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
Known = KnownOp0.intersectWith(KnownOp1);
break;
}
case ARMISD::VORRIMM: {
KnownBits KnownLHS = DAG.computeKnownBits(Op.getOperand(0), Depth + 1);

unsigned Encoded = Op.getConstantOperandVal(1);
unsigned ElemSize = Op.getScalarValueSizeInBits();
uint64_t DecodedVal = ARM_AM::decodeVMOVModImm(Encoded, ElemSize);
APInt Imm(ElemSize, DecodedVal);

Known.One = KnownLHS.One | Imm;
Known.Zero = KnownLHS.Zero & ~Imm;
return;
}
case ARMISD::VBICIMM: {
KnownBits KnownLHS = DAG.computeKnownBits(Op.getOperand(0), Depth + 1);

unsigned Encoded = Op.getConstantOperandVal(1);
unsigned ElemSize = Op.getScalarValueSizeInBits();
uint64_t DecodedVal = ARM_AM::decodeVMOVModImm(Encoded, ElemSize);
APInt Imm(ElemSize, DecodedVal);

APInt NotImm = ~Imm;
Known.One = KnownLHS.One & NotImm;
Known.Zero = KnownLHS.Zero | Imm;
return;
}
}
}

Expand Down
Loading