1 ; RUN: opt < %s -passes='sroa,loop-mssa(simple-loop-unswitch)' -verify-memoryssa -disable-output
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
4 target triple = "x86_64-apple-macosx10.7.2"
6 %class.MyContainer.1.3.19.29 = type { [6 x ptr] }
7 %class.MyMemVarClass.0.2.18.28 = type { i32 }
9 define void @_ZN11MyContainer1fEi(ptr %this, i32 %doit) uwtable ssp align 2 personality ptr @__gxx_personality_v0 {
13 for.cond: ; preds = %for.inc, %entry
14 %inc1 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
15 %conv = sext i32 %inc1 to i64
16 %cmp = icmp ult i64 %conv, 6
17 br i1 %cmp, label %for.body, label %for.end
19 for.body: ; preds = %for.cond
20 %tobool = icmp ne i32 %doit, 0
21 br i1 %tobool, label %for.inc, label %if.then
23 if.then: ; preds = %for.body
24 %idxprom = sext i32 %inc1 to i64
25 %arrayidx = getelementptr inbounds [6 x ptr], ptr %this, i32 0, i64 %idxprom
26 %tmp4 = load ptr, ptr %arrayidx, align 8
27 %isnull = icmp eq ptr %tmp4, null
28 br i1 %isnull, label %for.inc, label %delete.notnull
30 delete.notnull: ; preds = %if.then
31 invoke void @_ZN13MyMemVarClassD1Ev(ptr %tmp4)
32 to label %invoke.cont unwind label %lpad
34 invoke.cont: ; preds = %delete.notnull
35 call void @_ZdlPv(ptr %tmp4) nounwind
38 lpad: ; preds = %delete.notnull
39 %0 = landingpad { ptr, i32 }
41 %1 = extractvalue { ptr, i32 } %0, 0
42 %2 = extractvalue { ptr, i32 } %0, 1
43 call void @_ZdlPv(ptr %tmp4) nounwind
44 %lpad.val = insertvalue { ptr, i32 } undef, ptr %1, 0
45 %lpad.val7 = insertvalue { ptr, i32 } %lpad.val, i32 %2, 1
46 resume { ptr, i32 } %lpad.val7
48 for.inc: ; preds = %invoke.cont, %if.then, %for.body
49 %inc = add nsw i32 %inc1, 1
52 for.end: ; preds = %for.cond
56 declare void @_ZN13MyMemVarClassD1Ev(ptr)
58 declare i32 @__gxx_personality_v0(...)
60 declare void @_ZdlPv(ptr) nounwind