[all-commits] [llvm/llvm-project] c1c1fe: [Attributor] Reorganize AAHeapToStack

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Sat Jul 10 14:33:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1c1fe93852e88b544c46087363400751b3a3ceb
      https://github.com/llvm/llvm-project/commit/c1c1fe93852e88b544c46087363400751b3a3ceb
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

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

  Log Message:
  -----------
  [Attributor] Reorganize AAHeapToStack

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.

Differential Revision: https://reviews.llvm.org/D104993




More information about the All-commits mailing list