diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index c1a8d3d25bf55a..75fef34eaf4a31 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -801,22 +801,12 @@ Optional LazyValueInfoImpl::solveBlockValueSelect( return None; ValueLatticeElement &TrueVal = *OptTrueVal; - // If we hit overdefined, don't ask more queries. We want to avoid poisoning - // extra slots in the table if we can. - if (TrueVal.isOverdefined()) - return ValueLatticeElement::getOverdefined(); - Optional OptFalseVal = getBlockValue(SI->getFalseValue(), BB); if (!OptFalseVal) return None; ValueLatticeElement &FalseVal = *OptFalseVal; - // If we hit overdefined, don't ask more queries. We want to avoid poisoning - // extra slots in the table if we can. - if (FalseVal.isOverdefined()) - return ValueLatticeElement::getOverdefined(); - if (TrueVal.isConstantRange() && FalseVal.isConstantRange()) { const ConstantRange &TrueCR = TrueVal.getConstantRange(); const ConstantRange &FalseCR = FalseVal.getConstantRange(); diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/and.ll b/llvm/test/Transforms/CorrelatedValuePropagation/and.ll index 0fd2955d626277..195dd8b9b4d66c 100644 --- a/llvm/test/Transforms/CorrelatedValuePropagation/and.ll +++ b/llvm/test/Transforms/CorrelatedValuePropagation/and.ll @@ -129,8 +129,7 @@ define i32 @min_and(i32 %a) { ; CHECK-LABEL: @min_and( ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[A:%.*]], 127 ; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32 [[A]], i32 127 -; CHECK-NEXT: [[AND:%.*]] = and i32 [[SEL]], 127 -; CHECK-NEXT: ret i32 [[AND]] +; CHECK-NEXT: ret i32 [[SEL]] ; %cmp = icmp ult i32 %a, 127 %sel = select i1 %cmp, i32 %a, i32 127 @@ -142,8 +141,7 @@ define i32 @min_and_comm(i32 %a) { ; CHECK-LABEL: @min_and_comm( ; CHECK-NEXT: [[CMP:%.*]] = icmp uge i32 [[A:%.*]], 127 ; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32 127, i32 [[A]] -; CHECK-NEXT: [[AND:%.*]] = and i32 [[SEL]], 127 -; CHECK-NEXT: ret i32 [[AND]] +; CHECK-NEXT: ret i32 [[SEL]] ; %cmp = icmp uge i32 %a, 127 %sel = select i1 %cmp, i32 127, i32 %a