• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s | not grep aghi
2; RUN: llc < %s | FileCheck %s
3
4target datalayout = "E-p:64:64:64-i1:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128"
5target triple = "s390x-unknown-linux-gnu"
6
7define void @foo1(i64* nocapture %a, i64 %idx, i64 %val) nounwind {
8entry:
9
10; CHECK: foo1:
11; CHECK:   stg %r4, 8(%r1,%r2)
12	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
13	%add.ptr2 = getelementptr i64* %a, i64 %add.ptr.sum		; <i64*> [#uses=1]
14	store i64 %val, i64* %add.ptr2
15	ret void
16}
17
18define void @foo2(i32* nocapture %a, i64 %idx, i32 %val) nounwind {
19entry:
20; CHECK: foo2:
21; CHECK:   st %r4, 4(%r1,%r2)
22	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
23	%add.ptr2 = getelementptr i32* %a, i64 %add.ptr.sum		; <i32*> [#uses=1]
24	store i32 %val, i32* %add.ptr2
25	ret void
26}
27
28define void @foo3(i16* nocapture %a, i64 %idx, i16 zeroext %val) nounwind {
29entry:
30; CHECK: foo3:
31; CHECK: sth     %r4, 2(%r1,%r2)
32	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
33	%add.ptr2 = getelementptr i16* %a, i64 %add.ptr.sum		; <i16*> [#uses=1]
34	store i16 %val, i16* %add.ptr2
35	ret void
36}
37
38define void @foo4(i8* nocapture %a, i64 %idx, i8 zeroext %val) nounwind {
39entry:
40; CHECK: foo4:
41; CHECK: stc     %r4, 1(%r3,%r2)
42	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
43	%add.ptr2 = getelementptr i8* %a, i64 %add.ptr.sum		; <i8*> [#uses=1]
44	store i8 %val, i8* %add.ptr2
45	ret void
46}
47
48define void @foo5(i8* nocapture %a, i64 %idx, i64 %val) nounwind {
49entry:
50; CHECK: foo5:
51; CHECK: stc     %r4, 1(%r3,%r2)
52	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
53	%add.ptr2 = getelementptr i8* %a, i64 %add.ptr.sum		; <i8*> [#uses=1]
54	%conv = trunc i64 %val to i8		; <i8> [#uses=1]
55	store i8 %conv, i8* %add.ptr2
56	ret void
57}
58
59define void @foo6(i16* nocapture %a, i64 %idx, i64 %val) nounwind {
60entry:
61; CHECK: foo6:
62; CHECK: sth     %r4, 2(%r1,%r2)
63	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
64	%add.ptr2 = getelementptr i16* %a, i64 %add.ptr.sum		; <i16*> [#uses=1]
65	%conv = trunc i64 %val to i16		; <i16> [#uses=1]
66	store i16 %conv, i16* %add.ptr2
67	ret void
68}
69
70define void @foo7(i32* nocapture %a, i64 %idx, i64 %val) nounwind {
71entry:
72; CHECK: foo7:
73; CHECK: st      %r4, 4(%r1,%r2)
74	%add.ptr.sum = add i64 %idx, 1		; <i64> [#uses=1]
75	%add.ptr2 = getelementptr i32* %a, i64 %add.ptr.sum		; <i32*> [#uses=1]
76	%conv = trunc i64 %val to i32		; <i32> [#uses=1]
77	store i32 %conv, i32* %add.ptr2
78	ret void
79}
80