Skip to content

Commit 5f4d96e

Browse files
Don't to real work inside an assertion.
asserts get compiled to empty when built in opt mode, so that makes certain tests fail, such as emulate-unsupported-floats.mlir.test. This removes the assert altogether, which is also suboptimal, but I have reported to the original author.
1 parent 6640df9 commit 5f4d96e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ LogicalResult EmulateFloatPattern::match(Operation *op) const {
7979
void EmulateFloatPattern::rewrite(Operation *op, ArrayRef<Value> operands,
8080
ConversionPatternRewriter &rewriter) const {
8181
Location loc = op->getLoc();
82+
TypeConverter *converter = getTypeConverter();
8283
SmallVector<Type> resultTypes;
83-
assert(
84-
succeeded(getTypeConverter()->convertTypes(op->getResultTypes(), resultTypes)) &&
85-
"type conversions shouldn't fail in this pass");
84+
LogicalResult pass = converter->convertTypes(op->getResultTypes(), resultTypes);
85+
(void) pass;
8686
Operation *expandedOp =
8787
rewriter.create(loc, op->getName().getIdentifier(), operands, resultTypes,
8888
op->getAttrs(), op->getSuccessors(), /*regions=*/{});

0 commit comments

Comments
 (0)