@@ -1939,8 +1939,8 @@ static bool foldMaskAndShiftToExtract(SelectionDAG &DAG, SDValue N,
1939
1939
SDValue NewMask = DAG.getConstant (0xff , DL, XVT);
1940
1940
SDValue Srl = DAG.getNode (ISD::SRL, DL, XVT, X, Eight);
1941
1941
SDValue And = DAG.getNode (ISD::AND, DL, XVT, Srl, NewMask);
1942
- SDValue ShlCount = DAG.getConstant (ScaleLog, DL, MVT::i8 );
1943
1942
SDValue Ext = DAG.getZExtOrTrunc (And, DL, VT);
1943
+ SDValue ShlCount = DAG.getConstant (ScaleLog, DL, MVT::i8 );
1944
1944
SDValue Shl = DAG.getNode (ISD::SHL, DL, VT, Ext, ShlCount);
1945
1945
1946
1946
// Insert the new nodes into the topological ordering. We must do this in
@@ -1949,12 +1949,11 @@ static bool foldMaskAndShiftToExtract(SelectionDAG &DAG, SDValue N,
1949
1949
// essentially a pre-flattened and pre-sorted sequence of nodes. There is no
1950
1950
// hierarchy left to express.
1951
1951
insertDAGNode (DAG, N, Eight);
1952
- insertDAGNode (DAG, N, Srl);
1953
1952
insertDAGNode (DAG, N, NewMask);
1953
+ insertDAGNode (DAG, N, Srl);
1954
1954
insertDAGNode (DAG, N, And);
1955
+ insertDAGNode (DAG, N, Ext);
1955
1956
insertDAGNode (DAG, N, ShlCount);
1956
- if (Ext != And)
1957
- insertDAGNode (DAG, N, Ext);
1958
1957
insertDAGNode (DAG, N, Shl);
1959
1958
DAG.ReplaceAllUsesWith (N, Shl);
1960
1959
DAG.RemoveDeadNode (N.getNode ());
0 commit comments