@@ -10983,28 +10983,28 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
10983
10983
// -> (logic_op (srl x, c1), (zext y))
10984
10984
// c1 <= leadingzeros(zext(y))
10985
10985
if (N1C && ISD::isBitwiseLogicOp(N0.getOpcode()) && N0.hasOneUse()) {
10986
- SDValue lhs = N0.getOperand(0);
10987
- SDValue rhs = N0.getOperand(1);
10988
- SDValue shl ;
10989
- SDValue other ;
10990
- if (lhs .getOpcode() == ISD::SHL) {
10991
- shl = lhs ;
10992
- other = rhs ;
10993
- } else if (rhs .getOpcode() == ISD::SHL) {
10994
- shl = rhs ;
10995
- other = lhs ;
10996
- }
10997
- if (shl && shl .getOperand(1) == N1 && shl .hasOneUse()) {
10998
- SDValue zext = shl .getOperand(0);
10999
- if (zext .getOpcode() == ISD::ZERO_EXTEND) {
11000
- unsigned numLeadingZeros =
11001
- zext .getValueType().getScalarSizeInBits() -
11002
- zext .getOperand(0).getValueType().getScalarSizeInBits();
11003
- if (N1C->getZExtValue() <= numLeadingZeros ) {
10986
+ SDValue LHS = N0.getOperand(0);
10987
+ SDValue RHS = N0.getOperand(1);
10988
+ SDValue SHL ;
10989
+ SDValue Other ;
10990
+ if (LHS .getOpcode() == ISD::SHL) {
10991
+ SHL = LHS ;
10992
+ Other = RHS ;
10993
+ } else if (RHS .getOpcode() == ISD::SHL) {
10994
+ SHL = RHS ;
10995
+ Other = LHS ;
10996
+ }
10997
+ if (SHL && SHL .getOperand(1) == N1 && SHL .hasOneUse()) {
10998
+ SDValue ZExt = SHL .getOperand(0);
10999
+ if (ZExt .getOpcode() == ISD::ZERO_EXTEND) {
11000
+ unsigned NumLeadingZeros =
11001
+ ZExt .getValueType().getScalarSizeInBits() -
11002
+ ZExt .getOperand(0).getValueType().getScalarSizeInBits();
11003
+ if (N1C->getZExtValue() <= NumLeadingZeros ) {
11004
11004
return DAG.getNode(
11005
11005
N0.getOpcode(), SDLoc(N0), VT,
11006
- DAG.getNode(ISD::SRL, SDLoc(N0), VT, other , N1),
11007
- zext );
11006
+ DAG.getNode(ISD::SRL, SDLoc(N0), VT, Other , N1),
11007
+ ZExt );
11008
11008
}
11009
11009
}
11010
11010
}
0 commit comments