This makes the logic for referenced globals reusable for import criteria
that don't use thresholds - in fact, we currently didn't consider any
thresholds when importing.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/IPO/FunctionImport.cpp | ||
---|---|---|
259 | Can we make this a member of GlobalsImporter to avoid having to pass in DefinedGVSummaries and isPrevailing? | |
283 | Can you add a brief description in comment for class? | |
305 | Some comments as to why we are doing this in the destructor would be helpful. But would it be clearer to just do this greedily from onImportingSummary? In fact, in that case we wouldn't even need a Worklist - onImportingSummary can just call itself recursively. | |
331 | Nit: I think per LLVM coding standards the outer for and if should also have braces since the innermost if statement is nontrivial and has braces. It would improve readability imo. | |
332 | Nit: prefer early continue if !GVS to avoid extra level of nesting. It might be nice to add a comment there about how we don't currently perform importing of any functions referenced by global variables (e.g. virtual functions in vtables). I suppose if we wanted to handle those in the future, we could arrange for this to return a set of those functions. |
llvm/lib/Transforms/IPO/FunctionImport.cpp | ||
---|---|---|
305 | Done, w/o recursion |
Can we make this a member of GlobalsImporter to avoid having to pass in DefinedGVSummaries and isPrevailing?