[PATCH] D104993: [Attributor] Reorganize AAHeapToStack

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 27 09:40:58 PDT 2021


jdoerfert created this revision.
jdoerfert added reviewers: jhuber6, kuter.
Herald added subscribers: ormris, okura, uenoku, bollu, hiraditya.
Herald added a reviewer: uenoku.
Herald added a reviewer: homerdin.
jdoerfert requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: bbn, sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

In order to simplify future extensions, e.g., the merge of
AAHeapToShared in to AAHeapToStack, we reorganize AAHeapToStack and the
state we keep for each malloc-like call. The result is also less
confusing as we only track malloc-like calls, not all calls. Further, we
only perform the updates necessary for a malloc-like to argue it can go
to the stack, e.g., we won't check all uses if we moved on to the
"must-be-freed" argument.

This patch also uses Attributor helps to simplify the allocated size,
alignment, and the potentially freed objects.

Overall, this is mostly a reorganization and only the use of the
optimistic helpers should change (=improve) the capabilities a bit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104993

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/Attributor/depgraph.ll
  llvm/test/Transforms/Attributor/heap_to_stack.ll
  llvm/test/Transforms/OpenMP/remove_globalization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104993.354754.patch
Type: text/x-patch
Size: 35817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210627/88ff8e11/attachment.bin>


More information about the llvm-commits mailing list