Skip to content

[TargetLowering] Use getShiftAmountConstant. NFC #123802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10959,12 +10959,9 @@ void TargetLowering::forceExpandWideMUL(SelectionDAG &DAG, const SDLoc &dl,
// The high part is obtained by SRA'ing all but one of the bits of low
// part.
unsigned LoSize = VT.getFixedSizeInBits();
HiLHS = DAG.getNode(
ISD::SRA, dl, VT, LHS,
DAG.getConstant(LoSize - 1, dl, getPointerTy(DAG.getDataLayout())));
HiRHS = DAG.getNode(
ISD::SRA, dl, VT, RHS,
DAG.getConstant(LoSize - 1, dl, getPointerTy(DAG.getDataLayout())));
SDValue Shift = DAG.getShiftAmountConstant(LoSize - 1, VT, dl);
HiLHS = DAG.getNode(ISD::SRA, dl, VT, LHS, Shift);
HiRHS = DAG.getNode(ISD::SRA, dl, VT, RHS, Shift);
} else {
HiLHS = DAG.getConstant(0, dl, VT);
HiRHS = DAG.getConstant(0, dl, VT);
Expand Down
Loading