summaryrefslogtreecommitdiff
path: root/mlir
diff options
context:
space:
mode:
authorTobias Gysi <tobias.gysi@nextsilicon.com>2023-05-17 11:25:24 +0000
committerTobias Gysi <tobias.gysi@nextsilicon.com>2023-05-17 11:25:39 +0000
commitc1def63fcccf6aba3217b7818e23393ed655bf25 (patch)
tree145da3f7072ea775c69d717f75f76c956f51336d /mlir
parent55013ba747485df0efb1be77c571bbc2193651f6 (diff)
downloadllvm-c1def63fcccf6aba3217b7818e23393ed655bf25.tar.gz
[mlir][llvm] Mark additional ops as pure.
The revision marks the overflow arithmetic intrinsics and the freeze operation as pure. This change enables inlining and possible other optimizations for these operations. Reviewed By: Dinistro Differential Revision: https://reviews.llvm.org/D150679
Diffstat (limited to 'mlir')
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td2
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td2
2 files changed, 2 insertions, 2 deletions
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
index 03c3979212ca..7ac68c9606cc 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
@@ -251,7 +251,7 @@ def LLVM_LifetimeEndOp : LLVM_LifetimeBaseOp<"lifetime.end"> {
// Intrinsics with multiple returns.
class LLVM_ArithWithOverflowOp<string mnem>
- : LLVM_IntrOp<mnem, [0], [], [SameOperandsElementType], 2>,
+ : LLVM_IntrOp<mnem, [0], [], [Pure, SameOperandsElementType], 2>,
Arguments<(ins LLVM_ScalarOrVectorOf<AnySignlessInteger>,
LLVM_ScalarOrVectorOf<AnySignlessInteger>)>;
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 3ead2d2867a6..e6aed104b6d3 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -797,7 +797,7 @@ def LLVM_SelectOp
$res = op;
}];
}
-def LLVM_FreezeOp : LLVM_Op<"freeze", [SameOperandsAndResultType]> {
+def LLVM_FreezeOp : LLVM_Op<"freeze", [Pure, SameOperandsAndResultType]> {
let arguments = (ins LLVM_Type:$val);
let results = (outs LLVM_Type:$res);
let builders = [LLVM_OneResultOpBuilder];