One of the uses of LTOCodeGenerator is to take it as a middle+back end. Sometimes
it is very helpful to access, especially get information from the optimized module.
If the information can be changed in optimization, it cannot be get before the
module is added to LTOCodeGenerator. This patch adds a function
LTOCodeGenerator::getMergedModule to access the MergedModule.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The change is fine. Can you elaborate a bit more about your use case? Or at least add a test for it?
Comment Actions
Few things to improve before commit:
- Drop the words like "in my case", "I", etc. from the commit message. Eg, In my case, after optimize is called, I need to access the underlying module to get information. can be rewritten as API can be used to access the underlying module to get information after optimized is called. It would sound much better.
- Please add a use-case of the API in test suite otherwise it can be removed as dead code. You can look into getting it used in llvm-lto tool and add a testcase to exercise the code path.
Comment Actions
It seems like the root cause of link error reported in many BuildBolt is Module::dump is stripped in release mode. Probably should not use that function at the first place. Need to come up with another way to test.
Comment Actions
@steven_wu Do you have any suggestion on how to test it in llvm-lto? I can't find a feasible use of the function in llvm-lto.