Index: llvm/lib/CodeGen/BranchFolding.cpp =================================================================== --- llvm/lib/CodeGen/BranchFolding.cpp +++ llvm/lib/CodeGen/BranchFolding.cpp @@ -396,11 +396,12 @@ // the CFI instruction. Later on, this leads to BB2 being 'hacked off' at the // wrong place (in ReplaceTailWithBranchTo()) which results in losing this CFI // instruction. - while (I1 != MBB1->end() && I1->isCFIInstruction()) { + // Skip CFI_INSTRUCTION and debugging instruction; necessary to avoid changing the code. + while (I1 != MBB1->end() && !countsAsInstruction(*I1)) { ++I1; } - while (I2 != MBB2->end() && I2->isCFIInstruction()) { + while (I2 != MBB2->end() && !countsAsInstruction(*I2)) { ++I2; } Index: llvm/test/CodeGen/MIR/X86/branch-folder-with-debug.mir =================================================================== --- /dev/null +++ llvm/test/CodeGen/MIR/X86/branch-folder-with-debug.mir @@ -0,0 +1,439 @@ +# Generated with +# +# clang++ -g -w -O1 -S -emit-llvm test.cc +# llc -stop-before=branch-folder test.ll +# +# template class e; +# class allocator { +# public: +# ~allocator(); +# }; +# template class e { +# public: +# e(char *, allocator = allocator()); +# }; +# template bool operator==(e, b); +# class f { +# public: +# f(int *, int *, int *, int, int, int, int); +# e g(); +# void j(); +# }; +# int h, i; +# class k { +# void l(); +# bool m_fn4(); +# int m; +# int n; +# int q; +# int fmap; +# }; +# void k::l() { +# e o = ""; +# for (;;) { +# int p = 0; +# for (;;) { +# if (m_fn4()) +# break; +# f a(&q, &fmap, &m, n, h, i, 0); +# if (a.g() == "") +# a.j(); +# } +# } +# } + +# RUN: llc -o - %s -mtriple=x86_64-- -run-pass=branch-folder | FileCheck %s +--- | + ; ModuleID = 'test.ll' + source_filename = "test.cc" + target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + target triple = "x86_64-unknown-linux-gnu" + + %class.k = type { i32, i32, i32, i32 } + %class.e = type { i8 } + %class.allocator = type { i8 } + %class.f = type { i8 } + + @h = dso_local local_unnamed_addr global i32 0, align 4, !dbg !0 + @i = dso_local local_unnamed_addr global i32 0, align 4, !dbg !6 + @.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 + + ; Function Attrs: noreturn uwtable + define dso_local void @_ZN1k1lEv(%class.k* %0) local_unnamed_addr #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !13 { + %2 = alloca %class.e, align 1 + %3 = alloca %class.allocator, align 1 + %4 = alloca %class.f, align 1 + call void @llvm.dbg.value(metadata %class.k* %0, metadata !29, metadata !DIExpression()), !dbg !70 + %5 = bitcast %class.e* %2 to i8*, !dbg !71 + call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %5) #5, !dbg !71 + invoke void @_ZN1eIciEC1EPc9allocator(%class.e* nonnull %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %class.allocator* nonnull %3) + to label %6 unwind label %11, !dbg !72 + + 6: ; preds = %1 + call void @_ZN9allocatorD1Ev(%class.allocator* nonnull %3) #5, !dbg !73 + %7 = getelementptr inbounds %class.k, %class.k* %0, i64 0, i32 2, !dbg !74 + %8 = getelementptr inbounds %class.k, %class.k* %0, i64 0, i32 3, !dbg !74 + br label %9, !dbg !75 + + 9: ; preds = %9, %24, %6 + call void @llvm.dbg.value(metadata i32 0, metadata !49, metadata !DIExpression()), !dbg !76 + %10 = call zeroext i1 @_ZN1k5m_fn4Ev(%class.k* %0), !dbg !77 + br i1 %10, label %9, label %.preheader, !dbg !79 + + .preheader: ; preds = %9 + br label %14, !dbg !80 + + 11: ; preds = %1 + %12 = landingpad { i8*, i32 } + cleanup, !dbg !81 + %13 = bitcast %class.e* %2 to i8*, !dbg !71 + call void @_ZN9allocatorD1Ev(%class.allocator* nonnull %3) #5, !dbg !73 + call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %13) #5, !dbg !81 + %exn.obj = extractvalue { i8*, i32 } %12, 0 + call void @_Unwind_Resume(i8* %exn.obj) + unreachable + + 14: ; preds = %.preheader, %24 + %15 = bitcast %class.k* %0 to i32*, !dbg !74 + %16 = bitcast %class.f* %4 to i8*, !dbg !74 + call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %16) #5, !dbg !82 + %17 = bitcast %class.k* %0 to i8*, !dbg !83 + %sunkaddr = getelementptr inbounds i8, i8* %17, i64 4, !dbg !83 + %18 = bitcast i8* %sunkaddr to i32*, !dbg !83 + %19 = load i32, i32* %18, align 4, !dbg !83, !tbaa !84 + %20 = load i32, i32* @h, align 4, !dbg !89, !tbaa !90 + %21 = load i32, i32* @i, align 4, !dbg !91, !tbaa !90 + call void @llvm.dbg.value(metadata %class.f* %4, metadata !53, metadata !DIExpression(DW_OP_deref)), !dbg !74 + call void @_ZN1fC1EPiS0_S0_iiii(%class.f* nonnull %4, i32* nonnull %7, i32* nonnull %8, i32* %15, i32 %19, i32 %20, i32 %21, i32 0), !dbg !92 + call void @llvm.dbg.value(metadata %class.f* %4, metadata !53, metadata !DIExpression(DW_OP_deref)), !dbg !74 + call void @_ZN1f1gEv(%class.f* nonnull %4), !dbg !93 + %22 = call zeroext i1 @_ZeqIPKcciEb1eIT0_T1_ET_(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !95 + br i1 %22, label %23, label %24, !dbg !96 + + 23: ; preds = %14 + call void @llvm.dbg.value(metadata %class.f* %4, metadata !53, metadata !DIExpression(DW_OP_deref)), !dbg !74 + call void @_ZN1f1jEv(%class.f* nonnull %4), !dbg !97 + br label %24, !dbg !98 + + 24: ; preds = %23, %14 + %25 = bitcast %class.f* %4 to i8*, !dbg !74 + call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %25) #5, !dbg !99 + %26 = call zeroext i1 @_ZN1k5m_fn4Ev(%class.k* nonnull %0), !dbg !77 + br i1 %26, label %9, label %14, !dbg !79, !llvm.loop !100 + } + + ; Function Attrs: argmemonly nounwind willreturn + declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 + + declare dso_local void @_ZN1eIciEC1EPc9allocator(%class.e*, i8*, %class.allocator*) unnamed_addr #2 + + declare dso_local i32 @__gxx_personality_v0(...) + + ; Function Attrs: nounwind + declare dso_local void @_ZN9allocatorD1Ev(%class.allocator*) unnamed_addr #3 + + declare dso_local zeroext i1 @_ZN1k5m_fn4Ev(%class.k*) local_unnamed_addr #2 + + declare dso_local void @_ZN1fC1EPiS0_S0_iiii(%class.f*, i32*, i32*, i32*, i32, i32, i32, i32) unnamed_addr #2 + + declare dso_local zeroext i1 @_ZeqIPKcciEb1eIT0_T1_ET_(i8*) local_unnamed_addr #2 + + declare dso_local void @_ZN1f1gEv(%class.f*) local_unnamed_addr #2 + + declare dso_local void @_ZN1f1jEv(%class.f*) local_unnamed_addr #2 + + ; Function Attrs: argmemonly nounwind willreturn + declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 + + ; Function Attrs: nounwind readnone speculatable willreturn + declare void @llvm.dbg.value(metadata, metadata, metadata) #4 + + declare void @_Unwind_Resume(i8*) + + ; Function Attrs: nounwind + declare void @llvm.stackprotector(i8*, i8**) #5 + + attributes #0 = { noreturn uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + attributes #1 = { argmemonly nounwind willreturn } + attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + attributes #3 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + attributes #4 = { nounwind readnone speculatable willreturn } + attributes #5 = { nounwind } + + !llvm.dbg.cu = !{!2} + !llvm.module.flags = !{!9, !10, !11} + !llvm.ident = !{!12} + + !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) + !1 = distinct !DIGlobalVariable(name: "h", scope: !2, file: !3, line: 17, type: !8, isLocal: false, isDefinition: true) + !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 10.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None) + !3 = !DIFile(filename: "test.cc", directory: "") + !4 = !{} + !5 = !{!0, !6} + !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) + !7 = distinct !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 17, type: !8, isLocal: false, isDefinition: true) + !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !9 = !{i32 2, !"Dwarf Version", i32 4} + !10 = !{i32 2, !"Debug Info Version", i32 3} + !11 = !{i32 1, !"wchar_size", i32 4} + !12 = !{!"clang version 10.0.0 "} + !13 = distinct !DISubprogram(name: "l", linkageName: "_ZN1k1lEv", scope: !14, file: !3, line: 26, type: !21, scopeLine: 26, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !20, retainedNodes: !28) + !14 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "k", file: !3, line: 18, size: 128, flags: DIFlagTypePassByValue, elements: !15, identifier: "_ZTS1k") + !15 = !{!16, !17, !18, !19, !20, !24} + !16 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !14, file: !3, line: 21, baseType: !8, size: 32) + !17 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !14, file: !3, line: 22, baseType: !8, size: 32, offset: 32) + !18 = !DIDerivedType(tag: DW_TAG_member, name: "q", scope: !14, file: !3, line: 23, baseType: !8, size: 32, offset: 64) + !19 = !DIDerivedType(tag: DW_TAG_member, name: "fmap", scope: !14, file: !3, line: 24, baseType: !8, size: 32, offset: 96) + !20 = !DISubprogram(name: "l", linkageName: "_ZN1k1lEv", scope: !14, file: !3, line: 19, type: !21, scopeLine: 19, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized) + !21 = !DISubroutineType(types: !22) + !22 = !{null, !23} + !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) + !24 = !DISubprogram(name: "m_fn4", linkageName: "_ZN1k5m_fn4Ev", scope: !14, file: !3, line: 20, type: !25, scopeLine: 20, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized) + !25 = !DISubroutineType(types: !26) + !26 = !{!27, !23} + !27 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean) + !28 = !{!29, !31, !49, !53} + !29 = !DILocalVariable(name: "this", arg: 1, scope: !13, type: !30, flags: DIFlagArtificial | DIFlagObjectPointer) + !30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64) + !31 = !DILocalVariable(name: "o", scope: !13, file: !3, line: 27, type: !32) + !32 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "e", file: !3, line: 6, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !33, templateParams: !46, identifier: "_ZTS1eIciE") + !33 = !{!34} + !34 = !DISubprogram(name: "e", scope: !32, file: !3, line: 8, type: !35, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) + !35 = !DISubroutineType(types: !36) + !36 = !{null, !37, !38, !40} + !37 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !32, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) + !38 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !39, size: 64) + !39 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) + !40 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "allocator", file: !3, line: 2, size: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !41, identifier: "_ZTS9allocator") + !41 = !{!42} + !42 = !DISubprogram(name: "~allocator", scope: !40, file: !3, line: 4, type: !43, scopeLine: 4, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) + !43 = !DISubroutineType(types: !44) + !44 = !{null, !45} + !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !40, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) + !46 = !{!47, !48} + !47 = !DITemplateTypeParameter(type: !39) + !48 = !DITemplateTypeParameter(type: !8) + !49 = !DILocalVariable(name: "p", scope: !50, file: !3, line: 29, type: !8) + !50 = distinct !DILexicalBlock(scope: !51, file: !3, line: 28, column: 12) + !51 = distinct !DILexicalBlock(scope: !52, file: !3, line: 28, column: 3) + !52 = distinct !DILexicalBlock(scope: !13, file: !3, line: 28, column: 3) + !53 = !DILocalVariable(name: "a", scope: !54, file: !3, line: 33, type: !57) + !54 = distinct !DILexicalBlock(scope: !55, file: !3, line: 30, column: 14) + !55 = distinct !DILexicalBlock(scope: !56, file: !3, line: 30, column: 5) + !56 = distinct !DILexicalBlock(scope: !50, file: !3, line: 30, column: 5) + !57 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "f", file: !3, line: 11, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !58, identifier: "_ZTS1f") + !58 = !{!59, !64, !67} + !59 = !DISubprogram(name: "f", scope: !57, file: !3, line: 13, type: !60, scopeLine: 13, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) + !60 = !DISubroutineType(types: !61) + !61 = !{null, !62, !63, !63, !63, !8, !8, !8, !8} + !62 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !57, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) + !63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64) + !64 = !DISubprogram(name: "g", linkageName: "_ZN1f1gEv", scope: !57, file: !3, line: 14, type: !65, scopeLine: 14, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) + !65 = !DISubroutineType(types: !66) + !66 = !{!32, !62} + !67 = !DISubprogram(name: "j", linkageName: "_ZN1f1jEv", scope: !57, file: !3, line: 15, type: !68, scopeLine: 15, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) + !68 = !DISubroutineType(types: !69) + !69 = !{null, !62} + !70 = !DILocation(line: 0, scope: !13) + !71 = !DILocation(line: 27, column: 3, scope: !13) + !72 = !DILocation(line: 27, column: 15, scope: !13) + !73 = !DILocation(line: 27, column: 11, scope: !13) + !74 = !DILocation(line: 0, scope: !54) + !75 = !DILocation(line: 28, column: 3, scope: !13) + !76 = !DILocation(line: 0, scope: !50) + !77 = !DILocation(line: 31, column: 11, scope: !78) + !78 = distinct !DILexicalBlock(scope: !54, file: !3, line: 31, column: 11) + !79 = !DILocation(line: 31, column: 11, scope: !54) + !80 = !DILocation(line: 30, column: 5, scope: !56) + !81 = !DILocation(line: 38, column: 1, scope: !13) + !82 = !DILocation(line: 33, column: 7, scope: !54) + !83 = !DILocation(line: 33, column: 26, scope: !54) + !84 = !{!85, !86, i64 4} + !85 = !{!"_ZTS1k", !86, i64 0, !86, i64 4, !86, i64 8, !86, i64 12} + !86 = !{!"int", !87, i64 0} + !87 = !{!"omnipotent char", !88, i64 0} + !88 = !{!"Simple C++ TBAA"} + !89 = !DILocation(line: 33, column: 29, scope: !54) + !90 = !{!86, !86, i64 0} + !91 = !DILocation(line: 33, column: 32, scope: !54) + !92 = !DILocation(line: 33, column: 9, scope: !54) + !93 = !DILocation(line: 34, column: 13, scope: !94) + !94 = distinct !DILexicalBlock(scope: !54, file: !3, line: 34, column: 11) + !95 = !DILocation(line: 34, column: 17, scope: !94) + !96 = !DILocation(line: 34, column: 11, scope: !54) + !97 = !DILocation(line: 35, column: 11, scope: !94) + !98 = !DILocation(line: 35, column: 9, scope: !94) + !99 = !DILocation(line: 36, column: 5, scope: !55) + !100 = distinct !{!100, !80, !101} + !101 = !DILocation(line: 36, column: 5, scope: !56) + +... +--- +name: _ZN1k1lEv +alignment: 4 +exposesReturnsTwice: false +legalized: false +regBankSelected: false +selected: false +failedISel: false +tracksRegLiveness: true +hasWinCFI: false +registers: [] +liveins: + - { reg: '$rdi', virtual-reg: '' } +frameInfo: + isFrameAddressTaken: false + isReturnAddressTaken: false + hasStackMap: false + hasPatchPoint: false + stackSize: 56 + offsetAdjustment: -56 + maxAlignment: 8 + adjustsStack: true + hasCalls: true + stackProtector: '' + maxCallFrameSize: 16 + cvBytesOfCalleeSavedRegisters: 32 + hasOpaqueSPAdjustment: false + hasVAStart: false + hasMustTailInVarArgFunc: false + localFrameSize: 0 + savePoint: '' + restorePoint: '' +fixedStack: [] +stack: [] +callSites: [] +constants: [] +machineFunctionInfo: {} +body: | + bb.0 (%ir-block.1): + ; CHECK: successors: %bb.1(0x7ffff800), %bb.7(0x00000800) + successors: %bb.1(0x7ffff800), %bb.3(0x00000800) + liveins: $rdi, $r15, $r14, $r12, $rbx + + DBG_VALUE $rdi, $noreg, !29, !DIExpression(), debug-location !70 + frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp + CFI_INSTRUCTION def_cfa_offset 16 + frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp + CFI_INSTRUCTION def_cfa_offset 24 + frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp + CFI_INSTRUCTION def_cfa_offset 32 + frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp + CFI_INSTRUCTION def_cfa_offset 40 + $rsp = frame-setup SUB64ri8 $rsp, 24, implicit-def dead $eflags + CFI_INSTRUCTION def_cfa_offset 64 + CFI_INSTRUCTION offset $rbx, -40 + CFI_INSTRUCTION offset $r12, -32 + CFI_INSTRUCTION offset $r14, -24 + CFI_INSTRUCTION offset $r15, -16 + renamable $rbx = COPY $rdi + DBG_VALUE $rbx, $noreg, !29, !DIExpression(), debug-location !70 + EH_LABEL , debug-location !72 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !72 + renamable $rdi = LEA64r $rsp, 1, $noreg, 16, $noreg + $rdx = MOV64rr $rsp + $rsi = MOV32ri64 @.str, debug-location !72 + CALL64pcrel32 @_ZN1eIciEC1EPc9allocator, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit killed $rsi, implicit $rdx, implicit-def $rsp, implicit-def $ssp, debug-location !72 + EH_LABEL , debug-location !72 + JMP_1 %bb.1, debug-location !72 + + bb.1 (%ir-block.6): + successors: %bb.2(0x80000000) + liveins: $rbx + + CFI_INSTRUCTION def_cfa_offset 8, debug-location !73 + $rdi = MOV64rr $rsp + CALL64pcrel32 @_ZN9allocatorD1Ev, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, debug-location !73 + renamable $r14 = LEA64r renamable $rbx, 1, $noreg, 8, $noreg, debug-location !74 + renamable $r15 = LEA64r renamable $rbx, 1, $noreg, 12, $noreg, debug-location !74 + renamable $r12 = LEA64r $rsp, 1, $noreg, 8, $noreg + + bb.2 (%ir-block.9): + ; CHECK: successors: %bb.3(0x80000000) + successors: %bb.2(0x40000000), %bb.4(0x40000000) + liveins: $rbx, $r12, $r14, $r15 + + DBG_VALUE 0, $noreg, !49, !DIExpression(), debug-location !76 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !77 + ; CHECK: bb.3 (%ir-block.9): + ; CHECK: successors: %bb.2(0x07878788), %bb.4(0x78787878) + ; CHECK: liveins: $rbx, $r12, $r14, $r15 + $rdi = COPY renamable $rbx, debug-location !77 + CALL64pcrel32 @_ZN1k5m_fn4Ev, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $al, debug-location !77 + TEST8rr killed renamable $al, renamable $al, implicit-def $eflags, debug-location !79 + JCC_1 %bb.2, 5, implicit killed $eflags, debug-location !79 + JMP_1 %bb.4, debug-location !79 + + ; CHECK: bb.4 (%ir-block.14): + ; CHECK: successors: %bb.5(0x40000000), %bb.6(0x40000000) + bb.3 (%ir-block.11, landing-pad): + successors: + liveins: $rax, $rdx + + EH_LABEL + renamable $rbx = COPY $rax + CFI_INSTRUCTION def_cfa_offset 8, debug-location !73 + $rdi = MOV64rr $rsp + CALL64pcrel32 @_ZN9allocatorD1Ev, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, debug-location !73 + CFI_INSTRUCTION def_cfa_offset 8 + $rdi = COPY killed renamable $rbx + CALL64pcrel32 @_Unwind_Resume, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp + + bb.4 (%ir-block.14): + successors: %bb.5(0x40000000), %bb.6(0x40000000) + liveins: $rbx, $r12, $r14, $r15 + + renamable $r8d = MOV32rm renamable $rbx, 1, $noreg, 4, $noreg, debug-location !83 :: (load 4 from %ir.18, !tbaa !84) + renamable $r9d = MOV32rm $rip, 1, $noreg, @h, $noreg, debug-location !89 :: (dereferenceable load 4 from @h, !tbaa !90) + renamable $eax = MOV32rm $rip, 1, $noreg, @i, $noreg, implicit-def $rax, debug-location !91 :: (dereferenceable load 4 from @i, !tbaa !90) + DBG_VALUE $rsp, $noreg, !53, !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref), debug-location !74 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !92 + $rdi = COPY renamable $r12, debug-location !92 + $rsi = COPY renamable $r14, debug-location !92 + $rdx = COPY renamable $r15, debug-location !92 + $rcx = COPY renamable $rbx, debug-location !92 + PUSH64i8 0, implicit-def $rsp, implicit $rsp, debug-location !92 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !92 + PUSH64r killed renamable $rax, implicit-def $rsp, implicit $rsp, debug-location !92 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !92 + CALL64pcrel32 @_ZN1fC1EPiS0_S0_iiii, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit killed $rsi, implicit $rdx, implicit killed $rcx, implicit $r8d, implicit $r9d, implicit-def $rsp, implicit-def $ssp, debug-location !92 + $rsp = ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !92 + CFI_INSTRUCTION def_cfa_offset -16, debug-location !92 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !93 + $rdi = COPY renamable $r12, debug-location !93 + CALL64pcrel32 @_ZN1f1gEv, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, debug-location !93 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !95 + $rdi = MOV32ri64 @.str, debug-location !95 + CALL64pcrel32 @_ZeqIPKcciEb1eIT0_T1_ET_, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $al, debug-location !95 + TEST8rr killed renamable $al, renamable $al, implicit-def $eflags, debug-location !96 + ; CHECK: JCC_1 %bb.6, 4, implicit $eflags + JCC_1 %bb.6, 4, implicit killed $eflags, debug-location !96 + JMP_1 %bb.5, debug-location !96 + + ; CHECK: bb.5 (%ir-block.23): + ; CHECK: successors: %bb.6(0x80000000) + bb.5 (%ir-block.23): + successors: %bb.6(0x80000000) + liveins: $rbx, $r12, $r14, $r15 + + DBG_VALUE $rsp, $noreg, !53, !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref), debug-location !74 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !97 + $rdi = COPY renamable $r12, debug-location !97 + CALL64pcrel32 @_ZN1f1jEv, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, debug-location !97 + + ; CHECK: bb.6 (%ir-block.24): + ; CHECK: successors: %bb.3(0x80000000) + bb.6 (%ir-block.24): + successors: %bb.2(0x04000000), %bb.4(0x7c000000) + liveins: $rbx, $r12, $r14, $r15 + + CFI_INSTRUCTION def_cfa_offset 8, debug-location !77 + ; CHECK: JMP_1 %bb.3 + ; CHECK: bb.7 (%ir-block.11, landing-pad): + $rdi = COPY renamable $rbx, debug-location !77 + CALL64pcrel32 @_ZN1k5m_fn4Ev, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $al, debug-location !77 + TEST8rr killed renamable $al, renamable $al, implicit-def $eflags, debug-location !79 + JCC_1 %bb.2, 5, implicit killed $eflags, debug-location !79 + JMP_1 %bb.4, debug-location !79 + +...