[PATCH] D76974: Make attributor aware of aligned_alloc for heap to stack conversion

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 28 00:30:34 PDT 2020


bondhugula created this revision.
bondhugula added reviewers: jdoerfert, xbolva00.
Herald added subscribers: llvm-commits, uenoku, hiraditya.
Herald added a reviewer: sstefan1.
Herald added a reviewer: uenoku.
Herald added a project: LLVM.
jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:5053
+          new AllocaInst(Type::getInt8Ty(F->getContext()), AS, Size, alignment,
+                         "", MallocCall->getNextNode());
 
----------------
Nit: `Alignment`


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:5205
+            return true;
+          }
     } else if (IsCalloc) {
----------------
Why a signed comparison?


Make the attributor pass aware of aligned_alloc for converting heap
allocations to stack ones.

Signed-off-by: Uday Bondhugula <uday at polymagelabs.com>

Depends on D76971 <https://reviews.llvm.org/D76971>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76974

Files:
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/Attributor/heap_to_stack.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76974.253303.patch
Type: text/x-patch
Size: 4258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200328/e9daebe6/attachment.bin>


More information about the llvm-commits mailing list