97 lines · plain
1--- |2 ; REQUIRES: asserts3 ; RUN: llc -start-before=phi-node-elimination -stop-after=machinelicm -debug-only=machinelicm -o - %s -experimental-debug-variable-locations=false | FileCheck %s4 ; RUN: llc -start-before=phi-node-elimination -stop-after=machinelicm -debug-only=machinelicm -early-live-intervals -o - %s -experimental-debug-variable-locations=false | FileCheck %s5 ; Ensure we execute machinelicm post register allocation.6 ; Line numbers should not be retained when loop invariant instructions are hoisted.7 ;8 ; CHECK-LABEL: bb.0.entry:9 ; CHECK: MOV64rm $rip, 1, $noreg, target-flags(x86-gotpcrel) @x, $noreg :: (load (s64) from got)10 ; CHECK-LABEL: bb.1.while.body:11 ;12 target triple = "x86_64-unknown-linux-gnu"13 14 @x = common local_unnamed_addr global i32 0, align 4, !dbg !015 16 define void @Process(ptr nocapture readonly %p) !dbg !10 {17 entry:18 call void @llvm.dbg.value(metadata ptr %p, metadata !17, metadata !DIExpression()), !dbg !1819 br label %while.body, !dbg !1920 21 while.body: ; preds = %while.body, %entry22 %p.addr.0 = phi ptr [ %p, %entry ], [ %incdec.ptr, %while.body ]23 call void @llvm.dbg.value(metadata ptr %p.addr.0, metadata !17, metadata !DIExpression()), !dbg !1824 %incdec.ptr = getelementptr inbounds i32, ptr %p.addr.0, i64 1, !dbg !2025 call void @llvm.dbg.value(metadata ptr %incdec.ptr, metadata !17, metadata !DIExpression()), !dbg !1826 %0 = load i32, ptr %p.addr.0, align 4, !dbg !2127 store i32 %0, ptr @x, align 4, !dbg !2228 br label %while.body, !dbg !23, !llvm.loop !2529 }30 31 declare void @llvm.dbg.value(metadata, metadata, metadata)32 33 34 !llvm.dbg.cu = !{!2}35 !llvm.module.flags = !{!7, !8}36 !llvm.ident = !{!9}37 38 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())39 !1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)40 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 10.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)41 !3 = !DIFile(filename: "t.ll", directory: "/tmp/")42 !4 = !{}43 !5 = !{!0}44 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)45 !7 = !{i32 2, !"Dwarf Version", i32 4}46 !8 = !{i32 2, !"Debug Info Version", i32 3}47 !9 = !{!"clang version 10.0.0 "}48 !10 = distinct !DISubprogram(name: "Process", scope: !3, file: !3, line: 2, type: !11, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !16)49 !11 = !DISubroutineType(types: !12)50 !12 = !{null, !13}51 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64)52 !14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !15)53 !15 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)54 !16 = !{!17}55 !17 = !DILocalVariable(name: "p", arg: 1, scope: !10, file: !3, line: 2, type: !13)56 !18 = !DILocation(line: 2, column: 34, scope: !10)57 !19 = !DILocation(line: 4, column: 3, scope: !10)58 !20 = !DILocation(line: 5, column: 11, scope: !10)59 !21 = !DILocation(line: 5, column: 9, scope: !10)60 !22 = !DILocation(line: 5, column: 7, scope: !10)61 !23 = !DILocation(line: 4, column: 3, scope: !24)62 !24 = !DILexicalBlockFile(scope: !10, file: !3, discriminator: 1)63 !25 = distinct !{!25, !19, !20}64 65...66---67name: Process68tracksRegLiveness: true69registers:70 - { id: 0, class: gr64 }71 - { id: 1, class: gr64 }72 - { id: 2, class: gr64 }73 - { id: 3, class: gr32 }74 - { id: 4, class: gr64 }75body: |76 bb.0.entry:77 successors: %bb.1.while.body(0x80000000)78 liveins: $rdi79 80 DBG_VALUE $rdi, _, !17, !DIExpression(), debug-location !1881 %2 = COPY $rdi82 DBG_VALUE %2, _, !17, !DIExpression(), debug-location !1883 84 bb.1.while.body:85 successors: %bb.1.while.body(0x80000000)86 87 %0 = PHI %2, %bb.0.entry, %1, %bb.1.while.body88 DBG_VALUE %0, _, !17, !DIExpression(), debug-location !1889 %1 = ADD64ri32 %0, 4, implicit-def dead $eflags, debug-location !2090 DBG_VALUE %1, _, !17, !DIExpression(), debug-location !1891 %3 = MOV32rm %0, 1, _, 0, _, debug-location !21 :: (load (s32) from %ir.p.addr.0)92 %4 = MOV64rm $rip, 1, _, target-flags(x86-gotpcrel) @x, _, debug-location !22 :: (load (s64) from got)93 MOV32mr killed %4, 1, _, 0, _, killed %3, debug-location !22 :: (store (s32) into @x)94 JMP_1 %bb.1.while.body, debug-location !2395 96...97