[PATCH] D116056: [LTO][WPD] Ignore unreachable function by analyzing IR.
Mingming Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 20 16:57:28 PST 2021
luna marked an inline comment as done.
luna added a comment.
thanks for review!
I simplify the test case here, and could do the same for the previous two test cases either here or in a separate patch.
================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1056
+
if (ExportSummary && (mustBeUnreachableFunction(
lookUpFunctionValueInfo(Fn, ExportSummary)))) {
----------------
tejohnson wrote:
> Since you are adding the IR check above, thinking that to optimize for compile time this lookup should be ignored if we have the def of Fn available (avoids an extra hash table lookup and analysis).
Done by "first analyze function def in IR if that's present, and use export summary as a fallback".
I took the liberty to add a comment like [1]; I'm wondering what's the idiomatic way to provide pointer a line of code w/ commit for reference?
[1]
```
// FWIW, the writer of `ExportSummary` guarantees that function declarations
// won't have an entry in `ExportSummary`;
// see llvm/lib/Analysis/ModuleSummaryAnalysis.cpp#L785 at commit cf9e61a for
// a reference.
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116056/new/
https://reviews.llvm.org/D116056
More information about the llvm-commits
mailing list