[llvm-commits] [PATCH] Add malloc call utility functions

Duncan Sands baldrick at free.fr
Sat Sep 5 05:36:32 PDT 2009


Hi Victor, when bitcode containing a MallocInst is read, it looks
like you plan to turn this into a malloc call ignoring the alignment
value of the MallocInst.  However if the alignment was huge, the pointer
returned by the malloc call might not be sufficiently aligned.  In this
case you would need to allocate a larger amount of memory and adjust the
returned pointer to be sufficiently aligned.  The extra complexity may
not be worth it: I don't know if anyone ever used huge alignments with
MallocInst, or even if codegen respected these alignments.  If you
decide to ignore the alignment I suggest you add a comment about this.

Ciao,

Duncan.



More information about the llvm-commits mailing list