-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve lowering logic and lower few more ops #22
Conversation
ec1751e
to
693975e
Compare
693975e
to
d28b081
Compare
llvm::SmallVector<mlir::Value> output_vector; | ||
output_vector.push_back(emit_mlir_empty_tensor(graph, op_node)); | ||
mlir::ValueRange outputs = mlir::ValueRange(output_vector); | ||
auto op = builder_.create<TTIROp>( |
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.
This is the only part of this function which depends on the template argument. Why not extract this into a function template instead?
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.
Take a look at few lines above:
::llvm::ArrayRef<::llvm::StringRef> operation_attributes = TTIROp::getAttributeNames();
We are getting specific operation attributes to decide which attributes to build...
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 see... sorry, missed that one...
d28b081
to
3a631f4
Compare
With these code changes, I managed to simplify the lowering logic. The lowering function is now a template that can be registered for all new ops. Additionally, lowering the following ops:
Solves: