[PATCH] D81765: Don't inline dynamic allocas that simplify to huge static allocas.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 23:57:17 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:838
   if (I.isArrayAllocation()) {
     Constant *Size = SimplifiedValues.lookup(I.getArraySize());
----------------
Hhow is the handling for array allocation supposed to work if the alloca isn't in the entry block of the function?  It looks like this code assumes that constant-propagation is enough to turn any dynamic alloca into a static alloca?

Not really a problem with this change, exactly, but I want to make sure I'm understanding the surrounding code correctly.


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:29
 #include "llvm/Analysis/EHPersonalities.h"
+#include "llvm/Analysis/InlineCost.h"
 #include "llvm/Analysis/InstructionSimplify.h"
----------------
Unnecessary change?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81765/new/

https://reviews.llvm.org/D81765





More information about the llvm-commits mailing list