Skip to content

Commit c1def63

Browse files
committed
[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
1 parent 55013ba commit c1def63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def LLVM_LifetimeEndOp : LLVM_LifetimeBaseOp<"lifetime.end"> {
251251
// Intrinsics with multiple returns.
252252

253253
class LLVM_ArithWithOverflowOp<string mnem>
254-
: LLVM_IntrOp<mnem, [0], [], [SameOperandsElementType], 2>,
254+
: LLVM_IntrOp<mnem, [0], [], [Pure, SameOperandsElementType], 2>,
255255
Arguments<(ins LLVM_ScalarOrVectorOf<AnySignlessInteger>,
256256
LLVM_ScalarOrVectorOf<AnySignlessInteger>)>;
257257

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def LLVM_SelectOp
797797
$res = op;
798798
}];
799799
}
800-
def LLVM_FreezeOp : LLVM_Op<"freeze", [SameOperandsAndResultType]> {
800+
def LLVM_FreezeOp : LLVM_Op<"freeze", [Pure, SameOperandsAndResultType]> {
801801
let arguments = (ins LLVM_Type:$val);
802802
let results = (outs LLVM_Type:$res);
803803
let builders = [LLVM_OneResultOpBuilder];

0 commit comments

Comments
 (0)