Skip to content

Commit 2ba4cfd

Browse files
author
luxufan
committed
[ValutTracking] Use isGuaranteedNotToBePoison in impliesPoison
Differential Revision: https://reviews.llvm.org/D149934
1 parent 776bb27 commit 2ba4cfd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6689,7 +6689,7 @@ static bool directlyImpliesPoison(const Value *ValAssumedPoison,
66896689

66906690
static bool impliesPoison(const Value *ValAssumedPoison, const Value *V,
66916691
unsigned Depth) {
6692-
if (isGuaranteedNotToBeUndefOrPoison(ValAssumedPoison))
6692+
if (isGuaranteedNotToBePoison(ValAssumedPoison))
66936693
return true;
66946694

66956695
if (directlyImpliesPoison(ValAssumedPoison, V, /* Depth */ 0))

llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ define i32 @func_logical(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp
6060
; CHECK: if.then:
6161
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
6262
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
63-
; CHECK-NEXT: [[DOTCMP2:%.*]] = select i1 [[CMP2]], i1 [[NOT_CMP1]], i1 false
63+
; CHECK-NEXT: [[DOTCMP2:%.*]] = and i1 [[CMP2]], [[NOT_CMP1]]
6464
; CHECK-NEXT: br label [[RETURN:%.*]]
6565
; CHECK: if.else:
6666
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
6767
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
68-
; CHECK-NEXT: [[DOTCMP5:%.*]] = select i1 [[CMP5]], i1 [[NOT_CMP3]], i1 false
68+
; CHECK-NEXT: [[DOTCMP5:%.*]] = and i1 [[CMP5]], [[NOT_CMP3]]
6969
; CHECK-NEXT: br label [[RETURN]]
7070
; CHECK: return:
7171
; CHECK-NEXT: [[RETVAL_0_IN:%.*]] = phi i1 [ [[DOTCMP2]], [[IF_THEN]] ], [ [[DOTCMP5]], [[IF_ELSE]] ]

0 commit comments

Comments
 (0)