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 ↗ | (On Diff #434646) | Single quotes around newline |
434 ↗ | (On Diff #434646) | 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 ↗ | (On Diff #434646) | Why does an IR reduction need to initialize target info? |
455 ↗ | (On Diff #434646) | Why this change? |
tools/llvm-reduce/llvm-reduce.cpp | ||
121 ↗ | (On Diff #434646) | 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 ↗ | (On Diff #434646) | Other places propagate the tool name from argv |
144 ↗ | (On Diff #434646) | Ditto |
tools/llvm-reduce/ReducerWorkItem.cpp | ||
---|---|---|
425 ↗ | (On Diff #434646) | Fixed. |
434 ↗ | (On Diff #434646) | 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 ↗ | (On Diff #434646) | The ThinLTOBitcodeWriter pass depends on target info. It crashes without it. |
455 ↗ | (On Diff #434646) | That change is no longer needed. I'll remove it. |
tools/llvm-reduce/llvm-reduce.cpp | ||
121 ↗ | (On Diff #434646) | Unfortunately, there isn't. If you look at opt, you'll see the same strategy. |
137 ↗ | (On Diff #434646) | Fixed. I've added the tool name to the TestRunner class, so that it's accessible. |
144 ↗ | (On Diff #434646) | 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 | Don't need llvm:: and these look like they need line wrapping |
Don't need llvm:: and these look like they need line wrapping