[PATCH] D105634: [OpenMP] Use AAHeapToStack/AAHeapToShared analysis in SPMDization

Giorgis Georgakoudis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 08:56:02 PDT 2021


ggeorgakoudis marked 3 inline comments as done.
ggeorgakoudis added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2589
+      }
+      // TODO: Do we need to assume there is one, unique free user?
+      if (FreeCalls.size() != 1)
----------------
jdoerfert wrote:
> jhuber6 wrote:
> > There should only ever be one free call per variable, it's like a stack. This is here just to make sure we don't accidentally remove something that's behind a PHI or something.
> Initially we have one free per alloc and the free uses the alloc, transformations can change that, e.g. introduce phi nodes or sink free into conditionals. We need to be conservative if the structure is not as we expect it.
Got it


================
Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2641-2648
       SmallVector<CallBase *, 4> FreeCalls;
       for (auto *U : CB->users()) {
         CallBase *C = dyn_cast<CallBase>(U);
         if (C && C->getCalledFunction() == FreeCall.Declaration)
           FreeCalls.push_back(C);
       }
       if (FreeCalls.size() != 1)
----------------
jhuber6 wrote:
> We could remove this if we track the free calls separately, but we'd need to have some mapping from the allocation to its corresponding free. 
Agreed


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105634/new/

https://reviews.llvm.org/D105634



More information about the llvm-commits mailing list