xref: /llvm-project/llvm/test/CodeGen/PowerPC/vec_misaligned.ll (revision 5403c59c608c08c8ecd4303763f08eb046eb5e4d)
1; RUN: llc -verify-machineinstrs < %s -mcpu=g5 | FileCheck %s
2; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mattr=-power8-vector | FileCheck %s
3; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mattr=-power8-vector | FileCheck %s -check-prefix=CHECK-LE
4
5target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
6target triple = "powerpc-unknown-linux-gnu"
7	%struct.S2203 = type { %struct.u16qi }
8	%struct.u16qi = type { <16 x i8> }
9@s = weak global %struct.S2203 zeroinitializer		; <ptr> [#uses=1]
10
11define void @foo(i32 %x, ...) {
12entry:
13; CHECK: foo:
14; CHECK-LE: foo:
15	%x_addr = alloca i32		; <ptr> [#uses=1]
16	%ap = alloca ptr		; <ptr> [#uses=3]
17	%ap.0 = alloca ptr		; <ptr> [#uses=3]
18	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
19	store i32 %x, ptr %x_addr
20	call void @llvm.va_start( ptr %ap )
21	%tmp = load ptr, ptr %ap, align 4		; <ptr> [#uses=1]
22	store ptr %tmp, ptr %ap.0, align 4
23	%tmp2 = load ptr, ptr %ap.0, align 4		; <ptr> [#uses=1]
24	%tmp3 = getelementptr i8, ptr %tmp2, i64 16		; <ptr> [#uses=1]
25	store ptr %tmp3, ptr %ap, align 4
26	%tmp4 = load ptr, ptr %ap.0, align 4		; <ptr> [#uses=1]
27	%tmp6 = getelementptr %struct.S2203, ptr @s, i32 0, i32 0		; <ptr> [#uses=1]
28	%tmp7 = getelementptr %struct.S2203, ptr %tmp4, i32 0, i32 0		; <ptr> [#uses=1]
29	%tmp8 = getelementptr %struct.u16qi, ptr %tmp6, i32 0, i32 0		; <ptr> [#uses=1]
30	%tmp9 = getelementptr %struct.u16qi, ptr %tmp7, i32 0, i32 0		; <ptr> [#uses=1]
31	%tmp10 = load <16 x i8>, ptr %tmp9, align 4		; <<16 x i8>> [#uses=1]
32; CHECK: lvsl
33; CHECK: vperm
34; CHECK-LE: lvsr
35; CHECK-LE: vperm
36	store <16 x i8> %tmp10, ptr %tmp8, align 4
37	br label %return
38
39return:		; preds = %entry
40	ret void
41}
42
43declare void @llvm.va_start(ptr) nounwind
44