Debian Codegraph @

llvm/test/CodeGen/PowerPC/tocdata-non-zero-addend.mir

raw
1 # RUN: llc -verify-machineinstrs -x mir -filetype=obj < %s -o %t.o
2 # RUN: llvm-objdump -dr %t.o | FileCheck %s
3 # CHECK-LABEL: .read_x
4 # CHECK: lbz 3, 2(2)
5 # CHECK-NEXT: R_TOC x
6 # CHECK-LABEL: .read_y
7 # CHECK: lbz 3, 0(2)
8 # CHECK-NEXT: R_TOC y
9
10 --- |
11 ; ModuleID = '<stdin>'
12 source_filename = "<stdin>"
13 target datalayout = "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512"
14 target triple = "powerpc64-ibm-aix"
15
16 @x = local_unnamed_addr global i32 218114560, align 4 #0
17 @y = external local_unnamed_addr global i32, align 4 #0
18
19 define signext range(i32 0, 256) i32 @read_x() {
20 entry:
21 %0 = load i32, ptr @x, align 4
22 %shr = lshr i32 %0, 8
23 %and = and i32 %shr, 255
24 ret i32 %and
25 }
26
27 define signext range(i32 0, 256) i32 @read_y() {
28 entry:
29 %0 = load i32, ptr @y, align 4
30 %shr = lshr i32 %0, 16
31 %and = and i32 %shr, 255
32 ret i32 %and
33 }
34
35 attributes #0 = { "toc-data" }
36
37 ...
38 ---
39 name: read_x
40 alignment: 4
41 tracksRegLiveness: true
42 registers:
43 - { id: 0, class: g8rc }
44 frameInfo:
45 maxAlignment: 8
46 machineFunctionInfo: {}
47 body: |
48 bb.0.entry:
49 liveins: $x3, $x2
50 %0:g8rc = LBZ8 @x + 2, $x2 :: (dereferenceable load (s8) from @x + 2, align 2, basealign 4)
51 $x3 = COPY %0
52 BLR8 implicit $lr8, implicit $rm, implicit $x3
53
54 ...
55 ---
56 name: read_y
57 alignment: 4
58 tracksRegLiveness: true
59 registers:
60 - { id: 0, class: g8rc }
61 frameInfo:
62 maxAlignment: 8
63 machineFunctionInfo: {}
64 body: |
65 bb.0.entry:
66 liveins: $x3, $x2
67 %0:g8rc = LBZ8 @y + 1, $x2 :: (dereferenceable load (s8) from @y + 1, basealign 4)
68 $x3 = COPY %0
69 BLR8 implicit $lr8, implicit $rm, implicit $x3
70
71 ...