}
void SCCPSolver::visitExtractValueInst(ExtractValueInst &EVI) {
- // ResolvedUndefsIn might mark I as overdefined. Bail out, even if we would
- // discover a concrete value later.
- if (isOverdefined(ValueState[&EVI]))
- return (void)markOverdefined(&EVI);
-
// If this returns a struct, mark all elements over defined, we don't track
// structs in structs.
if (EVI.getType()->isStructTy())
return (void)markOverdefined(&EVI);
+ // ResolvedUndefsIn might mark I as overdefined. Bail out, even if we would
+ // discover a concrete value later.
+ if (ValueState[&EVI].isOverdefined())
+ return (void)markOverdefined(&EVI);
+
// If this is extracting from more than one level of struct, we don't know.
if (EVI.getNumIndices() != 1)
return (void)markOverdefined(&EVI);
; CHECK-NEXT: call void @use(i1 [[F_2]])
; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i32 [[A]], 100
; CHECK-NEXT: call void @use(i1 [[F_3]])
+; CHECK-NEXT: [[F_4:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT: call void @use(i1 [[F_3]])
+; CHECK-NEXT: [[F_5:%.*]] = icmp eq i32 [[B]], 20
+; CHECK-NEXT: call void @use(i1 [[F_5]])
+; CHECK-NEXT: [[F_6:%.*]] = icmp ugt i32 [[B]], 100
+; CHECK-NEXT: call void @use(i1 [[F_6]])
; CHECK-NEXT: [[T_1:%.*]] = icmp ult i32 [[A]], 100
; CHECK-NEXT: call void @use(i1 [[T_1]])
; CHECK-NEXT: [[T_2:%.*]] = icmp ne i32 [[A]], 20
; CHECK-NEXT: call void @use(i1 [[C_3]])
; CHECK-NEXT: ret void
; CHECK: false:
-; CHECK-NEXT: [[F_4:%.*]] = icmp eq i32 [[A]], 50
-; CHECK-NEXT: call void @use(i1 [[F_4]])
+; CHECK-NEXT: [[F_7:%.*]] = icmp eq i32 [[A]], 50
+; CHECK-NEXT: call void @use(i1 [[F_7]])
; CHECK-NEXT: [[T_3:%.*]] = icmp ne i32 [[A]], 50
; CHECK-NEXT: call void @use(i1 [[T_3]])
; CHECK-NEXT: [[C_4:%.*]] = icmp eq i32 [[A]], 10
call void @use(i1 %f.2)
%f.3 = icmp ugt i32 %a, 100
call void @use(i1 %f.3)
+ %f.4 = icmp eq i32 %b, 0
+ call void @use(i1 %f.3)
+ %f.5 = icmp eq i32 %b, 20
+ call void @use(i1 %f.5)
+ %f.6 = icmp ugt i32 %b, 100
+ call void @use(i1 %f.6)
+
; Conditions below are true.
%t.1 = icmp ult i32 %a, 100
false:
; Conditions below are false;
- %f.4 = icmp eq i32 %a, 50
- call void @use(i1 %f.4)
+ %f.7 = icmp eq i32 %a, 50
+ call void @use(i1 %f.7)
; Conditions below are true;
%t.3 = icmp ne i32 %a, 50