You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a scalar value that we want to negate and then splat, we can either:
negate the scalar, then splat
splat it, then negate the vector
define <2 x i32> @src(i32%x, <2 x i32> %y) {
%not.x = xori32%x, -1%not.x.head = insertelement <2 x i32> poison, i32%not.x, i640%not.x.splat = shufflevector <2 x i32> %not.x.head, <2 x i32> poison, <2 x i32> zeroinitializer%res = and <2 x i32> %not.x.splat, %yret <2 x i32> %res
}
define <2 x i32> @tgt(i32%x, <2 x i32> %y) {
%x.head = insertelement <2 x i32> poison, i32%x, i640%x.splat = shufflevector <2 x i32> %x.head, <2 x i32> poison, <2 x i32> zeroinitializer%not.x.splat = xor <2 x i32> %x.splat, shufflevector (<2 x i32> insertelement (<2 x i32> poison, i32 -1, i320), <2 x i32> poison, <2 x i32> zeroinitializer)
%res = and <2 x i32> %not.x.splat, %yret <2 x i32> %res
}
InstCombine doesn't seem to canonicalise it, but I think it could be beneficial to transform to the former.
This would aid in instruction selection for some instructions like vandn.vx on RISC-V
(Excuse the gratuitous splatting: this originally came from an example on scalable vectors, but I had to convert it to fixed for it to work on Alive)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Alive link: https://alive2.llvm.org/ce/z/4KIIpC
If we have a scalar value that we want to negate and then splat, we can either:
InstCombine doesn't seem to canonicalise it, but I think it could be beneficial to transform to the former.
This would aid in instruction selection for some instructions like
vandn.vx
on RISC-V(Excuse the gratuitous splatting: this originally came from an example on scalable vectors, but I had to convert it to fixed for it to work on Alive)
The text was updated successfully, but these errors were encountered: