[PATCH] D128586: [SCEV] Use SCEVUnknown(poison) instead of SCEVUnknown(undef).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 25 09:18:27 PDT 2022


fhahn updated this revision to Diff 439993.
fhahn added a comment.

Undo changes to containsUndefs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128586

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


Index: llvm/test/Analysis/ScalarEvolution/unreachable-code.ll
===================================================================
--- llvm/test/Analysis/ScalarEvolution/unreachable-code.ll
+++ llvm/test/Analysis/ScalarEvolution/unreachable-code.ll
@@ -1,7 +1,7 @@
 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
 
 ; CHECK: %t = add i64 %t, 1
-; CHECK: -->  undef
+; CHECK: -->  poison
 
 define void @foo() {
 entry:
Index: llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
===================================================================
--- llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
+++ llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
@@ -389,9 +389,9 @@
 ; CHECK-LABEL: 'unreachable_phi'
 ; CHECK-NEXT:  Classifying expressions for: @unreachable_phi
 ; CHECK-NEXT:    %p_58.addr.1 = phi i32 [ undef, %unreachable1 ], [ %sub2629, %unreachable2 ]
-; CHECK-NEXT:    --> undef U: full-set S: full-set
+; CHECK-NEXT:    --> poison U: full-set S: full-set
 ; CHECK-NEXT:    %sub2629 = sub i32 %p_58.addr.1, 1
-; CHECK-NEXT:    --> undef U: full-set S: full-set
+; CHECK-NEXT:    --> poison U: full-set S: full-set
 ; CHECK-NEXT:  Determining loop execution counts for: @unreachable_phi
 ;
 entry:
@@ -415,7 +415,7 @@
 ; CHECK-NEXT:    %p_58.addr.1 = phi i32 [ undef, %header ], [ %sub2629, %unreachable ]
 ; CHECK-NEXT:    --> %p_58.addr.1 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %header: Variant }
 ; CHECK-NEXT:    %sub2629 = sub i32 %p_58.addr.1, 1
-; CHECK-NEXT:    --> undef U: full-set S: full-set
+; CHECK-NEXT:    --> poison U: full-set S: full-set
 ; CHECK-NEXT:  Determining loop execution counts for: @unreachable_binop
 ; CHECK-NEXT:  Loop %header: Unpredictable backedge-taken count.
 ; CHECK-NEXT:  Loop %header: Unpredictable max backedge-taken count.
Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -7196,7 +7196,7 @@
     // to obey basic rules for definitions dominating uses which this
     // analysis depends on.
     if (!DT.isReachableFromEntry(I->getParent()))
-      return getUnknown(UndefValue::get(V->getType()));
+      return getUnknown(PoisonValue::get(V->getType()));
   } else if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
     return getConstant(CI);
   else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128586.439993.patch
Type: text/x-patch
Size: 2486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220625/96a662ce/attachment.bin>


More information about the llvm-commits mailing list