summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
diff options
context:
space:
mode:
authorJakub Kuderski <kubak@google.com>2022-12-07 17:15:55 -0500
committerJakub Kuderski <kubak@google.com>2022-12-07 17:15:56 -0500
commit28246b7e759708e8e667cadef11b6a516c258dc6 (patch)
tree5a696e82c7d1d858f15980681cd3226167889ae1 /mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
parentd77ae7f2513504655e555cd326208598093d66e2 (diff)
downloadllvm-28246b7e759708e8e667cadef11b6a516c258dc6.tar.gz
[mlir][arith] Rename addui_carry to addui_extended
The goal is to make the naming of the future `_extended` ops more consistent. With unsigned addition, the carry value/flag and overflow bit are the same, but this is not true when it comes to signed addition. Also rename the second result from `carry` to `overflow`. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D139569
Diffstat (limited to 'mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp')
-rw-r--r--mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
index 28134cf11932..f10fefba87ee 100644
--- a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
@@ -276,11 +276,12 @@ struct ConvertAddI final : OpConversionPattern<arith::AddIOp> {
auto [rhsElem0, rhsElem1] =
extractLastDimHalves(rewriter, loc, adaptor.getRhs());
- auto lowSum = rewriter.create<arith::AddUICarryOp>(loc, lhsElem0, rhsElem0);
- Value carryVal =
- rewriter.create<arith::ExtUIOp>(loc, newElemTy, lowSum.getCarry());
+ auto lowSum =
+ rewriter.create<arith::AddUIExtendedOp>(loc, lhsElem0, rhsElem0);
+ Value overflowVal =
+ rewriter.create<arith::ExtUIOp>(loc, newElemTy, lowSum.getOverflow());
- Value high0 = rewriter.create<arith::AddIOp>(loc, carryVal, lhsElem1);
+ Value high0 = rewriter.create<arith::AddIOp>(loc, overflowVal, lhsElem1);
Value high = rewriter.create<arith::AddIOp>(loc, high0, rhsElem1);
Value resultVec =