load-abs.ll
2.51 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
; RUN: llc -march=hexagon -O3 -hexagon-small-data-threshold=0 < %s | FileCheck %s
; Check that absolute loads are generated for 64-bit
target triple = "hexagon-unknown--elf"
@g0 = external global i8, align 8
@g1 = external global i16, align 8
@g2 = external global i32, align 8
@g3 = external global i64, align 8
; CHECK-LABEL: f0:
; CHECK: = memd(##441656)
define i64 @f0() #0 {
b0:
%v0 = load volatile i64, i64* inttoptr (i32 441656 to i64*)
ret i64 %v0
}
; CHECK-LABEL: f1:
; CHECK: = memw(##441656)
define i64 @f1() #0 {
b0:
%v0 = load volatile i32, i32* inttoptr (i32 441656 to i32*)
%v1 = sext i32 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f2:
; CHECK: = memw(##441656)
define i64 @f2() #0 {
b0:
%v0 = load volatile i32, i32* inttoptr (i32 441656 to i32*)
%v1 = zext i32 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f3:
; CHECK: = memh(##441656)
define i64 @f3() #0 {
b0:
%v0 = load volatile i16, i16* inttoptr (i32 441656 to i16*)
%v1 = sext i16 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f4:
; CHECK: = memuh(##441656)
define i64 @f4() #0 {
b0:
%v0 = load volatile i16, i16* inttoptr (i32 441656 to i16*)
%v1 = zext i16 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f5:
; CHECK: = memb(##441656)
define i64 @f5() #0 {
b0:
%v0 = load volatile i8, i8* inttoptr (i32 441656 to i8*)
%v1 = sext i8 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f6:
; CHECK: = memub(##441656)
define i64 @f6() #0 {
b0:
%v0 = load volatile i8, i8* inttoptr (i32 441656 to i8*)
%v1 = zext i8 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f7:
; CHECK: = memd(##g3)
define i64 @f7() #0 {
b0:
%v0 = load volatile i64, i64* @g3
ret i64 %v0
}
; CHECK-LABEL: f8:
; CHECK: = memw(##g2)
define i64 @f8() #0 {
b0:
%v0 = load volatile i32, i32* @g2
%v1 = sext i32 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f9:
; CHECK: = memw(##g2)
define i64 @f9() #0 {
b0:
%v0 = load volatile i32, i32* @g2
%v1 = zext i32 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f10:
; CHECK: = memh(##g1)
define i64 @f10() #0 {
b0:
%v0 = load volatile i16, i16* @g1
%v1 = sext i16 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f11:
; CHECK: = memuh(##g1)
define i64 @f11() #0 {
b0:
%v0 = load volatile i16, i16* @g1
%v1 = zext i16 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f12:
; CHECK: = memb(##g0)
define i64 @f12() #0 {
b0:
%v0 = load volatile i8, i8* @g0
%v1 = sext i8 %v0 to i64
ret i64 %v1
}
; CHECK-LABEL: f13:
; CHECK: = memub(##g0)
define i64 @f13() #0 {
b0:
%v0 = load volatile i8, i8* @g0
%v1 = zext i8 %v0 to i64
ret i64 %v1
}
attributes #0 = { nounwind }