File: debugloc-load-select.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (55 lines) | stat: -rw-r--r-- 2,909 bytes parent folder | download | duplicates (6)
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
47
48
49
50
51
52
53
54
55
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -p=gvn -S | FileCheck %s
;; Check that when GVN replaces a load of a select with a select of the values
;; that would be loaded, we propagate the debug location from the load to the
;; select, since the select is a replacement that produces the same value.

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @loadtree(ptr %topol, i1 %cmp168) {
; CHECK-LABEL: define void @loadtree(
; CHECK-SAME: ptr [[TOPOL:%.*]], i1 [[CMP168:%.*]]) {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr null, align 4
; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[TOPOL]], align 4
; CHECK-NEXT:    [[CMP1681:%.*]] = icmp sgt i32 [[TMP0]], [[TMP1]]
; CHECK-NEXT:    [[TMP2:%.*]] = select i1 [[CMP168]], i32 [[TMP1]], i32 [[TMP0]], !dbg [[DBG3:![0-9]+]]
; CHECK-NEXT:    [[DOT:%.*]] = select i1 [[CMP168]], ptr [[TOPOL]], ptr null, !dbg [[DBG9:![0-9]+]]
; CHECK-NEXT:    [[CMP174_NOT473:%.*]] = icmp eq i32 [[TMP2]], 0
; CHECK-NEXT:    ret void
;
entry:
  %0 = load i32, ptr null, align 4
  %1 = load i32, ptr %topol, align 4
  %cmp1681 = icmp sgt i32 %0, %1
  %. = select i1 %cmp168, ptr %topol, ptr null, !dbg !9
  %2 = load i32, ptr %., align 4, !dbg !3
  %cmp174.not473 = icmp eq i32 %2, 0
  ret void
}

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2}

!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 20.0.0git")
!1 = !DIFile(filename: "/tmp/mltaln9.c", directory: "/tmp")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocation(line: 4, column: 22, scope: !5)
!4 = !DIFile(filename: "mltaln9.c", directory: "/tmp")
!5 = distinct !DISubprogram(name: "loadtree", scope: !4, file: !4, line: 869, type: !6, scopeLine: 870, unit: !0, retainedNodes: !8)
!6 = distinct !DISubroutineType(types: !7)
!7 = !{null}
!8 = !{}
!9 = !DILocation(line: 9, column: 22, scope: !5)
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
; CHECK: [[META1]] = !DIFile(filename: "/tmp/mltaln9.c", directory: {{.*}})
; CHECK: [[DBG3]] = !DILocation(line: 4, column: 22, scope: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "loadtree", scope: [[META5:![0-9]+]], file: [[META5]], line: 869, type: [[META6:![0-9]+]], scopeLine: 870, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META8:![0-9]+]])
; CHECK: [[META5]] = !DIFile(filename: "mltaln9.c", directory: {{.*}})
; CHECK: [[META6]] = distinct !DISubroutineType(types: [[META7:![0-9]+]])
; CHECK: [[META7]] = !{null}
; CHECK: [[META8]] = !{}
; CHECK: [[DBG9]] = !DILocation(line: 9, column: 22, scope: [[META4]])
;.