diff options
author | Tobias Gysi <tobias.gysi@nextsilicon.com> | 2023-05-17 11:25:24 +0000 |
---|---|---|
committer | Tobias Gysi <tobias.gysi@nextsilicon.com> | 2023-05-17 11:25:39 +0000 |
commit | c1def63fcccf6aba3217b7818e23393ed655bf25 (patch) | |
tree | 145da3f7072ea775c69d717f75f76c956f51336d /mlir | |
parent | 55013ba747485df0efb1be77c571bbc2193651f6 (diff) | |
download | llvm-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.td | 2 | ||||
-rw-r--r-- | mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 2 |
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]; |