[Mlir-commits] [mlir] [mlir][tosa]: Add Binary Shape Ops folders (PR #178877)
Luke Hutton
llvmlistbot at llvm.org
Fri Jan 30 06:38:45 PST 2026
================
@@ -1149,8 +1247,11 @@ OpFoldResult IntDivOp::fold(FoldAdaptor adaptor) {
APInt l = lhsAttr.getSplatValue<APInt>();
APInt r = rhsAttr.getSplatValue<APInt>();
if (!r.isZero()) {
- APInt result = l.sdiv(r);
- return DenseElementsAttr::get(resultTy, result);
+ auto const result =
+ DivFoldAdaptor</*Ceil*/ false>::fold(l, r, /*isUnsigned*/ false);
----------------
lhutton1 wrote:
Do we know that the APInt is unsigned at this stage? I think we'd need to pass `resultETy.isUnsigned()` to `isUnsigned`
https://github.com/llvm/llvm-project/pull/178877
More information about the Mlir-commits
mailing list