[llvm] Reapply "[ControlHeightReduction] Drop lifetime annotations where necessary" (PR #160640)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 06:22:41 PDT 2025


================
@@ -1719,6 +1734,20 @@ void CHR::transformScopes(CHRScope *Scope, DenseSet<PHINode *> &TrivialPHIs) {
   FirstRegion->replaceEntryRecursive(NewEntryBlock);
   BasicBlock *PreEntryBlock = EntryBlock;
 
+  // Move static allocas into the pre-entry block so they stay static.
+  for (AllocaInst *AI : StaticAllocas)
+    AI->moveBefore(EntryBlock->begin()->getIterator());
----------------
nikic wrote:

```suggestion
    AI->moveBefore(EntryBlock->begin());
```
begin() is already an iterator, shouldn't need getIterator().

https://github.com/llvm/llvm-project/pull/160640


More information about the llvm-commits mailing list