| Issue |
185556
|
| Summary |
Missed Optimization: Failure to narrow a wide vector load and adjust GEP offset when only trailing elements are used.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Leo0506
|
```
define <2 x float> @src(ptr %arg0) {
%v0 = getelementptr inbounds nuw i8, ptr %arg0, i64 40
%v1 = load <4 x float>, ptr %v0, align 8
%v2 = shufflevector <4 x float> %v1, <4 x float> poison, <2 x i32> <i32 2, i32 3>
ret <2 x float> %v2
}
define <2 x float> @tgt(ptr %arg0) {
%v0 = getelementptr inbounds nuw i8, ptr %arg0, i64 48
%v1 = load <2 x float>, ptr %v0, align 8
ret <2 x float> %v1
}
```
Godbolt: https://godbolt.org/z/1nKbrnxfM
alive2: https://alive2.llvm.org/ce/z/DZj48j
Pattern found in: https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/pbrt-v4/optimized/camera.ll
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs