[Mlir-commits] [mlir] 66e536b - [mlir] [LLVMIR] Mark reductions as side-effect free

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Aug 25 13:09:29 PDT 2020


Author: aartbik
Date: 2020-08-25T13:09:19-07:00
New Revision: 66e536bc36fb51da1732c8f093f07b5c600df3fe

URL: https://github.com/llvm/llvm-project/commit/66e536bc36fb51da1732c8f093f07b5c600df3fe
DIFF: https://github.com/llvm/llvm-project/commit/66e536bc36fb51da1732c8f093f07b5c600df3fe.diff

LOG: [mlir] [LLVMIR] Mark reductions as side-effect free

Attribute was missing from original base class.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D86569

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
index 226743587bd9..1f0eb6aab58a 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
@@ -15,6 +15,7 @@
 #define LLVMIR_OP_BASE
 
 include "mlir/IR/OpBase.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
 
 def LLVM_Dialect : Dialect {
   let name = "llvm";
@@ -212,13 +213,15 @@ class LLVM_OneResultIntrOp<string mnem, list<int> overloadedResults = [],
 
 // LLVM vector reduction over a single vector.
 class LLVM_VectorReduction<string mnem>
-    : LLVM_OneResultIntrOp<"experimental.vector.reduce." # mnem, [], [0], []>,
+    : LLVM_OneResultIntrOp<"experimental.vector.reduce." # mnem,
+                           [], [0], [NoSideEffect]>,
       Arguments<(ins LLVM_Type)>;
 
 // LLVM vector reduction over a single vector, with an initial value,
 // and with permission to reassociate the reduction operations.
 class LLVM_VectorReductionV2<string mnem>
-    : LLVM_OpBase<LLVM_Dialect, "intr.experimental.vector.reduce.v2." # mnem, []>,
+    : LLVM_OpBase<LLVM_Dialect, "intr.experimental.vector.reduce.v2." # mnem,
+                  [NoSideEffect]>,
       Results<(outs LLVM_Type:$res)>,
       Arguments<(ins LLVM_Type, LLVM_Type,
                  DefaultValuedAttr<BoolAttr, "false">:$reassoc)> {


        


More information about the Mlir-commits mailing list