File: merge-string-used-by-metadata.mir

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (52 lines) | stat: -rw-r--r-- 2,638 bytes parent folder | download | duplicates (3)
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
# RUN: llc -run-pass=ppc-merge-strings -mcpu=pwr8 -mtriple powerpc64le-unknown-linux-gnu \
# RUN:   -verify-machineinstrs -o - %s | FileCheck %s
# RUN: llc -run-pass=ppc-merge-strings -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff \
# RUN:   -verify-machineinstrs -o - %s | FileCheck %s

--- |
  ; Constants list.
  @const.1 = internal constant [7 x i8] c"const1\00", align 1
  @const.2 = internal constant [7 x i8] c"const2\00", align 1

  ;;
  ;; Start of test code.
  ;;

  define noundef ptr @func1(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 !dbg !6 {
  ; CHECK-LABEL: func1
  ; CHECK:       ret ptr getelementptr inbounds ({ [7 x i8], [7 x i8] }, ptr @__ModuleStringPool, i32 0, i32 1), !dbg !14
  entry:
    ret ptr @const.2, !dbg !14
  }

  define noundef ptr @func2(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 {
  ; CHECK-LABEL: func2
  ; CHECK:       ret ptr @__ModuleStringPool
  entry:
    ret ptr @const.1
  }

  attributes #0 = { noinline nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="pwr8" "target-features"="+altivec,+bpermd,+crbits,+crypto,+direct-move,+extdiv,+htm,+isa-v206-instructions,+isa-v207-instructions,+power8-vector,+quadword-atomics,+vsx,-aix-small-local-exec-tls,-isa-v30-instructions,-power9-vector,-privileged,-rop-protect,-spe" }

  !llvm.dbg.cu = !{!0}
  !llvm.module.flags = !{!3, !4}
  !llvm.ident = !{!5}

  ; CHECK:       !10 = !DITemplateValueParameter(name: "ID", type: !11, value: ptr getelementptr inbounds ({ [7 x i8], [7 x i8] }, ptr @__ModuleStringPool, i32 0, i32 1))
  !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
  !1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
  !2 = !{}
  !3 = !{i32 7, !"Dwarf Version", i32 3}
  !4 = !{i32 2, !"Debug Info Version", i32 3}
  !5 = !{!"clang version 17.0.0"}
  !6 = distinct !DISubprogram(name: "getId", linkageName: "func1", scope: !1, file: !1, line: 2, type: !7, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, templateParams: !9, retainedNodes: !2)
  !7 = !DISubroutineType(types: !8)
  !8 = !{null}
  !9 = !{!10}
  !10 = !DITemplateValueParameter(name: "ID", type: !11, value: ptr @const.2)
  !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)
  !12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13)
  !13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char)
  !14 = !DILocation(line: 3, scope: !6)

...