[PATCH] D158160: [RISCV] Add test case showing vmerge fold miscompile with tail policy
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 17 03:00:01 PDT 2023
luke updated this revision to Diff 551062.
luke added a comment.
Use poison instead of undef
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158160/new/
https://reviews.llvm.org/D158160
Files:
llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll
Index: llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll
+++ llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll
@@ -1065,3 +1065,15 @@
ret <vscale x 2 x i32> %b
}
+; FIXME: The vadd's new policy should be tail undisturbed since the false op of
+; the vmerge moves from the the body to the tail, and we need to preserve it.
+define <vscale x 2 x i32> @vmerge_larger_vl_false_becomes_tail(<vscale x 2 x i32> %false, <vscale x 2 x i32> %x, <vscale x 2 x i32> %y, <vscale x 2 x i1> %m) {
+; CHECK-LABEL: vmerge_larger_vl_false_becomes_tail:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vsetivli zero, 2, e32, m1, ta, mu
+; CHECK-NEXT: vadd.vv v8, v9, v10, v0.t
+; CHECK-NEXT: ret
+ %a = call <vscale x 2 x i32> @llvm.riscv.vadd.nxv2i32.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> %x, <vscale x 2 x i32> %y, i64 2)
+ %b = call <vscale x 2 x i32> @llvm.riscv.vmerge.nxv2i32.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> %false, <vscale x 2 x i32> %a, <vscale x 2 x i1> %m, i64 3)
+ ret <vscale x 2 x i32> %b
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158160.551062.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230817/eef7d993/attachment.bin>
More information about the llvm-commits
mailing list