File: sroasplit-5.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 (85 lines) | stat: -rw-r--r-- 3,560 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
; RUN: opt %s -passes='sroa,verify' -S -o - | FileCheck %s
; From:
; struct prog_src_register {
;   unsigned : 4;
;   int Index : 12 + 1;
;   unsigned : 12;
;   unsigned : 4;
;   int : 12 + 1
; } src_reg_for_float() {
;   struct prog_src_register a;
;   memset(&a, 0, sizeof(a));
;   int local = a.Index;
;   return a;
; }
; ModuleID = 'pr22495.c'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; When SROA is creating new smaller allocas, it may add padding.
;
; There should be no debug info for the padding.
; CHECK-NOT: DW_OP_LLVM_fragment, 56
; CHECK: DIExpression(DW_OP_LLVM_fragment, 0, 32)
; CHECK-NOT: DW_OP_LLVM_fragment, 56
; CHECK: DIExpression(DW_OP_LLVM_fragment, 32, 24)
; CHECK-NOT: DW_OP_LLVM_fragment, 56
%struct.prog_src_register = type { i32, i24 }

; Function Attrs: nounwind
define i64 @src_reg_for_float() #0 !dbg !4 {
entry:
  %retval = alloca %struct.prog_src_register, align 4
  %a = alloca %struct.prog_src_register, align 4
  %local = alloca i32, align 4
  call void @llvm.dbg.declare(metadata ptr %a, metadata !16, metadata !17), !dbg !18
  call void @llvm.memset.p0.i64(ptr align 4 %a, i8 0, i64 8, i1 false), !dbg !19
  call void @llvm.dbg.declare(metadata ptr %local, metadata !20, metadata !17), !dbg !21
  %bf.load = load i32, ptr %a, align 4, !dbg !21
  %bf.shl = shl i32 %bf.load, 15, !dbg !21
  %bf.ashr = ashr i32 %bf.shl, 19, !dbg !21
  store i32 %bf.ashr, ptr %local, align 4, !dbg !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %retval, ptr align 4 %a, i64 8, i1 false), !dbg !22
  %0 = load i64, ptr %retval, align 1, !dbg !22
  ret i64 %0, !dbg !22
}

; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1

; Function Attrs: nounwind
declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #2

; Function Attrs: nounwind
declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #2

attributes #0 = { nounwind }
attributes #1 = { nounwind readnone }
attributes #2 = { nounwind }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!13, !14}
!llvm.ident = !{!15}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "<stdin>", directory: "")
!2 = !{}
!4 = distinct !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 7, file: !5, scope: !6, type: !7, retainedNodes: !2)
!5 = !DIFile(filename: "pr22495.c", directory: "")
!6 = !DIFile(filename: "pr22495.c", directory: "")
!7 = !DISubroutineType(types: !8)
!8 = !{!9}
!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "prog_src_register", line: 1, size: 64, align: 32, file: !5, elements: !10)
!10 = !{!11}
!11 = !DIDerivedType(tag: DW_TAG_member, name: "Index", line: 3, size: 13, align: 32, offset: 4, file: !5, scope: !9, baseType: !12)
!12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!13 = !{i32 2, !"Dwarf Version", i32 4}
!14 = !{i32 2, !"Debug Info Version", i32 3}
!15 = !{!"clang version 3.7.0 "}
!16 = !DILocalVariable(name: "a", line: 8, scope: !4, file: !6, type: !9)
!17 = !DIExpression()
!18 = !DILocation(line: 8, scope: !4)
!19 = !DILocation(line: 9, scope: !4)
!20 = !DILocalVariable(name: "local", line: 10, scope: !4, file: !6, type: !12)
!21 = !DILocation(line: 10, scope: !4)
!22 = !DILocation(line: 11, scope: !4)