The earlier available datalyaout allows MLIR to LLVM-IR transformation
to use the datalayout for decisions, such as comparing sizes for
different types of integers.
This should solve https://github.com/llvm/llvm-project/issues/57230
Differential D133568
[Flang][Driver]Add datalayout before doing LLVM-IR transformation Leporacanthicus on Sep 9 2022, 3:56 AM. Authored by
Details The earlier available datalyaout allows MLIR to LLVM-IR transformation This should solve https://github.com/llvm/llvm-project/issues/57230
Diff Detail
Event TimelineComment Actions Thanks for implementing this @MatsPetersson ! Could add a test to demonstrate the behavior when the input MLIR module does and does not define the data layout?
Comment Actions Thanks for the clarifications, Mats! I see that with this change you are also making sure that the datalayout is set before the -emit-llvm actions ends. I think that technically that's not required for this change to work - or am I still missing something? In either case, it's not too much noise and we can keep here. But it would be good to point out in the commit message that with this change, flang-new -emit-llvm -S file.f90 will generate an LLVM IR file with correct datalayout present. I hope that I got it right :)
Comment Actions Updates based on review comments:
Comment Actions Updates per review comments and local testing. Mainly, set DataLayout for more conditions, rather than skipping the setting.
Comment Actions I accept this (module the typos), but please make sure @awarzynski is okay with the changes. Thank you!
|
Do you need this temporary?