Skip to content

Commit cdd3214

Browse files
authored
[TargetLowering] Use getShiftAmountConstant. NFC (#123802)
Previously we always used the pointer size which might need to be legalized on some targets.
1 parent a0ec385 commit cdd3214

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10959,12 +10959,9 @@ void TargetLowering::forceExpandWideMUL(SelectionDAG &DAG, const SDLoc &dl,
1095910959
// The high part is obtained by SRA'ing all but one of the bits of low
1096010960
// part.
1096110961
unsigned LoSize = VT.getFixedSizeInBits();
10962-
HiLHS = DAG.getNode(
10963-
ISD::SRA, dl, VT, LHS,
10964-
DAG.getConstant(LoSize - 1, dl, getPointerTy(DAG.getDataLayout())));
10965-
HiRHS = DAG.getNode(
10966-
ISD::SRA, dl, VT, RHS,
10967-
DAG.getConstant(LoSize - 1, dl, getPointerTy(DAG.getDataLayout())));
10962+
SDValue Shift = DAG.getShiftAmountConstant(LoSize - 1, VT, dl);
10963+
HiLHS = DAG.getNode(ISD::SRA, dl, VT, LHS, Shift);
10964+
HiRHS = DAG.getNode(ISD::SRA, dl, VT, RHS, Shift);
1096810965
} else {
1096910966
HiLHS = DAG.getConstant(0, dl, VT);
1097010967
HiRHS = DAG.getConstant(0, dl, VT);

0 commit comments

Comments
 (0)