1 ; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s -check-prefix=GENERIC
2 ; RUN: llc -verify-machineinstrs -mcpu=970 < %s | FileCheck %s -check-prefix=PWR
3 ; RUN: llc -verify-machineinstrs -mcpu=a2 < %s | FileCheck %s -check-prefix=BASIC
4 ; RUN: llc -verify-machineinstrs -mcpu=e500mc < %s | FileCheck %s -check-prefix=BASIC
5 ; RUN: llc -verify-machineinstrs -mcpu=e5500 < %s | FileCheck %s -check-prefix=BASIC
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 < %s | FileCheck %s -check-prefix=PWR
7 ; RUN: llc -verify-machineinstrs -mcpu=pwr5 < %s | FileCheck %s -check-prefix=PWR
8 ; RUN: llc -verify-machineinstrs -mcpu=pwr5x < %s | FileCheck %s -check-prefix=PWR
9 ; RUN: llc -verify-machineinstrs -mcpu=pwr6 < %s | FileCheck %s -check-prefix=PWR
10 ; RUN: llc -verify-machineinstrs -mcpu=pwr6x < %s | FileCheck %s -check-prefix=PWR
11 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s -check-prefix=PWR
12 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 < %s | FileCheck %s -check-prefix=PWR
13 target datalayout = "E-m:e-i64:64-n32:64"
14 target triple = "powerpc64-unknown-linux-gnu"
16 ; Function Attrs: nounwind readnone
17 define signext i32 @foo(i32 signext %x) #0 {
19 %mul = shl nsw i32 %x, 1
22 ; GENERIC-LABEL: .globl foo
23 ; BASIC-LABEL: .globl foo
24 ; PWR-LABEL: .globl foo
33 ; Function Attrs: nounwind
34 define void @loop(i32 signext %x, i32* nocapture %a) #1 {
38 ; GENERIC-LABEL: @loop
44 ; GENERIC-NOT: .p2align
54 vector.body: ; preds = %vector.body, %entry
55 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
56 %induction45 = or i64 %index, 1
57 %0 = getelementptr inbounds i32, i32* %a, i64 %index
58 %1 = getelementptr inbounds i32, i32* %a, i64 %induction45
59 %2 = load i32, i32* %0, align 4
60 %3 = load i32, i32* %1, align 4
61 %4 = add nsw i32 %2, 4
62 %5 = add nsw i32 %3, 4
63 %6 = mul nsw i32 %4, 3
64 %7 = mul nsw i32 %5, 3
65 store i32 %6, i32* %0, align 4
66 store i32 %7, i32* %1, align 4
67 %index.next = add i64 %index, 2
68 %8 = icmp eq i64 %index.next, 2048
69 br i1 %8, label %for.end, label %vector.body
71 for.end: ; preds = %vector.body
75 ; Function Attrs: nounwind
76 define void @sloop(i32 signext %x, i32* nocapture %a) #1 {
80 ; GENERIC-LABEL: @sloop
86 ; GENERIC-NOT: .p2align
93 for.body: ; preds = %for.body, %entry
94 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
95 %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
96 %0 = load i32, i32* %arrayidx, align 4
97 %add = add nsw i32 %0, 4
98 %mul = mul nsw i32 %add, 3
99 store i32 %mul, i32* %arrayidx, align 4
100 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
101 %exitcond = icmp eq i64 %indvars.iv.next, 2048
102 br i1 %exitcond, label %for.end, label %for.body
104 for.end: ; preds = %for.body
108 ; Function Attrs: nounwind
109 define void @test_minsize(i32 signext %x, i32* nocapture %a) #2 {
111 br label %vector.body
113 ; GENERIC-LABEL: @test_minsize
114 ; BASIC-LABEL: @test_minsize
115 ; PWR-LABEL: @test_minsize
119 ; GENERIC-NOT: .p2align
120 ; BASIC-NOT: .p2align
129 vector.body: ; preds = %vector.body, %entry
130 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
131 %induction45 = or i64 %index, 1
132 %0 = getelementptr inbounds i32, i32* %a, i64 %index
133 %1 = getelementptr inbounds i32, i32* %a, i64 %induction45
134 %2 = load i32, i32* %0, align 4
135 %3 = load i32, i32* %1, align 4
136 %4 = add nsw i32 %2, 4
137 %5 = add nsw i32 %3, 4
138 %6 = mul nsw i32 %4, 3
139 %7 = mul nsw i32 %5, 3
140 store i32 %6, i32* %0, align 4
141 store i32 %7, i32* %1, align 4
142 %index.next = add i64 %index, 2
143 %8 = icmp eq i64 %index.next, 2048
144 br i1 %8, label %for.end, label %vector.body
146 for.end: ; preds = %vector.body
149 attributes #0 = { nounwind readnone }
150 attributes #1 = { nounwind }
151 attributes #2 = { nounwind minsize}