File: loadstore-alignment.ll

package info (click to toggle)
llvm-toolchain-5.0 1:5.0.1-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 553,688 kB
  • sloc: cpp: 2,878,786; ansic: 584,110; asm: 246,252; python: 124,751; objc: 106,925; sh: 21,542; lisp: 8,628; pascal: 5,885; ml: 5,544; perl: 5,312; makefile: 2,208; cs: 2,022; xml: 686; php: 212; csh: 117
file content (90 lines) | stat: -rw-r--r-- 2,398 bytes parent folder | download | duplicates (16)
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
; RUN: opt -instcombine -S < %s | FileCheck %s
target datalayout = "E-p:64:64:64-p1:64:64:64-p2:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"

@x = external global <2 x i64>, align 16
@xx = external global [13 x <2 x i64>], align 16

@x.as2 = external addrspace(2) global <2 x i64>, align 16

; CHECK-LABEL: @static_hem(
; CHECK: , align 16
define <2 x i64> @static_hem() {
  %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7
  %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1
  ret <2 x i64> %tmp1
}

; CHECK-LABEL: @hem(
; CHECK: , align 16
define <2 x i64> @hem(i32 %i) {
  %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 %i
  %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1
  ret <2 x i64> %tmp1
}

; CHECK-LABEL: @hem_2d(
; CHECK: , align 16
define <2 x i64> @hem_2d(i32 %i, i32 %j) {
  %t = getelementptr [13 x <2 x i64>], [13 x <2 x i64>]* @xx, i32 %i, i32 %j
  %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1
  ret <2 x i64> %tmp1
}

; CHECK-LABEL: @foo(
; CHECK: , align 16
define <2 x i64> @foo() {
  %tmp1 = load <2 x i64>, <2 x i64>* @x, align 1
  ret <2 x i64> %tmp1
}

; CHECK-LABEL: @bar(
; CHECK: , align 16
; CHECK: , align 16
define <2 x i64> @bar() {
  %t = alloca <2 x i64>
  call void @kip(<2 x i64>* %t)
  %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1
  ret <2 x i64> %tmp1
}

; CHECK-LABEL: @static_hem_store(
; CHECK: , align 16
define void @static_hem_store(<2 x i64> %y) {
  %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7
  store <2 x i64> %y, <2 x i64>* %t, align 1
  ret void
}

; CHECK-LABEL: @hem_store(
; CHECK: , align 16
define void @hem_store(i32 %i, <2 x i64> %y) {
  %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 %i
  store <2 x i64> %y, <2 x i64>* %t, align 1
  ret void
}

; CHECK-LABEL: @hem_2d_store(
; CHECK: , align 16
define void @hem_2d_store(i32 %i, i32 %j, <2 x i64> %y) {
  %t = getelementptr [13 x <2 x i64>], [13 x <2 x i64>]* @xx, i32 %i, i32 %j
  store <2 x i64> %y, <2 x i64>* %t, align 1
  ret void
}

; CHECK-LABEL: @foo_store(
; CHECK: , align 16
define void @foo_store(<2 x i64> %y) {
  store <2 x i64> %y, <2 x i64>* @x, align 1
  ret void
}

; CHECK-LABEL: @bar_store(
; CHECK: , align 16
define void @bar_store(<2 x i64> %y) {
  %t = alloca <2 x i64>
  call void @kip(<2 x i64>* %t)
  store <2 x i64> %y, <2 x i64>* %t, align 1
  ret void
}

declare void @kip(<2 x i64>* %t)