Skip to content

Commit 4271cb5

Browse files
committed
set exact flags on ConvertOpToUnsigned
1 parent 0a4597c commit 4271cb5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

compiler/src/iree/compiler/Dialect/Util/Transforms/OptimizeIntArithmetic.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ struct ConvertOpToUnsigned : public OpRewritePattern<Signed> {
102102
if (failed(staticallyLegalToConvertToUnsignedOp(solver, op))) {
103103
return failure();
104104
}
105-
rewriter.replaceOpWithNewOp<Unsigned>(op, op->getResultTypes(),
105+
auto newOp = rewriter.replaceOpWithNewOp<Unsigned>(op, op->getResultTypes(),
106106
op->getOperands(), op->getAttrs());
107+
if constexpr (std::is_same_v<Unsigned, arith::IndexCastUIOp>) {
108+
newOp.setExact(true);
109+
}
107110
return success();
108111
}
109112

0 commit comments

Comments
 (0)