Skip to content

Commit a3c5c83

Browse files
committed
[DAGCombiner] Remove unneeded getValueType() calls in visitMULHS/MULHU. NFC
We have an existing VT variable that should match N0.getValueType.
1 parent af784a5 commit a3c5c83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5101,9 +5101,9 @@ SDValue DAGCombiner::visitMULHS(SDNode *N) {
51015101

51025102
// fold (mulhs x, 1) -> (sra x, size(x)-1)
51035103
if (isOneConstant(N1))
5104-
return DAG.getNode(ISD::SRA, DL, N0.getValueType(), N0,
5104+
return DAG.getNode(ISD::SRA, DL, VT, N0,
51055105
DAG.getConstant(N0.getScalarValueSizeInBits() - 1, DL,
5106-
getShiftAmountTy(N0.getValueType())));
5106+
getShiftAmountTy(VT)));
51075107

51085108
// fold (mulhs x, undef) -> 0
51095109
if (N0.isUndef() || N1.isUndef())
@@ -5161,7 +5161,7 @@ SDValue DAGCombiner::visitMULHU(SDNode *N) {
51615161

51625162
// fold (mulhu x, 1) -> 0
51635163
if (isOneConstant(N1))
5164-
return DAG.getConstant(0, DL, N0.getValueType());
5164+
return DAG.getConstant(0, DL, VT);
51655165

51665166
// fold (mulhu x, undef) -> 0
51675167
if (N0.isUndef() || N1.isUndef())

0 commit comments

Comments
 (0)