File: tocdata-non-zero-addend.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 (69 lines) | stat: -rw-r--r-- 1,676 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# RUN: llc -verify-machineinstrs -x mir -filetype=obj < %s -o %t.o
# RUN: llvm-objdump -dr %t.o | FileCheck %s
# CHECK-LABEL: .read_x
# CHECK: lbz 3, 2(2)
# CHECK-NEXT: R_TOC        x
# CHECK-LABEL: .read_y
# CHECK: lbz 3, 0(2)
# CHECK-NEXT: R_TOC        y

--- |
  ; ModuleID = '<stdin>'
  source_filename = "<stdin>"
  target datalayout = "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512"
  target triple = "powerpc64-ibm-aix"
  
  @x = local_unnamed_addr global i32 218114560, align 4 #0
  @y = external local_unnamed_addr global i32, align 4 #0
  
  define signext range(i32 0, 256) i32 @read_x() {
  entry:
    %0 = load i32, ptr @x, align 4
    %shr = lshr i32 %0, 8
    %and = and i32 %shr, 255
    ret i32 %and
  }
  
  define signext range(i32 0, 256) i32 @read_y() {
  entry:
    %0 = load i32, ptr @y, align 4
    %shr = lshr i32 %0, 16
    %and = and i32 %shr, 255
    ret i32 %and
  }
  
  attributes #0 = { "toc-data" }

...
---
name:            read_x
alignment:       4
tracksRegLiveness: true
registers:
  - { id: 0, class: g8rc }
frameInfo:
  maxAlignment:    8
machineFunctionInfo: {}
body:             |
  bb.0.entry:
    %0:g8rc = LBZ8 @x + 2, $x2 :: (dereferenceable load (s8) from @x + 2, align 2, basealign 4)
    $x3 = COPY %0
    BLR8 implicit $lr8, implicit $rm, implicit $x3

...
---
name:            read_y
alignment:       4
tracksRegLiveness: true
registers:
  - { id: 0, class: g8rc }
frameInfo:
  maxAlignment:    8
machineFunctionInfo: {}
body:             |
  bb.0.entry:
    %0:g8rc = LBZ8 @y + 1, $x2 :: (dereferenceable load (s8) from @y + 1, basealign 4)
    $x3 = COPY %0
    BLR8 implicit $lr8, implicit $rm, implicit $x3

...