Skip to content

Commit ca912c7

Browse files
authored
Revert bbc5221 "[DAGCombiner] Fold pattern for srl-shl-zext" (#139876)
Reverts #138290 due to buildbot failures in shift-opt.ll
1 parent a2a280e commit ca912c7

File tree

2 files changed

+0
-168
lines changed

2 files changed

+0
-168
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10972,22 +10972,6 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
1097210972
return DAG.getNode(ISD::SRL, DL, VT, N0, NewOp1);
1097310973
}
1097410974

10975-
// fold (srl (logic_op x, (shl (zext y), c1)), c1)
10976-
// -> (logic_op (srl x, c1), (zext y))
10977-
// c1 <= leadingzeros(zext(y))
10978-
SDValue X, ZExtY;
10979-
if (N1C && sd_match(N0, m_OneUse(m_BitwiseLogic(
10980-
m_Value(X),
10981-
m_OneUse(m_Shl(m_AllOf(m_Value(ZExtY),
10982-
m_Opc(ISD::ZERO_EXTEND)),
10983-
m_Specific(N1))))))) {
10984-
unsigned NumLeadingZeros = ZExtY.getScalarValueSizeInBits() -
10985-
ZExtY.getOperand(0).getScalarValueSizeInBits();
10986-
if (N1C->getZExtValue() <= NumLeadingZeros)
10987-
return DAG.getNode(N0.getOpcode(), SDLoc(N0), VT,
10988-
DAG.getNode(ISD::SRL, SDLoc(N0), VT, X, N1), ZExtY);
10989-
}
10990-
1099110975
// fold operands of srl based on knowledge that the low bits are not
1099210976
// demanded.
1099310977
if (SimplifyDemandedBits(SDValue(N, 0)))

llvm/test/CodeGen/NVPTX/shift-opt.ll

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)