-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dialect Conversion #20
Conversation
db32c5a
to
e6893cf
Compare
216b314
to
6c40e28
Compare
This reverts commit 1f5dfdd.
6c40e28
to
c3a8384
Compare
@@ -32,6 +32,20 @@ class PolyToStandardTypeConverter : public TypeConverter { | |||
} | |||
}; | |||
|
|||
struct ConvertAdd : public OpConversionPattern<AddOp> { | |||
ConvertAdd(mlir::MLIRContext *context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of before but in MLIR 17+, I've had to instead implement this constructor,
ConvertAdd(TypeConverter& type_converter, MLIRContext* context)
: OpConversionPattern<AddOp>(type_converter, context) {}
otherwise the call to patterns.add<ConvertAdd>(typeConverter, context);
fails at compile time saying no matching constructor for initialization
since the constructor we implemented here requires one argument but we provide two.
Also, it maybe just a minor preference thing but struct A : public B
is equivalent to struct A : B
since structs have public inheritance by default.
* Add optional packer plugins hook * Provide help in README and simplify module * Fix spelling and tweak verbiage about after/plugin
// TODO: implement | ||
arith::AddIOp addOp = rewriter.create<arith::AddIOp>( | ||
op.getLoc(), adaptor.getLhs(), adaptor.getRhs()); | ||
rewriter.replaceOp(op.getOperation(), {addOp}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{addOp}
will trigger ambiguous error in LLVM 20, so this can be implemented in this way:
rewriter.replaceOp(op.getOperation(), addOp.getOperation());
No description provided.