Skip to content

Commit c23f8c3

Browse files
toppercPriyanshu3820
authored andcommitted
[DAGCombiner] Remove unneeded m_BitReverse from visitBITREVERSE. NFC (llvm#168918)
We already know we're looking at BITREVERSE, we can match on the source operand.
1 parent d430230 commit c23f8c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11763,12 +11763,12 @@ SDValue DAGCombiner::visitBITREVERSE(SDNode *N) {
1176311763

1176411764
// fold (bitreverse (lshr (bitreverse x), y)) -> (shl x, y)
1176511765
if ((!LegalOperations || TLI.isOperationLegal(ISD::SHL, VT)) &&
11766-
sd_match(N, m_BitReverse(m_Srl(m_BitReverse(m_Value(X)), m_Value(Y)))))
11766+
sd_match(N0, m_Srl(m_BitReverse(m_Value(X)), m_Value(Y))))
1176711767
return DAG.getNode(ISD::SHL, DL, VT, X, Y);
1176811768

1176911769
// fold (bitreverse (shl (bitreverse x), y)) -> (lshr x, y)
1177011770
if ((!LegalOperations || TLI.isOperationLegal(ISD::SRL, VT)) &&
11771-
sd_match(N, m_BitReverse(m_Shl(m_BitReverse(m_Value(X)), m_Value(Y)))))
11771+
sd_match(N0, m_Shl(m_BitReverse(m_Value(X)), m_Value(Y))))
1177211772
return DAG.getNode(ISD::SRL, DL, VT, X, Y);
1177311773

1177411774
return SDValue();

0 commit comments

Comments
 (0)