[llvm] 8c681f5 - [Matrix] Mark matrix memory intrinsics as argmemonly/write|read mem.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 04:34:13 PST 2020


Author: Florian Hahn
Date: 2020-02-04T12:32:45Z
New Revision: 8c681f5e4706d3d2980f19f08dd0d4c40496a8d5

URL: https://github.com/llvm/llvm-project/commit/8c681f5e4706d3d2980f19f08dd0d4c40496a8d5
DIFF: https://github.com/llvm/llvm-project/commit/8c681f5e4706d3d2980f19f08dd0d4c40496a8d5.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/include/llvm/IR/Intrinsics.td
    llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll
    llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index f5c5c23cf97f..307fb3e5bf46 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -1302,8 +1302,8 @@ def int_matrix_columnwise_load : Intrinsic<[llvm_anyvector_ty],
                                             llvm_i32_ty,
                                             llvm_i32_ty,
                                             llvm_i32_ty],
-                                           [IntrReadMem, IntrWillReturn,
-                                            ImmArg<2>, ImmArg<3>]>;
+                                           [IntrArgMemOnly, IntrReadMem,
+                                            IntrWillReturn, ImmArg<2>, ImmArg<3>]>;
 
 def int_matrix_columnwise_store : Intrinsic<[],
                                             [llvm_anyvector_ty,
@@ -1311,7 +1311,8 @@ def int_matrix_columnwise_store : Intrinsic<[],
                                              llvm_i32_ty,
                                              llvm_i32_ty,
                                              llvm_i32_ty],
-                                            [WriteOnly<1>, IntrWillReturn,
+                                            [IntrArgMemOnly, IntrWillReturn,
+                                             IntrWriteMem, WriteOnly<1>,
                                              ImmArg<3>, ImmArg<4>]>;
 
 //===---------- Intrinsics to control hardware supported loops ----------===//

diff  --git a/llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll b/llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll
index c5bdb4f32cbc..27adbc2cb980 100644
--- a/llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll
+++ b/llvm/test/Transforms/LowerMatrixIntrinsics/strided-load-double.ll
@@ -66,3 +66,9 @@ entry:
   %load = call <8 x double> @llvm.matrix.columnwise.load.v8f64(<8 x double>* %in, i32 %stride, i32 4, i32 2)
   ret <8 x double> %load
 }
+
+; CHECK: declare <9 x double> @llvm.matrix.columnwise.load.v9f64.p0v9f64(<9 x double>*, i32, i32 immarg, i32 immarg) [[READONLY:#[0-9]]]
+
+; CHECK: declare <8 x double> @llvm.matrix.columnwise.load.v8f64.p0v8f64(<8 x double>*, i32, i32 immarg, i32 immarg) [[READONLY]]
+
+; CHECK: attributes [[READONLY]] = { argmemonly nounwind readonly willreturn }

diff  --git a/llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll b/llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
index 377c7effbbf9..99e1e381f83a 100644
--- a/llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
+++ b/llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
@@ -66,3 +66,9 @@ define void @strided_store_2x3(<10 x double> %in, double* %out) {
 }
 
 declare void @llvm.matrix.columnwise.store.v10f64(<10 x double>, double*, i32, i32, i32)
+
+; CHECK: declare void @llvm.matrix.columnwise.store.v6f64.p0f64(<6 x double>, double* writeonly, i32, i32 immarg, i32 immarg) [[WRITEONLY:#[0-9]]]
+
+; CHECK: declare void @llvm.matrix.columnwise.store.v10f64.p0f64(<10 x double>, double* writeonly, i32, i32 immarg, i32 immarg) [[WRITEONLY]]
+
+; CHECK: attributes [[WRITEONLY]] = { argmemonly nounwind willreturn writeonly }


        


More information about the llvm-commits mailing list