File: debug-alloca-phi-2.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (46 lines) | stat: -rw-r--r-- 1,909 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; RUN: opt < %s -passes=mem2reg -S | FileCheck %s
source_filename = "bugpoint-output.bc"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"

define void @scan() #0 !dbg !12 {
entry:
  %entry1 = alloca i1, align 8
  call void @llvm.dbg.declare(metadata ptr %entry1, metadata !18, metadata !19), !dbg !20
  store i1 0, ptr %entry1, align 8, !dbg !20
  br label %for.cond, !dbg !20

for.cond:
; CHECK: %[[PHI:.*]] = phi i1 [ false, %entry ], [ %0, %for.cond ]
  %entryN = load i1, ptr %entry1, align 8, !dbg !20
; CHECK: call void @llvm.dbg.value(metadata i1 %[[PHI]],
; CHECK-SAME:                      metadata !DIExpression())
  %0 = add i1 %entryN, 1
; CHECK: %0 = add i1 %[[PHI]], true
; CHECK: call void @llvm.dbg.value(metadata i1 %0,
; CHECK-SAME:                      metadata !DIExpression())
  store i1 %0, ptr %entry1, align 8, !dbg !20
  br label %for.cond, !dbg !20
}

declare void @llvm.dbg.declare(metadata, metadata, metadata) #1

attributes #0 = { nounwind ssp uwtable }
attributes #1 = { nounwind readnone }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!10, !11}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "adrian", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
!1 = !DIFile(filename: "<stdin>", directory: "/")
!2 = !{}
!4 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !{i32 1, !"PIC Level", i32 2}
!12 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !13, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !15)
!13 = !DISubroutineType(types: !14)
!14 = !{null, !4, !4}
!15 = !{!18}
!18 = !DILocalVariable(name: "entry", scope: !12, file: !1, line: 6, type: !4)
!19 = !DIExpression()
!20 = !DILocation(line: 6, scope: !12)