- Test the case where a symbol is sometimes linkonce_odr and sometimes weak_odr
- Test the visibility of the symbols at the IR level, after the internalize stage of LTO is done. (Previously we only checked the visibility of symbols in the final output binary.)
Details
- Reviewers
modimo - Group Reviewers
Restricted Project - Commits
- rGf5ddcf25d67f: [lld-macho] Extend lto-internalize-unnamed-addr.ll
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
28 | thinlto+dylib shares the same output as thinlto by itself. Can check for that as well in the bitcode output | |
49 | I find it odd that local_unnamed is able to be internalized in fullLTO but not thinLTO. The code path is https://github.com/llvm/llvm-project/blob/9f616a467fc710f084b7e57812a2ed64c214c2c6/llvm/lib/LTO/LTO.cpp#L349 where any linkonce_odr gets upgraded to weak but if this is the only copy that exists it appears to fit within the rules coming from D20348. cc @tejohnson is there an opportunity here? | |
70 | Add final output binary check for LTO-DAG and THINLTO-DAG as well? |
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
49 | That's true, if there is only one copy no need to make the prevailing one weak_odr. Is changing that sufficient to get the internalization in the ThinLTO case? |
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
49 | I tried https://gist.github.com/int3/b66de20462da71e8757e09bacfc361ca but that just seems to result in global_unnamed and local_unnamed_const no longer being marked as hidden... |
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
49 | To get hidden back this would need to be adjusted accordingly to handle linkonce_odr: |
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
49 | ah gotcha. yeah I got the hiddens back after changing that, as well as removing this earlier condition: http://llvm-cs.pcc.me.uk/lib/Transforms/IPO/FunctionImport.cpp#952 A bunch of check-llvm tests are now failing though. I would like to go through them at some point and figure out if they're legit, but I'd like to focus on other aspects of LLD for now. @modimo do you mind stamping this first? |
lld/test/MachO/lto-internalize-unnamed-addr.ll | ||
---|---|---|
49 | Sure. |
thinlto+dylib shares the same output as thinlto by itself. Can check for that as well in the bitcode output