[all-commits] [llvm/llvm-project] 7e439d: [VectorCombine] Skip foldShuffleOfIntrinsics when ...
khaki3 via All-commits
all-commits at lists.llvm.org
Wed Jun 3 11:58:43 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7e439d571e3dcf420448391eb76e58879e73ee1e
https://github.com/llvm/llvm-project/commit/7e439d571e3dcf420448391eb76e58879e73ee1e
Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)
Changed paths:
M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
M llvm/test/Transforms/VectorCombine/X86/shuffle-of-intrinsics.ll
Log Message:
-----------
[VectorCombine] Skip foldShuffleOfIntrinsics when operand types differ (#201241)
Example:
```llvm
define <4 x i32> @t(<2 x float> %a, <2 x double> %b) {
%fa = call <2 x i32> @llvm.fptosi.sat.v2i32.v2f32(<2 x float> %a)
%fb = call <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double> %b)
%s = shufflevector <2 x i32> %fa, <2 x i32> %fb, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x i32> %s
}
```
In this code, `foldShuffleOfIntrinsics` folds `shuffle(intrinsic(x),
intrinsic(y))` into `intrinsic(shuffle(x, y))`, but only checks the
result type, not the operand types. Since `fptosi.sat` is overloaded on
its operand type, the two calls share an `<2 x i32>` result but have
different operands (`<2 x float>` vs `<2 x double>`), so the new
`shufflevector` gets mismatched operands and trips `isValidOperands`.
Fix: bail out when the intrinsics' shuffled operands have different
types.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list