[llvm] 706e811 - Revert "[ValutTracking] Use isGuaranteedNotToBePoison in impliesPoison"

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 00:18:00 PDT 2023


Author: Hans Wennborg
Date: 2023-05-09T09:15:18+02:00
New Revision: 706e8110573c83f140a63b40803d6370c86c1414

URL: https://github.com/llvm/llvm-project/commit/706e8110573c83f140a63b40803d6370c86c1414
DIFF: https://github.com/llvm/llvm-project/commit/706e8110573c83f140a63b40803d6370c86c1414.diff

LOG: Revert "[ValutTracking] Use isGuaranteedNotToBePoison in impliesPoison"

This broke two lit tests:

  LLVM :: Transforms/LoopSimplify/merge-exits.ll
  LLVM :: Transforms/PhaseOrdering/X86/vector-reductions.ll

see comment on the code review.

> Differential Revision: https://reviews.llvm.org/D149934

This reverts commit 2ba4cfd56769ab50c9c6f432f93265d7793bd1f2.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp
    llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index a27063c3f9aae..6f6a16c8ee4c0 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -6689,7 +6689,7 @@ static bool directlyImpliesPoison(const Value *ValAssumedPoison,
 
 static bool impliesPoison(const Value *ValAssumedPoison, const Value *V,
                           unsigned Depth) {
-  if (isGuaranteedNotToBePoison(ValAssumedPoison))
+  if (isGuaranteedNotToBeUndefOrPoison(ValAssumedPoison))
     return true;
 
   if (directlyImpliesPoison(ValAssumedPoison, V, /* Depth */ 0))

diff  --git a/llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll b/llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
index 457889d7bd352..9a2d5e6aa2ea3 100644
--- a/llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
+++ b/llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
@@ -60,12 +60,12 @@ define i32 @func_logical(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp
 ; CHECK:       if.then:
 ; CHECK-NEXT:    [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
 ; CHECK-NEXT:    [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
-; CHECK-NEXT:    [[DOTCMP2:%.*]] = and i1 [[CMP2]], [[NOT_CMP1]]
+; CHECK-NEXT:    [[DOTCMP2:%.*]] = select i1 [[CMP2]], i1 [[NOT_CMP1]], i1 false
 ; CHECK-NEXT:    br label [[RETURN:%.*]]
 ; CHECK:       if.else:
 ; CHECK-NEXT:    [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
 ; CHECK-NEXT:    [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
-; CHECK-NEXT:    [[DOTCMP5:%.*]] = and i1 [[CMP5]], [[NOT_CMP3]]
+; CHECK-NEXT:    [[DOTCMP5:%.*]] = select i1 [[CMP5]], i1 [[NOT_CMP3]], i1 false
 ; CHECK-NEXT:    br label [[RETURN]]
 ; CHECK:       return:
 ; CHECK-NEXT:    [[RETVAL_0_IN:%.*]] = phi i1 [ [[DOTCMP2]], [[IF_THEN]] ], [ [[DOTCMP5]], [[IF_ELSE]] ]


        


More information about the llvm-commits mailing list