[PATCH] D37460: [GVN] Prevent LoadPRE from hoisting across instructions that don't pass control flow to successors

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 10:47:56 PDT 2017


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Transforms/Scalar/GVN.cpp:2318
+  // some assertion failures.
+  OI->invalidateBlock(CurrentBlock);
   CurInst->eraseFromParent();
----------------
Caught one last bug.  The invalidation needs to be conditional since the rebuild is.  As currently structured, this will leave the entry empty allowing a miscompile.

Do we have a test case for the scalarPRE invalidation?  If so, why didn't it catch this?  If not, please add one.


https://reviews.llvm.org/D37460





More information about the llvm-commits mailing list