[PATCH] D33688: [Polly] Heap allocation for new arrays

Bonfante Nicolas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 04:51:30 PDT 2017


niosega added inline comments.


================
Comment at: lib/Exchange/JSONExporter.cpp:722
+        auto CurrentSAI =
+            S.getArrayInfoByName(Arrays[ArrayIdx]["name"].asCString());
+        CurrentSAI->setIsOnHeap(true);
----------------
simbuerg wrote:
> niosega wrote:
> > I need to have a pointer to the newly created ScopArrayInfo to call the setter.
> > But the method createScopArrayInfo returns only a const SAI *. The solution 
> > I found is to query the Scop to obtain the SAI by name.
> > 
> > An alternative would be to pass a parameter to createScopArrayInfo then to 
> > getOrCreateScopArrayInfo that represents the value that isOnHeap must take.
> This is just to circumvent an inconvenient API that you want to add with this patch. I would suggest a simpler way:
> Instead of depending on the setter, just add the IsOnHeap property as a function argument to
> createScopArrayInfo and pass it through to getOrCreateScopArrayInfo. There you can pass it to the constructor or use
> your setter.
To pass the parameter through createScopArrayInfo then getOrCreateScopArrayInfo  then to the constructor is what I did in the previous version of the patch. Michael and you agreed that it was not the prettiest solution. Should I change it back ?


https://reviews.llvm.org/D33688





More information about the llvm-commits mailing list