1; RUN: opt < %s -sroa -simple-loop-unswitch -disable-output 2; RUN: opt < %s -sroa -simple-loop-unswitch -enable-mssa-loop-dependency=true -verify-memoryssa -disable-output 3; PR11016 4target 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" 5target triple = "x86_64-apple-macosx10.7.2" 6 7%class.MyContainer.1.3.19.29 = type { [6 x %class.MyMemVarClass.0.2.18.28*] } 8%class.MyMemVarClass.0.2.18.28 = type { i32 } 9 10define void @_ZN11MyContainer1fEi(%class.MyContainer.1.3.19.29* %this, i32 %doit) uwtable ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 11entry: 12 br label %for.cond 13 14for.cond: ; preds = %for.inc, %entry 15 %inc1 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] 16 %conv = sext i32 %inc1 to i64 17 %cmp = icmp ult i64 %conv, 6 18 br i1 %cmp, label %for.body, label %for.end 19 20for.body: ; preds = %for.cond 21 %tobool = icmp ne i32 %doit, 0 22 br i1 %tobool, label %for.inc, label %if.then 23 24if.then: ; preds = %for.body 25 %idxprom = sext i32 %inc1 to i64 26 %array_ = getelementptr inbounds %class.MyContainer.1.3.19.29, %class.MyContainer.1.3.19.29* %this, i32 0, i32 0 27 %arrayidx = getelementptr inbounds [6 x %class.MyMemVarClass.0.2.18.28*], [6 x %class.MyMemVarClass.0.2.18.28*]* %array_, i32 0, i64 %idxprom 28 %tmp4 = load %class.MyMemVarClass.0.2.18.28*, %class.MyMemVarClass.0.2.18.28** %arrayidx, align 8 29 %isnull = icmp eq %class.MyMemVarClass.0.2.18.28* %tmp4, null 30 br i1 %isnull, label %for.inc, label %delete.notnull 31 32delete.notnull: ; preds = %if.then 33 invoke void @_ZN13MyMemVarClassD1Ev(%class.MyMemVarClass.0.2.18.28* %tmp4) 34 to label %invoke.cont unwind label %lpad 35 36invoke.cont: ; preds = %delete.notnull 37 %0 = bitcast %class.MyMemVarClass.0.2.18.28* %tmp4 to i8* 38 call void @_ZdlPv(i8* %0) nounwind 39 br label %for.inc 40 41lpad: ; preds = %delete.notnull 42 %1 = landingpad { i8*, i32 } 43 cleanup 44 %2 = extractvalue { i8*, i32 } %1, 0 45 %3 = extractvalue { i8*, i32 } %1, 1 46 %4 = bitcast %class.MyMemVarClass.0.2.18.28* %tmp4 to i8* 47 call void @_ZdlPv(i8* %4) nounwind 48 %lpad.val = insertvalue { i8*, i32 } undef, i8* %2, 0 49 %lpad.val7 = insertvalue { i8*, i32 } %lpad.val, i32 %3, 1 50 resume { i8*, i32 } %lpad.val7 51 52for.inc: ; preds = %invoke.cont, %if.then, %for.body 53 %inc = add nsw i32 %inc1, 1 54 br label %for.cond 55 56for.end: ; preds = %for.cond 57 ret void 58} 59 60declare void @_ZN13MyMemVarClassD1Ev(%class.MyMemVarClass.0.2.18.28*) 61 62declare i32 @__gxx_personality_v0(...) 63 64declare void @_ZdlPv(i8*) nounwind 65