[PATCH] D81765: Don't hoist very large static allocas to the entry block during inlining

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 14:49:49 PDT 2020


aemerson created this revision.
aemerson added reviewers: eli.friedman, mtrofin, tejohnson, reames.
aemerson added a project: LLVM.
Herald added subscribers: haicheng, hiraditya, eraman.
aemerson added a reviewer: jfb.
Herald added a subscriber: dexonsmith.

Some sequences of optimizations can generate call sites which may never be executed during runtime, and through constant propagation result in dynamic allocas being converted to static allocas with very large allocation amounts.

The inliner tries to move these to the caller's entry block, resulting in the stack limits being reached/bypassed. These allocas should not be hoisted out of the conditional path.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81765

Files:
  llvm/include/llvm/Analysis/InlineCost.h
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/Inline/alloca-too-large-to-hoist.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81765.270511.patch
Type: text/x-patch
Size: 5128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200612/7057ccd9/attachment.bin>


More information about the llvm-commits mailing list