Hi,
I have the following pieces of code:
auto val = rewriter.create<ConstantIntOp>(op->getLoc(), 1, 32);
auto fooOp = rewriter.create<Foo_CreateOp>(
op->getLoc(), op->getContext(), val);
rewriter.replaceOp(op, {fooOp.getODSResults(0)});
The above code gives me an error as such:
error: unexpected error: failed to legalize operation 'Baz' that was explicitly marked illegal
and
auto fooOp = rewriter.create<Foo_CreateOp>(
op->getLoc(), op->getContext(), "foo");
rewriter.replaceOp(op, {fooOp.getODSResults(0)});
This one doesn’t give an error.
I think the constantOp is playing a role here. any ideas?