Adds support for reading and writing LTO bitcode files. While this feature can be replicated by stripping and regenerating summaries via opt, this patch makes reducing LTO bitcode a transparent process with no extra boiler-plate. This is especially useful when split LTO units are needed, as the process to generate them can be less than obvious.
Details
Diff Detail
Event Timeline
tools/llvm-reduce/ReducerWorkItem.cpp | ||
---|---|---|
425 | Single quotes around newline | |
434 | Why is this returning a default constructed ReducerWorkItem instead of null? I see some other places are doing this but I don't see how this makes sense | |
441 | Why does an IR reduction need to initialize target info? | |
455 | Why this change? | |
tools/llvm-reduce/llvm-reduce.cpp | ||
121 | Do you really need a pass manager (a legacy one at that) just to write out the file? Why isn't there a simple function to use? | |
137 | Other places propagate the tool name from argv | |
144 | Ditto |
tools/llvm-reduce/ReducerWorkItem.cpp | ||
---|---|---|
425 | Fixed. | |
434 | I opted for this to stay consistent with the surrounding code. Nonetheless, nullptr is more efficient at the same task, so I'll go ahead and use that instead. | |
441 | The ThinLTOBitcodeWriter pass depends on target info. It crashes without it. | |
455 | That change is no longer needed. I'll remove it. | |
tools/llvm-reduce/llvm-reduce.cpp | ||
121 | Unfortunately, there isn't. If you look at opt, you'll see the same strategy. | |
137 | Fixed. I've added the tool name to the TestRunner class, so that it's accessible. | |
144 | See above. |
While I don't understand the LTO bitcode files, the reduce changes seem fine
llvm/tools/llvm-reduce/deltas/Delta.cpp | ||
---|---|---|
64–66 ↗ | (On Diff #437250) | Don't need llvm:: and these look like they need line wrapping |
Single quotes around newline