[llvm] [RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (PR #82506)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 10:21:31 PST 2024


================
@@ -15086,22 +15086,18 @@ define <32 x i64> @mgather_strided_split(ptr %base) {
   ret <32 x i64> %x
 }
 
-; FIXME: This is a miscompile triggered by the mgather ->
-; riscv.masked.strided.load combine. In order for it to trigger we need either a
-; strided gather that RISCVGatherScatterLowering doesn't pick up, or a new
-; strided gather generated by the widening sew combine.
 define <4 x i32> @masked_gather_widen_sew_negative_stride(ptr %base) {
 ; RV32V-LABEL: masked_gather_widen_sew_negative_stride:
 ; RV32V:       # %bb.0:
-; RV32V-NEXT:    addi a0, a0, -128
+; RV32V-NEXT:    addi a0, a0, 128
 ; RV32V-NEXT:    li a1, -128
----------------
topperc wrote:

I think I would like to see something closer to the original test case where we also calculated the wrong stride. Here the stride was correct.

https://github.com/llvm/llvm-project/pull/82506


More information about the llvm-commits mailing list