Skip to content

Commit

Permalink
Use converted type to generate constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmendesp-amd committed Dec 9, 2024
1 parent c9b35c8 commit 918d719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static Value createLinalgBodyCalculationForElementwiseOp(

if (isa<tosa::AbsOp>(op) && isa<IntegerType>(elementTy)) {
auto zero = rewriter.create<arith::ConstantOp>(
loc, rewriter.getZeroAttr(elementTy));
loc, rewriter.getZeroAttr(convertedElementTy));
auto neg = rewriter.create<arith::SubIOp>(loc, zero, args[0]);
return rewriter.create<arith::MaxSIOp>(loc, args[0], neg);
}
Expand Down

0 comments on commit 918d719

Please # to comment.