[PATCH] D110257: [CFE][Codegen] Do not break the contiguity of static allocas.

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 23 15:13:40 PDT 2021


jdoerfert added inline comments.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:103
+    if (!ArraySize) {
+      auto *EBB = AllocaInsertPt->getParent();
+      auto Iter = AllocaInsertPt->getIterator();
----------------
arsenm wrote:
> Why is there a special AllocaInsertPt iterator in the first place? Can you avoid any iteration logic by just always inserting at the block start?
Right. The alloca insertion point is sometimes changed to a non-entry block, and we should keep that ability.
>From all the use cases I know it would suffice to insert at the beginning of the alloca insertion point block though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110257



More information about the cfe-commits mailing list