[llvm] DSE: pre-commit tests for scalable vectors (PR #110669)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 28 03:53:26 PST 2024


================
@@ -655,3 +655,81 @@ exit:
   call void @use(ptr %p) argmemonly
   ret void
 }
+
+define void @scalable_scalable_redundant_store(ptr %ptr) {
+; CHECK-LABEL: @scalable_scalable_redundant_store(
+; CHECK-NEXT:    [[GEP:%.*]] = getelementptr i64, ptr [[PTR:%.*]], i64 2
+; CHECK-NEXT:    store <vscale x 2 x i64> zeroinitializer, ptr [[GEP]], align 16
+; CHECK-NEXT:    store <vscale x 4 x i64> zeroinitializer, ptr [[PTR]], align 32
+; CHECK-NEXT:    ret void
+;
+  %gep = getelementptr i64, ptr %ptr, i64 2
----------------
fhahn wrote:

nit: adjusting the name to include the offset may make things slightly easier to read.

```suggestion
  %gep.ptr.2 = getelementptr i64, ptr %ptr, i64 2
```

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


More information about the llvm-commits mailing list