Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[PowerPC] catch v2i64 shift left by 1 is add case #138772

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 2 commits into from
May 13, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
address comment
  • Loading branch information
RolandF77 committed May 12, 2025
commit 62f06a4a333d1a2f46d7026a64ca0f4f6bf902da
11 changes: 6 additions & 5 deletions 11 llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18458,16 +18458,17 @@ static SDValue stripModuloOnShift(const TargetLowering &TLI, SDNode *N,

SDValue PPCTargetLowering::combineVectorSHL(SDNode *N,
DAGCombinerInfo &DCI) const {
assert(N->getValueType(0).isVector() && "Vector type expected.");
EVT VT = N->getValueType(0);
assert(VT.isVector() && "Vector type expected.");

SDValue N1 = N->getOperand(1);
if (!Subtarget.hasP8Altivec() || N1.getOpcode() != ISD::BUILD_VECTOR ||
!isOperationLegal(ISD::ADD, N->getValueType(0)))
!isOperationLegal(ISD::ADD, VT))
return SDValue();

// For 64-bit there is no splat immediate so we want to catch shift by 1 here
// before the BUILD_VECTOR is replaced by a load.
EVT EltTy = N->getValueType(0).getScalarType();
EVT EltTy = VT.getScalarType();
if (EltTy != MVT::i64)
return SDValue();

Expand All @@ -18484,8 +18485,8 @@ SDValue PPCTargetLowering::combineVectorSHL(SDNode *N,
if (SplatBits != 1)
return SDValue();

return DCI.DAG.getNode(ISD::ADD, SDLoc(N), N->getValueType(0),
N->getOperand(0), N->getOperand(0));
SDValue N0 = N->getOperand(0);
return DCI.DAG.getNode(ISD::ADD, SDLoc(N), VT, N0, N0);
}

SDValue PPCTargetLowering::combineSHL(SDNode *N, DAGCombinerInfo &DCI) const {
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.