[PATCH] D86319: [Attributor] Introduce module slice.
Stefan Stipanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 01:19:12 PDT 2020
sstefan1 added a comment.
In D86319#2229661 <https://reviews.llvm.org/D86319#2229661>, @kuter wrote:
> This is interesting, I thought you couldn't change the IR outside of the current SCC.
We can't delete functions outside of the SCC, the rest should be fine.
> Was this intended to go on top of D86081 <https://reviews.llvm.org/D86081> ?
At first yes. However we need to have manifest in module slice since we need to manifest stuff (if any) and we don't allow deleting functions outside of the SCC. You will probably need to make that allow manifest only on the module slice (but probably unlikely it will ever happen outside of it).
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:765
+ /// a function in the SCC or a caller of a function in the SCC.
+ void initializeModuleSlice(SetVector<Function *> &SCC) {
+ ModuleSlice.insert(SCC.begin(), SCC.end());
----------------
kuter wrote:
> I don't think this is needed. If you just seed the SCC, the AAs won't query anything outside of this anyways.
While that is right, module slice won't be used by the attributor exclusively, that's why it is in the `InformationCache`. We'll use this in the OpenMPOpt as well.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:3039
if (F && !F->isDeclaration()) {
- ToBeExploredFrom.insert(&F->getEntryBlock().front());
- assumeLive(A, F->getEntryBlock());
+ if (A.isRunOn(*const_cast<Function *>(F))) {
+ ToBeExploredFrom.insert(&F->getEntryBlock().front());
----------------
kuter wrote:
> I think this to not spend too much time on functions that are outside of the current SCC right ?
> Can you add comments.
Yes, we don't want to compute it twice.
Will update, this was just a first draft.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86319/new/
https://reviews.llvm.org/D86319
More information about the llvm-commits
mailing list