Skip to content

[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift patterns#200136

Merged
RKSimon merged 1 commit into
llvm:mainfrom
RKSimon:x86-shuffle-shld
May 28, 2026
Merged

[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift patterns#200136
RKSimon merged 1 commit into
llvm:mainfrom
RKSimon:x86-shuffle-shld

Conversation

@RKSimon
Copy link
Copy Markdown
Contributor

@RKSimon RKSimon commented May 28, 2026

Add matchShuffleAsVSHLD helper to recognise shuffle masks that can fold to funnel shifts

Fixes #145276

…patterns

Add matchShuffleAsVSHLD helper to recognise shuffle masks that can fold to funnel shifts

Fixes llvm#145276
@RKSimon RKSimon added the skip-precommit-approval PR for CI feedback, not intended for review label May 28, 2026
@RKSimon RKSimon enabled auto-merge (squash) May 28, 2026 09:04
@RKSimon RKSimon merged commit 86a7478 into llvm:main May 28, 2026
12 of 13 checks passed
@RKSimon RKSimon deleted the x86-shuffle-shld branch May 28, 2026 09:44
@carlsotr
Copy link
Copy Markdown

Should these returns of Shift * 8 have been Shift * ScalarSizeInBits? This appears incorrect for i32 shuffles.

define <8 x i32> @combine_vpshldq_v8i32_shuffle(<8 x i32> %a, <8 x i32> %b) {
  %r = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 8, i32 3, i32 10, i32 5, i32 12, i32 7, i32 14>
  ret <8 x i32> %r
}

https://godbolt.org/z/h4G9nP6v3

RKSimon added a commit that referenced this pull request May 30, 2026
…l shift patterns" (#200546)

Reverts #200136 while I investigate a miscompilation report
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request May 30, 2026
…:SHLD funnel shift patterns" (#200546)

Reverts llvm/llvm-project#200136 while I investigate a miscompilation report
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request May 30, 2026
…:SHLD funnel shift patterns" (#200546)

Reverts llvm/llvm-project#200136 while I investigate a miscompilation report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:X86 skip-precommit-approval PR for CI feedback, not intended for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some shufflevectors should emit as a single shld/shrd instruction

2 participants