The previous ordering continued to use the original assuming after
replacing it which is not allowed. Now, inline the region from the old
into the new before the replacement.
Differential Revision: https://reviews.llvm.org/D90375
auto newAssumingOp =
rewriter.create<AssumingOp>(op.getLoc(), newResultTypes, op.witness());
-
- rewriter.replaceOp(op, newAssumingOp.getResults());
rewriter.inlineRegionBefore(op.doRegion(), newAssumingOp.doRegion(),
newAssumingOp.doRegion().end());
+ rewriter.replaceOp(op, newAssumingOp.getResults());
return success();
}