[PATCH] D53362: [Prototype] Heap-To-Stack Conversion Pass

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 16:53:01 PDT 2018


hfinkel updated this revision to Diff 170040.
hfinkel added a comment.

Add some optimization remarks. Now we'll get things like his:

  In file included from /src/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp:31:
  In file included from /src/llvm/lib/Target/AArch64/AArch64.h:19:
  In file included from /src/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h:23:
  In file included from /src/llvm/include/llvm/ADT/STLExtras.h:21:
  In file included from /src/llvm/include/llvm/ADT/SmallVector.h:21:
  /src/llvm/include/llvm/Support/MemAlloc.h:27:18: remark: removed memory allocation (placed on stack) [-Rpass=heap-to-stack]
    void *Result = std::malloc(Sz);
                   ^
  In file included from /src/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp:32:
  In file included from /src/llvm/lib/Target/AArch64/AArch64InstrInfo.h:20:
  In file included from /src/llvm/include/llvm/CodeGen/TargetInstrInfo.h:21:
  In file included from /src/llvm/include/llvm/CodeGen/LiveRegUnits.h:18:
  /src/llvm/include/llvm/ADT/BitVector.h:164:18: remark: removed memory deallocation (placed on stack) [-Rpass=heap-to-stack]
    ~BitVector() { std::free(Bits.data()); }
                   ^

During a check-clang self host, we currently remove 79 allocations (using the "very aggressive mode, at least").


https://reviews.llvm.org/D53362

Files:
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Scalar/HeapToStack.h
  lib/Passes/PassBuilder.cpp
  lib/Passes/PassRegistry.def
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/HeapToStack.cpp
  lib/Transforms/Scalar/Scalar.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53362.170040.patch
Type: text/x-patch
Size: 21279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181017/29a2f8b2/attachment-0001.bin>


More information about the llvm-commits mailing list