1 ; RUN: opt < %s -disable-output -jump-threading
3 %class.E = type { i32 (...)**, %class.C }
4 %class.C = type { %class.A }
5 %class.A = type { i32 }
6 %class.D = type { %class.F }
7 %class.F = type { %class.E }
8 %class.B = type { %class.D* }
10 @_ZTV1D = unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*), i8* bitcast (void (%class.D*)* @_ZN1D7doApplyEv to i8*)]
11 @_ZTI1D = external unnamed_addr constant { i8*, i8*, i8* }
13 define void @_ZN15EditCommandImpl5applyEv(%class.E* %this) uwtable align 2 {
15 %0 = bitcast %class.E* %this to void (%class.E*)***
16 %vtable = load void (%class.E*)**, void (%class.E*)*** %0, align 8
17 %1 = load void (%class.E*)*, void (%class.E*)** %vtable, align 8
18 call void %1(%class.E* %this)
22 define void @_ZN1DC1Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 {
24 call void @_ZN24CompositeEditCommandImplC2Ev()
25 %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0
26 store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
30 define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 {
32 call void @_ZN24CompositeEditCommandImplC2Ev()
33 %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0
34 store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
38 declare void @_ZN24CompositeEditCommandImplC2Ev() #1
40 define void @_ZN1D7doApplyEv(%class.D* nocapture %this) unnamed_addr nounwind readnone uwtable align 2 {
45 define void @_Z3fn1v() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
47 %call = call noalias i8* @_Znwm() #8
48 invoke void @_ZN24CompositeEditCommandImplC2Ev()
49 to label %_ZN1DC1Ev.exit unwind label %lpad
51 _ZN1DC1Ev.exit: ; preds = %entry
52 %0 = bitcast i8* %call to i32 (...)***
53 store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
54 %_ref.i.i.i = getelementptr inbounds i8, i8* %call, i64 8
55 %1 = bitcast i8* %_ref.i.i.i to i32*
56 %2 = load i32, i32* %1, align 4
57 %inc.i.i.i = add nsw i32 %2, 1
58 store i32 %inc.i.i.i, i32* %1, align 4
59 %3 = bitcast i8* %call to %class.D*
60 invoke void @_ZN1D7doApplyEv(%class.D* %3)
61 to label %_ZN15EditCommandImpl5applyEv.exit unwind label %lpad1
63 _ZN15EditCommandImpl5applyEv.exit: ; preds = %_ZN1DC1Ev.exit
64 invoke void @_ZN1D16deleteKeyPressedEv()
65 to label %invoke.cont7 unwind label %lpad1
67 invoke.cont7: ; preds = %_ZN15EditCommandImpl5applyEv.exit
70 lpad: ; preds = %entry
71 %4 = landingpad { i8*, i32 }
73 call void @_ZdlPv() #9
76 lpad1: ; preds = %_ZN1DC1Ev.exit, %_ZN15EditCommandImpl5applyEv.exit
77 %5 = landingpad { i8*, i32 }
79 %6 = load i32, i32* %1, align 4
80 %tobool.i.i.i = icmp eq i32 %6, 0
81 br i1 %tobool.i.i.i, label %_ZN1BI1DED1Ev.exit, label %if.then.i.i.i
83 if.then.i.i.i: ; preds = %lpad1
84 br i1 undef, label %_ZN1BI1DED1Ev.exit, label %delete.notnull.i.i.i
86 delete.notnull.i.i.i: ; preds = %if.then.i.i.i
87 call void @_ZdlPv() #9
90 _ZN1BI1DED1Ev.exit: ; preds = %lpad1, %if.then.i.i.i
91 resume { i8*, i32 } undef
93 terminate.lpad: ; No predecessors!
94 %7 = landingpad { i8*, i32 }
99 define void @_ZN1BI1DEC1EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 {
101 %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
102 store %class.D* %p1, %class.D** %m_ptr.i, align 8
103 %_ref.i.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
104 %0 = load i32, i32* %_ref.i.i, align 4
105 %inc.i.i = add nsw i32 %0, 1
106 store i32 %inc.i.i, i32* %_ref.i.i, align 4
110 declare noalias i8* @_Znwm()
112 declare i32 @__gxx_personality_v0(...)
114 declare void @_ZdlPv()
116 define %class.D* @_ZN1BI1DEptEv(%class.B* nocapture readonly %this) nounwind readonly uwtable align 2 {
118 %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
119 %0 = load %class.D*, %class.D** %m_ptr, align 8
123 declare void @_ZN1D16deleteKeyPressedEv()
125 define void @_ZN1BI1DED1Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 {
127 %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
128 %0 = load %class.D*, %class.D** %m_ptr.i, align 8
129 %_ref.i.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
130 %1 = load i32, i32* %_ref.i.i, align 4
131 %tobool.i.i = icmp eq i32 %1, 0
132 br i1 %tobool.i.i, label %_ZN1BI1DED2Ev.exit, label %if.then.i.i
134 if.then.i.i: ; preds = %entry
135 br i1 undef, label %_ZN1BI1DED2Ev.exit, label %delete.notnull.i.i
137 delete.notnull.i.i: ; preds = %if.then.i.i
138 call void @_ZdlPv() #9
141 _ZN1BI1DED2Ev.exit: ; preds = %entry, %if.then.i.i
145 declare hidden void @__clang_call_terminate()
147 define void @_ZN1BI1DED2Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 {
149 %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
150 %0 = load %class.D*, %class.D** %m_ptr, align 8
151 %_ref.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
152 %1 = load i32, i32* %_ref.i, align 4
153 %tobool.i = icmp eq i32 %1, 0
154 br i1 %tobool.i, label %_ZN1AI1CE5derefEv.exit, label %if.then.i
156 if.then.i: ; preds = %entry
157 br i1 undef, label %_ZN1AI1CE5derefEv.exit, label %delete.notnull.i
159 delete.notnull.i: ; preds = %if.then.i
160 call void @_ZdlPv() #9
163 _ZN1AI1CE5derefEv.exit: ; preds = %entry, %if.then.i
167 define void @_ZN1AI1CE5derefEv(%class.A* nocapture readonly %this) nounwind uwtable align 2 {
169 %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0
170 %0 = load i32, i32* %_ref, align 4
171 %tobool = icmp eq i32 %0, 0
172 br i1 %tobool, label %if.end, label %if.then
174 if.then: ; preds = %entry
175 br i1 undef, label %if.end, label %delete.notnull
177 delete.notnull: ; preds = %if.then
178 call void @_ZdlPv() #9
181 if.end: ; preds = %entry, %if.then
185 define void @_ZN1BI1DEC2EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 {
187 %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
188 store %class.D* %p1, %class.D** %m_ptr, align 8
189 %_ref.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
190 %0 = load i32, i32* %_ref.i, align 4
191 %inc.i = add nsw i32 %0, 1
192 store i32 %inc.i, i32* %_ref.i, align 4
196 define void @_ZN1AI1CE3refEv(%class.A* nocapture %this) nounwind uwtable align 2 {
198 %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0
199 %0 = load i32, i32* %_ref, align 4
200 %inc = add nsw i32 %0, 1
201 store i32 %inc, i32* %_ref, align 4