139 lines · plain
1; RUN: llc < %s -mtriple=armv4t-unknown-linux-gnueabi | FileCheck %s2; PR 74333; XFAIL: *4 5%0 = type { ptr, ptr }6%1 = type { ptr, ptr, ptr }7%"class.llvm::Record" = type { i32, %"class.std::basic_string", %"class.llvm::SMLoc", %"class.std::vector", %"class.std::vector", %"class.std::vector" }8%"class.llvm::RecordVal" = type { %"class.std::basic_string", ptr, i32, ptr }9%"class.llvm::SMLoc" = type { ptr }10%"class.llvm::StringInit" = type { [8 x i8], %"class.std::basic_string" }11%"class.std::basic_string" = type { %"class.llvm::SMLoc" }12%"class.std::vector" = type { [12 x i8] }13%"struct.llvm::Init" = type { ptr }14 15@_ZTIN4llvm5RecTyE = external constant %0 ; <ptr> [#uses=1]16@_ZTIN4llvm4InitE = external constant %0 ; <ptr> [#uses=1]17@_ZTIN4llvm11RecordRecTyE = external constant %1 ; <ptr> [#uses=1]18@.str8 = external constant [47 x i8] ; <ptr> [#uses=1]19@_ZTIN4llvm9UnsetInitE = external constant %1 ; <ptr> [#uses=1]20@.str51 = external constant [45 x i8] ; <ptr> [#uses=1]21@__PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs = external constant [116 x i8] ; <ptr> [#uses=1]22 23@_ZN4llvm9RecordValC1ERKSsPNS_5RecTyEj = alias void (ptr, ptr, ptr, i32), ptr @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj ; <ptr> [#uses=0]24 25declare ptr @__dynamic_cast(ptr, ptr, ptr, i32)26 27declare void @__assert_fail(ptr, ptr, i32, ptr) noreturn28 29declare void @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj(ptr, ptr, ptr, i32) align 230 31define ptr @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs(ptr %this, ptr %R, ptr %RV, ptr %FieldName) align 2 {32;CHECK: ldmia sp!, {r4, r5, r6, r7, r8, lr}33;CHECK: bx r12 @ TAILCALL34entry:35 %.loc = alloca i32 ; <ptr> [#uses=2]36 %tmp.i = getelementptr inbounds %"class.llvm::StringInit", ptr %this, i32 0, i32 0, i32 4 ; <ptr> [#uses=1]37 %tmp2.i = load ptr, ptr %tmp.i ; <ptr> [#uses=2]38 %0 = icmp eq ptr %tmp2.i, null ; <i1> [#uses=1]39 br i1 %0, label %entry.return_crit_edge, label %tmpbb40 41entry.return_crit_edge: ; preds = %entry42 br label %return43 44tmpbb: ; preds = %entry45 %1 = tail call ptr @__dynamic_cast(ptr %tmp2.i, ptr @_ZTIN4llvm5RecTyE, ptr @_ZTIN4llvm11RecordRecTyE, i32 -1) ; <ptr> [#uses=1]46 %phitmp = icmp eq ptr %1, null ; <i1> [#uses=1]47 br i1 %phitmp, label %.return_crit_edge, label %if.then48 49.return_crit_edge: ; preds = %tmpbb50 br label %return51 52if.then: ; preds = %tmpbb53 %tmp2.i.i.i.i = getelementptr inbounds %"class.llvm::StringInit", ptr %this, i32 0, i32 1, i32 0, i32 0 ; <ptr> [#uses=1]54 %tmp3.i.i.i.i = load ptr, ptr %tmp2.i.i.i.i ; <ptr> [#uses=2]55 %arrayidx.i.i.i.i = getelementptr inbounds i8, ptr %tmp3.i.i.i.i, i32 -12 ; <ptr> [#uses=1]56 %tmp2.i.i.i = load i32, ptr %arrayidx.i.i.i.i ; <i32> [#uses=1]57 %tmp.i5 = getelementptr inbounds %"class.llvm::Record", ptr %R, i32 0, i32 4 ; <ptr> [#uses=1]58 %tmp2.i.i = getelementptr inbounds %"class.llvm::Record", ptr %R, i32 0, i32 4, i32 0, i32 4 ; <ptr> [#uses=1]59 %tmp3.i.i6 = load ptr, ptr %tmp2.i.i ; <ptr> [#uses=1]60 %tmp6.i.i = load ptr, ptr %tmp.i5 ; <ptr> [#uses=5]61 %sub.ptr.lhs.cast.i.i = ptrtoint ptr %tmp3.i.i6 to i32 ; <i32> [#uses=1]62 %sub.ptr.rhs.cast.i.i = ptrtoint ptr %tmp6.i.i to i32 ; <i32> [#uses=1]63 %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i ; <i32> [#uses=1]64 %sub.ptr.div.i.i = ashr i32 %sub.ptr.sub.i.i, 4 ; <i32> [#uses=1]65 br label %codeRepl66 67codeRepl: ; preds = %if.then68 %targetBlock = call i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32 %sub.ptr.div.i.i, ptr %tmp6.i.i, i32 %tmp2.i.i.i, ptr %tmp3.i.i.i.i, ptr %.loc) ; <i1> [#uses=1]69 %.reload = load i32, ptr %.loc ; <i32> [#uses=3]70 br i1 %targetBlock, label %for.cond.i.return_crit_edge, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit71 72for.cond.i.return_crit_edge: ; preds = %codeRepl73 br label %return74 75_ZN4llvm6Record8getValueENS_9StringRefE.exit: ; preds = %codeRepl76 %add.ptr.i.i = getelementptr inbounds %"class.llvm::RecordVal", ptr %tmp6.i.i, i32 %.reload ; <ptr> [#uses=2]77 %tobool5 = icmp eq ptr %add.ptr.i.i, null ; <i1> [#uses=1]78 br i1 %tobool5, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, label %if.then679 80_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge: ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit81 br label %return82 83if.then6: ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit84 %cmp = icmp eq ptr %add.ptr.i.i, %RV ; <i1> [#uses=1]85 br i1 %cmp, label %if.then6.if.end_crit_edge, label %land.lhs.true86 87if.then6.if.end_crit_edge: ; preds = %if.then688 br label %if.end89 90land.lhs.true: ; preds = %if.then691 %tobool10 = icmp eq ptr %RV, null ; <i1> [#uses=1]92 br i1 %tobool10, label %lor.lhs.false, label %land.lhs.true.return_crit_edge93 94land.lhs.true.return_crit_edge: ; preds = %land.lhs.true95 br label %return96 97lor.lhs.false: ; preds = %land.lhs.true98 %tmp.i3 = getelementptr inbounds %"class.llvm::RecordVal", ptr %tmp6.i.i, i32 %.reload, i32 3 ; <ptr> [#uses=1]99 %tmp2.i4 = load ptr, ptr %tmp.i3 ; <ptr> [#uses=2]100 %2 = icmp eq ptr %tmp2.i4, null ; <i1> [#uses=1]101 br i1 %2, label %lor.lhs.false.if.end_crit_edge, label %tmpbb1102 103lor.lhs.false.if.end_crit_edge: ; preds = %lor.lhs.false104 br label %if.end105 106tmpbb1: ; preds = %lor.lhs.false107 %3 = tail call ptr @__dynamic_cast(ptr %tmp2.i4, ptr @_ZTIN4llvm4InitE, ptr @_ZTIN4llvm9UnsetInitE, i32 -1) ; <ptr> [#uses=1]108 %phitmp32 = icmp eq ptr %3, null ; <i1> [#uses=1]109 br i1 %phitmp32, label %.if.end_crit_edge, label %.return_crit_edge1110 111.return_crit_edge1: ; preds = %tmpbb1112 br label %return113 114.if.end_crit_edge: ; preds = %tmpbb1115 br label %if.end116 117if.end: ; preds = %.if.end_crit_edge, %lor.lhs.false.if.end_crit_edge, %if.then6.if.end_crit_edge118 %tmp.i1 = getelementptr inbounds %"class.llvm::RecordVal", ptr %tmp6.i.i, i32 %.reload, i32 3 ; <ptr> [#uses=1]119 %tmp2.i2 = load ptr, ptr %tmp.i1 ; <ptr> [#uses=3]120 %cmp19 = icmp eq ptr %tmp2.i2, %this ; <i1> [#uses=1]121 br i1 %cmp19, label %cond.false, label %cond.end122 123cond.false: ; preds = %if.end124 tail call void @__assert_fail(ptr @.str51, ptr @.str8, i32 1141, ptr @__PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs) noreturn125 unreachable126 127cond.end: ; preds = %if.end128 %4 = load ptr, ptr %tmp2.i2 ; <ptr> [#uses=1]129 %vfn = getelementptr inbounds ptr, ptr %4, i32 8 ; <ptr> [#uses=1]130 %5 = load ptr, ptr %vfn ; <ptr> [#uses=1]131 %call25 = tail call ptr %5(ptr %tmp2.i2, ptr %R, ptr %RV, ptr %FieldName) ; <ptr> [#uses=1]132 ret ptr %call25133 134return: ; preds = %.return_crit_edge1, %land.lhs.true.return_crit_edge, %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, %for.cond.i.return_crit_edge, %.return_crit_edge, %entry.return_crit_edge135 ret ptr null136}137 138declare i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32, ptr, i32, ptr, ptr)139