Issue |
144656
|
Summary |
[VectorCombine] foldShuffleOfShuffles - failure to fold shuffle(shuffle(x,y),undef) length changing masks
|
Labels |
llvm:instcombine,
missed-optimization
|
Assignees |
|
Reporter |
RKSimon
|
```ll
define <8 x float> @shuffle(<4 x float> %a0, <4 x float> %a1) {
%x = shufflevector <4 x float> %a0, <4 x float> %a1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%y = shufflevector <8 x float> %x, <8 x float> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
ret <8 x float> %y
}
```
foldShuffleOfShuffles currently fails to merge "permute of shuffle" patterns if the vector length changes
But it will happily fold:
```ll
define <4 x float> @shuffle2(<4 x float> %a0, <4 x float> %a1) {
%x = shufflevector <4 x float> %a0, <4 x float> %a1, <4 x i32> <i32 0, i32 4, i32 5, i32 3>
%y = shufflevector <4 x float> %x, <4 x float> poison, <4 x i32> <i32 0, i32 3, i32 1, i32 2>
ret <4 x float> %y
}
->
define <4 x float> @shuffle2(<4 x float> %a0, <4 x float> %a1) {
%y = shufflevector <4 x float> %a0, <4 x float> %a1, <4 x i32> <i32 0, i32 3, i32 4, i32 5>
ret <4 x float> %y
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs