Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@mnadeem Nice patch.
I believe you need to test the other way around for binary operations, no?
I left a comment, I hope it makes sense.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | ||
---|---|---|
2066 | Why are you not simplifying define <vscale x 4 x i32> @binop_reverse_splat(<vscale x 4 x i32> %a, i32 %b) { %reva = tail call <vscale x 4 x i32> @llvm.experimental.vector.reverse.nxv4i32(<vscale x 4 x i32> %a) %splat_insert = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0 %splat = shufflevector <vscale x 4 x i32> %splat_insert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer %add = add <vscale x 4 x i32> %splat, %reva %revadd = tail call <vscale x 4 x i32> @llvm.experimental.vector.reverse.nxv4i32(<vscale x 4 x i32> %add) ret <vscale x 4 x i32> %revadd } I do not see any simplification. |
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | ||
---|---|---|
2066 | Good catch, I'll update the code. I only tested some C code and it seemed like there was some kind of canonicalization going on where the RHS is made to be the splat. It seems like this is only the case if the value is a constant. |
Address comments, handle cases where either side of the binary op is a splat and the other is a reverse.
Why are you not simplifying
rev(binop Splat, rev(X)) --> binop, Splat, X.
too?
When I run this test:
I do not see any simplification.