Since the new LTO API does not expose the individual steps in a
convenient manner, it implies changing a bit how llvm-lto works
and there was some churns with the tests.
Details
- Reviewers
tejohnson
Diff Detail
Event Timeline
Sorry for the delay.
I didn't go through the test changes in any detail - what is the main reason the new API caused changes to the way llvm-lto worked and the resulting test behavior?
include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | ||
---|---|---|
208 | Document callback here and in the other changed interfaces, and remove description of Index being updated since it is no longer passed. | |
lib/LTO/ThinLTOCodeGenerator.cpp | ||
214 | Comment needs update here and for other changed interfaces. | |
357 | This variable never used. | |
363 | I'm a little confused about what this interface is used for - why are we asserting if there is any stream requested? | |
418 | s/only gets global symbol/only get global symbols/ | |
425 | early continue instead? | |
434 | Maybe combine with earlier duplicated flag checks into a variable like IsWeak | |
442 | I believe this loop nest can be merged with the above (since the first copy always selected as prevailing) |
I didn't go through the test changes in any detail - what is the main reason the new API caused changes to the way llvm-lto worked and the resulting test behavior?
Mainly: the new LTO API does not allow to test the individual phases of the ThinLTO process without using "-save-temps". So you can't also run a later phase without running the earlier ones, which some tests were doing.
lib/LTO/ThinLTOCodeGenerator.cpp | ||
---|---|---|
363 | I'll make it more clear. The ThinLTO code generator is not supposed to have any non-ThinLTO file at this point. |
I suppose a higher level question is whether you want to reimplement the entire ThinLTOCodeGenerator or just the libLTO interface?
lib/LTO/ThinLTOCodeGenerator.cpp | ||
---|---|---|
361 | *Output | |
363 | I think this is because this output callback is being used in cases where a hook is aborting the pipeline early by returning false (see e.g. ThinLTOCodeGenerator::promote) so we would never expect to reach here. It would probably be clearer if this was spelt out explicitly. |
Interestingly, I see it the opposite way: I'm trying for now to reimplement only the ThinLTOCodegenerator and not the full libLTO interface :)
Document callback here and in the other changed interfaces, and remove description of Index being updated since it is no longer passed.