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

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 07:57:50 PDT 2021


jhuber6 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)
----------------
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.


================
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)
----------------
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. 


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