[llvm] [InstSimplify] Add basic simplifications for vp.reverse (PR #144112)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 09:51:50 PDT 2025
================
@@ -25,26 +23,23 @@ define <vscale x 4 x i32> @rev_of_rev_diffevl(<vscale x 4 x i32> %a, i32 %evl) {
define <vscale x 4 x i32> @rev_of_poison(i32 %evl) {
; CHECK-LABEL: @rev_of_poison(
-; CHECK-NEXT: [[REV:%.*]] = tail call <vscale x 4 x i32> @llvm.experimental.vp.reverse.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i1> splat (i1 true), i32 [[EVL:%.*]])
-; CHECK-NEXT: ret <vscale x 4 x i32> [[REV]]
+; CHECK-NEXT: ret <vscale x 4 x i32> poison
;
%rev = tail call <vscale x 4 x i32> @llvm.experimental.vp.reverse(<vscale x 4 x i32> poison, <vscale x 4 x i1> splat (i1 true), i32 %evl)
ret <vscale x 4 x i32> %rev
}
define <vscale x 4 x i32> @rev_of_undef(i32 %evl) {
----------------
preames wrote:
I want to push back a bit here. There's a big difference between removing undef from tests where the undef is the result of reduction, or doesn't reflect test intention. This case is specifically testing correct behavior of an undef fold. I would hope we are *not* removing such cases, that would seem actively undesirable.
https://github.com/llvm/llvm-project/pull/144112
More information about the llvm-commits
mailing list