Skip to content

Commit e03f16f

Browse files
authored
[mlir] [arith] Remove buggy illegal operation in --arith-unsigned-when-equivalent (llvm#87298)
`CeilDivUIOp` seemed to have been added by mistake to the list of dynamically illegal operations in `arith-unsigned-when-equivalent`. The only illegal operations should be the signed operations that can be converted to their unsigned counterpart.
1 parent 737fc35 commit e03f16f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mlir/lib/Dialect/Arith/Transforms/UnsignedWhenEquivalent.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,11 @@ struct ArithUnsignedWhenEquivalentPass
125125

126126
ConversionTarget target(*ctx);
127127
target.addLegalDialect<ArithDialect>();
128-
target
129-
.addDynamicallyLegalOp<DivSIOp, CeilDivSIOp, CeilDivUIOp, FloorDivSIOp,
130-
RemSIOp, MinSIOp, MaxSIOp, ExtSIOp>(
131-
[&solver](Operation *op) -> std::optional<bool> {
132-
return failed(staticallyNonNegative(solver, op));
133-
});
128+
target.addDynamicallyLegalOp<DivSIOp, CeilDivSIOp, FloorDivSIOp, RemSIOp,
129+
MinSIOp, MaxSIOp, ExtSIOp>(
130+
[&solver](Operation *op) -> std::optional<bool> {
131+
return failed(staticallyNonNegative(solver, op));
132+
});
134133
target.addDynamicallyLegalOp<CmpIOp>(
135134
[&solver](CmpIOp op) -> std::optional<bool> {
136135
return failed(isCmpIConvertable(solver, op));

0 commit comments

Comments
 (0)