[PATCH] D57567: [SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 3 21:04:13 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353017: [SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes (authored by mkazantsev, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D57567?vs=184989&id=184990#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D57567

Files:
  llvm/trunk/lib/Analysis/ScalarEvolution.cpp
  llvm/trunk/test/Analysis/ScalarEvolution/unreachable-code.ll


Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp
@@ -6144,7 +6144,7 @@
     // to obey basic rules for definitions dominating uses which this
     // analysis depends on.
     if (!DT.isReachableFromEntry(I->getParent()))
-      return getUnknown(V);
+      return getUnknown(UndefValue::get(V->getType()));
   } else if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
     return getConstant(CI);
   else if (isa<ConstantPointerNull>(V))
Index: llvm/trunk/test/Analysis/ScalarEvolution/unreachable-code.ll
===================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/unreachable-code.ll
+++ llvm/trunk/test/Analysis/ScalarEvolution/unreachable-code.ll
@@ -1,7 +1,7 @@
 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
 
 ; CHECK: %t = add i64 %t, 1
-; CHECK: -->  %t
+; CHECK: -->  undef
 
 define void @foo() {
 entry:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57567.184990.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190204/1ef881cc/attachment.bin>


More information about the llvm-commits mailing list