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

Andreas Simbuerger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 09:19:12 PDT 2017


simbuerg added inline comments.


================
Comment at: lib/CodeGen/IslNodeBuilder.cpp:1424
+      // Get the 'int' pointer
+      auto IntPtrTy = Type::getInt64Ty(Ctx);
+
----------------
philip.pfaffe wrote:
> simbuerg wrote:
> > Question for my own understanding: We can pin this to 64bits only if we know which malloc implementation we have available on the target machine, right?
> Why not get the real IntPtrTy from the current DataLayout?
Well it's not the problem that we don't know the size of the IntPtr. We don't know the argument type that the system's malloc function expects (whatever size_t might be on the target).

Normally you would expect 'unsigned int', then we could just get the size from the DataLayout.
By default CreateMalloc would generate a call to 'void malloc(IntPtrTy)'.


https://reviews.llvm.org/D33688





More information about the llvm-commits mailing list