-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use convert-to-llvm pass for conversions to LLVMIR Dialect #1679
base: target_attr
Are you sure you want to change the base?
Conversation
…om attached target during lowering
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.
Overall, approved
However, I'm not checking the box because I think this set of changes should be sent upstream first and then backported to us
external/llvm-project/mlir/lib/Conversion/ConvertToLLVM/ConvertToLLVMPass.cpp
Outdated
Show resolved
Hide resolved
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.
Re the utility function I was considering, now that I've looked at the structure of the code, I'm seeing another approach, one which'll make ConvertToLLVM
less special.
Specifically, take that addTypeAttributeConversion()
call and move it into the constructor for LLVMTypeConverter
... and have it take the Attribute -> uint32_t
map as an element of LowerToLLVMOptions
.
(While doing that, I'd go ahead and extend the DataLayout
class with a getEntries()
sort of iterator so you can loop through all the entries in that cache)
That way, anyone constructing their LowerToLLVMOptions()
with a DataLayoutAnalysis
automatically gets this functionality.
auto typeConverter = std::make_shared<LLVMTypeConverter>(context, options); | ||
|
||
DenseMap<Attribute, uint64_t> addressSpaceMap; | ||
if (DataLayoutOpInterface iface = dyn_cast<DataLayoutOpInterface>(op)) { |
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 think this is another usage of getAtOrAbove()
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.
... no, it isn't, but it could be, if DataLayout
(the class) grew a method.
efd63a4
to
c966d3b
Compare
This is more of a refactor and WIP. Would require some discussions with upstream.
Depends on #1666
cc: @fabianmcg