[PATCH] D33688: [Polly] Heap allocation for new arrays
Andreas Simbuerger via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 04:41:49 PDT 2017
simbuerg added inline comments.
================
Comment at: lib/Exchange/JSONExporter.cpp:722
+ auto CurrentSAI =
+ S.getArrayInfoByName(Arrays[ArrayIdx]["name"].asCString());
+ CurrentSAI->setIsOnHeap(true);
----------------
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.
https://reviews.llvm.org/D33688
More information about the llvm-commits
mailing list