[PATCH] D157263: [NewGVN] Unreachable if block in performSymbolicLoadEvaluation (NFC)

Manuel Brito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 02:29:51 PDT 2023


ManuelJBrito created this revision.
ManuelJBrito added reviewers: asbirlea, kmitropoulou.
Herald added a subscriber: hiraditya.
Herald added a project: All.
ManuelJBrito requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When performing symbolic load evaluation we currently check if the defining instruction is unreachable. AFAICT this is not possible because the defining access is a clobber of the load, therefore the defining instruction dominates the load. In NewGVN if we are processing an instruction its because we have deemed it reachable so it's not possible to have an unreachable dominator.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157263

Files:
  llvm/lib/Transforms/Scalar/NewGVN.cpp


Index: llvm/lib/Transforms/Scalar/NewGVN.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -1534,9 +1534,7 @@
   if (!MSSA->isLiveOnEntryDef(DefiningAccess)) {
     if (auto *MD = dyn_cast<MemoryDef>(DefiningAccess)) {
       Instruction *DefiningInst = MD->getMemoryInst();
-      // If the defining instruction is not reachable, replace with poison.
-      if (!ReachableBlocks.count(DefiningInst->getParent()))
-        return createConstantExpression(PoisonValue::get(LI->getType()));
+      
       // This will handle stores and memory insts.  We only do if it the
       // defining access has a different type, or it is a pointer produced by
       // certain memory operations that cause the memory to have a fixed value


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157263.547680.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230807/0389eb05/attachment.bin>


More information about the llvm-commits mailing list