Skip to content

Commit c9c5967

Browse files
committed
Simplify combine with isConstorConstSplat().
1 parent 4fc323e commit c9c5967

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14680,17 +14680,11 @@ SITargetLowering::performExtractVectorEltCombine(SDNode *N,
1468014680
// depending on the shift operand. See e.g. performSraCombine().
1468114681
// This combine ensures that the optimisation is compatible with v2i32
1468214682
// legalised AND.
14683-
// TODO: Consider if additional improvements can be made by generalising to
14684-
// other constants and vector types.
1468514683
if (VecVT == MVT::v2i32 && Vec->getOpcode() == ISD::AND &&
1468614684
Vec->getOperand(1)->getOpcode() == ISD::BUILD_VECTOR) {
14687-
SDValue BV = Vec->getOperand(1);
1468814685

14689-
ConstantSDNode *BV0 = dyn_cast<ConstantSDNode>(BV->getOperand(0));
14690-
ConstantSDNode *BV1 = dyn_cast<ConstantSDNode>(BV->getOperand(1));
14691-
14692-
if (!BV0 || !BV1 || BV->getConstantOperandVal(0) != 0x1f ||
14693-
BV->getConstantOperandVal(1) != 0x1f)
14686+
const ConstantSDNode *C = isConstOrConstSplat(Vec.getOperand(1));
14687+
if (!C || C->getZExtValue() != 0x1f)
1469414688
return SDValue();
1469514689

1469614690
SDLoc SL(N);

0 commit comments

Comments
 (0)