[PATCH] D33663: CGCleanup: Use correct insertion point for AllocaInst

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 10:55:30 PDT 2017


rnk added inline comments.


================
Comment at: lib/CodeGen/CGCleanup.cpp:458
       InsertBefore = Invoke->getNormalDest()->getFirstInsertionPt();
+    else if (isa<llvm::AllocaInst>(Inst))
+      InsertBefore = std::next(AllocaInsertPt->getIterator());
----------------
This doesn't seem right, `Inst` could be a dynamic alloca. If it's static, we definitely don't need to store and reload it. All static allocas better be in the entry block... You might want to use `isStaticAlloca`, but that still feels like we're hacking around some deeper problem.


https://reviews.llvm.org/D33663





More information about the cfe-commits mailing list