Skip to content

Commit 21fb474

Browse files
committed
[Matrix] Mark matrix memory intrinsics as argmemonly/write|read mem.
matrix.columnwise.load and matrix.columnwise.store only access memory through the argument pointers. Also matrix.columnwise.store only writes memory. (Cherry-picked from 8c681f5)
1 parent f87d772 commit 21fb474

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,16 +1272,17 @@ def int_matrix_columnwise_load : Intrinsic<[llvm_anyvector_ty],
12721272
llvm_i32_ty,
12731273
llvm_i32_ty,
12741274
llvm_i32_ty],
1275-
[IntrReadMem, IntrWillReturn,
1276-
ImmArg<2>, ImmArg<3>]>;
1275+
[IntrArgMemOnly, IntrReadMem,
1276+
IntrWillReturn, ImmArg<2>, ImmArg<3>]>;
12771277

12781278
def int_matrix_columnwise_store : Intrinsic<[],
12791279
[llvm_anyvector_ty,
12801280
LLVMAnyPointerType<LLVMMatchType<0>>,
12811281
llvm_i32_ty,
12821282
llvm_i32_ty,
12831283
llvm_i32_ty],
1284-
[WriteOnly<1>, IntrWillReturn,
1284+
[IntrArgMemOnly, IntrWillReturn,
1285+
IntrWriteMem, WriteOnly<1>,
12851286
ImmArg<3>, ImmArg<4>]>;
12861287

12871288
//===---------- Intrinsics to control hardware supported loops ----------===//

llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,9 @@ entry:
6666
%load = call <8 x double> @llvm.matrix.columnwise.load.v8f64(<8 x double>* %in, i32 %stride, i32 4, i32 2)
6767
ret <8 x double> %load
6868
}
69+
70+
; CHECK: declare <9 x double> @llvm.matrix.columnwise.load.v9f64.p0v9f64(<9 x double>*, i32, i32 immarg, i32 immarg) [[READONLY:#[0-9]]]
71+
72+
; CHECK: declare <8 x double> @llvm.matrix.columnwise.load.v8f64.p0v8f64(<8 x double>*, i32, i32 immarg, i32 immarg) [[READONLY]]
73+
74+
; CHECK: attributes [[READONLY]] = { argmemonly nounwind readonly willreturn }

llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,9 @@ define void @strided_store_2x3(<10 x double> %in, double* %out) {
6666
}
6767

6868
declare void @llvm.matrix.columnwise.store.v10f64(<10 x double>, double*, i32, i32, i32)
69+
70+
; CHECK: declare void @llvm.matrix.columnwise.store.v6f64.p0f64(<6 x double>, double* writeonly, i32, i32 immarg, i32 immarg) [[WRITEONLY:#[0-9]]]
71+
72+
; CHECK: declare void @llvm.matrix.columnwise.store.v10f64.p0f64(<10 x double>, double* writeonly, i32, i32 immarg, i32 immarg) [[WRITEONLY]]
73+
74+
; CHECK: attributes [[WRITEONLY]] = { argmemonly nounwind willreturn writeonly }

0 commit comments

Comments
 (0)