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 | ||
---|---|---|
258–259 | Can we make this a member of GlobalsImporter to avoid having to pass in DefinedGVSummaries and isPrevailing? | |
291–299 | Can you add a brief description in comment for class? | |
313 | 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. | |
358 | 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. | |
359 | 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 | ||
---|---|---|
313 | Done, w/o recursion |
Can we make this a member of GlobalsImporter to avoid having to pass in DefinedGVSummaries and isPrevailing?