[llvm] [Matrix] Add tests identifying GVN and DSE opportunities for matrix store / load intrinsics (PR #163573)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 11:42:52 PDT 2025


================
@@ -0,0 +1,43 @@
+; RUN: opt %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
+
+; BasicAA should prove that loads from sufficiently large static offsets
+; don't overlap with matrix loads with a statically known size.
+
+define <8 x double> @non_overlapping_strided_load(ptr %src) {
+entry:
+  %src.offset = getelementptr inbounds double, ptr %src, i32 12
+  %l = call <8 x double> @llvm.matrix.column.major.load.v8f64.i32(ptr %src.offset, i32 8, i1 false, i32 4, i32 2)
+  call void @llvm.matrix.column.major.store(<8 x double> %l, ptr %src, i32 8, i1 false, i32 4, i32 2)
+  %l.2 = call <8 x double> @llvm.matrix.column.major.load.v8f64.i32(ptr %src.offset, i32 8, i1 false, i32 4, i32 2)
+  %s = fadd <8 x double> %l, %l.2
+  ret <8 x double> %s
+}
+
+; CHECK-LABEL: Function: non_overlapping_strided_load:
----------------
fhahn wrote:

can you move the checks just before the function?

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


More information about the llvm-commits mailing list