Open Quuxplusone opened 3 years ago
Bugzilla Link | PR49616 |
Status | NEW |
Importance | P enhancement |
Reported by | Simon Pilgrim (llvm-dev@redking.me.uk) |
Reported on | 2021-03-17 09:07:12 -0700 |
Last modified on | 2021-03-17 11:32:26 -0700 |
Version | trunk |
Hardware | PC Windows NT |
CC | anton.a.afanasyev@gmail.com, florian_hahn@apple.com, lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I think instcombine already has something to deal with this kind of problem,
perhaps it doesn't handle ext/trunc/saturating math?
https://godbolt.org/z/ePMEeT
We don't even fold:
define <4 x i32> @reverse_add_basic(<4 x i32> %a0, <4 x i32> %a1) {
%r0 = shufflevector <4 x i32> %a0, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%ss = add <4 x i32> %r0, %a1
%r1 = shufflevector <4 x i32> %ss, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
ret <4 x i32> %r1
}
to:
define <4 x i32> @reverse_add_basic(<4 x i32> %a0, <4 x i32> %a1) {
%r1 = shufflevector <4 x i32> %a1, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%ss = add <4 x i32> %a0, %r1
ret <4 x i32> %ss
}
let alone anything that contains zext/trunc/intrinsics....
[Bug #46894] is sort of related to intrinsics handling