--- | ; ModuleID = '' source_filename = "" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; Function Attrs: nounwind readonly uwtable define i32 @foo(i32* nocapture readonly %a, i32 %N) local_unnamed_addr #0 !dbg !6 { entry: tail call void @llvm.dbg.value(metadata i32* %a, i64 0, metadata !12, metadata !17), !dbg !18 tail call void @llvm.dbg.value(metadata i32 %N, i64 0, metadata !13, metadata !17), !dbg !19 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !14, metadata !17), !dbg !20 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !15, metadata !17), !dbg !21 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !15, metadata !17), !dbg !21 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !14, metadata !17), !dbg !20 %cmp6 = icmp sgt i32 %N, 0, !dbg !22 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup, !dbg !25 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %N to i64 br label %for.body, !dbg !27 for.cond.cleanup: ; preds = %for.body, %entry %x.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] ret i32 %x.0.lcssa, !dbg !29 for.body: ; preds = %for.body, %for.body.preheader %lsr.iv1 = phi i32* [ %scevgep, %for.body ], [ %a, %for.body.preheader ] %lsr.iv = phi i64 [ %lsr.iv.next, %for.body ], [ %wide.trip.count, %for.body.preheader ] %x.07 = phi i32 [ %add, %for.body ], [ 0, %for.body.preheader ] %0 = load i32, i32* %lsr.iv1, align 4, !dbg !27, !tbaa !30 %add = add nsw i32 %0, %x.07, !dbg !34 tail call void @llvm.dbg.value(metadata i32 %add, i64 0, metadata !14, metadata !17), !dbg !20 tail call void @llvm.dbg.value(metadata i32 %add, i64 0, metadata !14, metadata !17), !dbg !20 %lsr.iv.next = add i64 %lsr.iv, -1, !dbg !22 %scevgep = getelementptr i32, i32* %lsr.iv1, i64 1, !dbg !22 %exitcond = icmp eq i64 %lsr.iv.next, 0, !dbg !22 br i1 %exitcond, label %for.cond.cleanup, label %for.body, !dbg !25, !llvm.loop !35 } ; Function Attrs: nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 ; Function Attrs: nounwind declare void @llvm.stackprotector(i8*, i8**) #2 attributes #0 = { nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "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"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { nounwind readnone } attributes #2 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!3, !4} !llvm.ident = !{!5} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.1 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) !1 = !DIFile(filename: "foo.c", directory: "/tmp") !2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 4} !4 = !{i32 2, !"Debug Info Version", i32 3} !5 = !{!"clang version 4.0.1 "} !6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11) !7 = !DISubroutineType(types: !8) !8 = !{!9, !10, !9} !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64) !11 = !{!12, !13, !14, !15} !12 = !DILocalVariable(name: "a", arg: 1, scope: !6, file: !1, line: 2, type: !10) !13 = !DILocalVariable(name: "N", arg: 2, scope: !6, file: !1, line: 2, type: !9) !14 = !DILocalVariable(name: "x", scope: !6, file: !1, line: 3, type: !9) !15 = !DILocalVariable(name: "i", scope: !16, file: !1, line: 4, type: !9) !16 = distinct !DILexicalBlock(scope: !6, file: !1, line: 4, column: 3) !17 = !DIExpression() !18 = !DILocation(line: 2, column: 14, scope: !6) !19 = !DILocation(line: 2, column: 21, scope: !6) !20 = !DILocation(line: 3, column: 7, scope: !6) !21 = !DILocation(line: 4, column: 12, scope: !16) !22 = !DILocation(line: 4, column: 21, scope: !23) !23 = !DILexicalBlockFile(scope: !24, file: !1, discriminator: 1) !24 = distinct !DILexicalBlock(scope: !16, file: !1, line: 4, column: 3) !25 = !DILocation(line: 4, column: 3, scope: !26) !26 = !DILexicalBlockFile(scope: !16, file: !1, discriminator: 1) !27 = !DILocation(line: 5, column: 10, scope: !28) !28 = distinct !DILexicalBlock(scope: !24, file: !1, line: 4, column: 31) !29 = !DILocation(line: 7, column: 3, scope: !6) !30 = !{!31, !31, i64 0} !31 = !{!"int", !32, i64 0} !32 = !{!"omnipotent char", !33, i64 0} !33 = !{!"Simple C/C++ TBAA"} !34 = !DILocation(line: 5, column: 7, scope: !28) !35 = distinct !{!35, !36, !37} !36 = !DILocation(line: 4, column: 3, scope: !16) !37 = !DILocation(line: 6, column: 3, scope: !16) ... --- name: foo alignment: 4 exposesReturnsTwice: false legalized: false regBankSelected: false selected: false tracksRegLiveness: true registers: - { id: 0, class: gr64 } - { id: 1, class: gr32 } - { id: 2, class: gr64 } - { id: 3, class: gr64 } - { id: 4, class: gr32 } - { id: 5, class: gr32 } - { id: 6, class: gr64 } - { id: 7, class: gr64 } - { id: 8, class: gr64 } - { id: 9, class: gr32 } - { id: 10, class: gr32 } - { id: 11, class: gr32 } - { id: 12, class: gr32 } liveins: - { reg: '%rdi', virtual-reg: '%8' } - { reg: '%esi', virtual-reg: '%9' } frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false hasPatchPoint: false stackSize: 0 offsetAdjustment: 0 maxAlignment: 0 adjustsStack: false hasCalls: false maxCallFrameSize: 0 hasOpaqueSPAdjustment: false hasVAStart: false hasMustTailInVarArgFunc: false body: | bb.0.entry: successors: %bb.1.for.body.preheader(0x50000000), %bb.2.for.cond.cleanup(0x30000000) liveins: %rdi, %esi DBG_VALUE debug-use %rdi, debug-use _, !12, !17, debug-location !18 DBG_VALUE debug-use %esi, debug-use _, !13, !17, debug-location !19 %9 = COPY %esi DBG_VALUE debug-use %9, debug-use _, !13, !17, debug-location !19 %8 = COPY %rdi DBG_VALUE debug-use %8, debug-use _, !12, !17, debug-location !18 %10 = MOV32r0 implicit-def dead %eflags TEST32rr %9, %9, implicit-def %eflags, debug-location !25 JLE_1 %bb.2.for.cond.cleanup, implicit %eflags, debug-location !25 JMP_1 %bb.1.for.body.preheader, debug-location !25 bb.1.for.body.preheader: successors: %bb.3.for.body(0x80000000) %12 = MOV32rr %9 %0 = SUBREG_TO_REG 0, killed %12, 4 %11 = MOV32r0 implicit-def dead %eflags JMP_1 %bb.3.for.body, debug-location !27 bb.2.for.cond.cleanup: %1 = PHI %10, %bb.0.entry, %5, %bb.3.for.body %eax = COPY %1, debug-location !29 RET 0, %eax, debug-location !29 bb.3.for.body: successors: %bb.2.for.cond.cleanup(0x04000000), %bb.3.for.body(0x7c000000) %2 = PHI %8, %bb.1.for.body.preheader, %7, %bb.3.for.body %3 = PHI %0, %bb.1.for.body.preheader, %6, %bb.3.for.body %4 = PHI %11, %bb.1.for.body.preheader, %5, %bb.3.for.body %5 = ADD32rm %4, %2, 1, _, 0, _, implicit-def dead %eflags, debug-location !34 :: (load 4 from %ir.lsr.iv1, !tbaa !30) %6 = DEC64r %3, implicit-def %eflags, debug-location !22 %7 = ADD64ri8 %2, 4, implicit-def dead %eflags, debug-location !22 JE_1 %bb.2.for.cond.cleanup, implicit %eflags, debug-location !25 JMP_1 %bb.3.for.body, debug-location !25 ...