1 ; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s -check-prefixes=CHECK,GENERIC
2 ; RUN: llc -verify-machineinstrs -mcpu=970 < %s | FileCheck %s -check-prefixes=CHECK,PWR
3 ; RUN: llc -verify-machineinstrs -mcpu=a2 < %s | FileCheck %s -check-prefixes=CHECK,BASIC
4 ; RUN: llc -verify-machineinstrs -mcpu=e500mc < %s | FileCheck %s -check-prefixes=CHECK,BASIC
5 ; RUN: llc -verify-machineinstrs -mcpu=e5500 < %s | FileCheck %s -check-prefixes=CHECK,BASIC
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 < %s | FileCheck %s -check-prefixes=CHECK,PWR
7 ; RUN: llc -verify-machineinstrs -mcpu=pwr5 < %s | FileCheck %s -check-prefixes=CHECK,PWR
8 ; RUN: llc -verify-machineinstrs -mcpu=pwr5x < %s | FileCheck %s -check-prefixes=CHECK,PWR
9 ; RUN: llc -verify-machineinstrs -mcpu=pwr6 < %s | FileCheck %s -check-prefixes=CHECK,PWR
10 ; RUN: llc -verify-machineinstrs -mcpu=pwr6x < %s | FileCheck %s -check-prefixes=CHECK,PWR
11 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s -check-prefixes=CHECK,PWR
12 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 < %s | FileCheck %s -check-prefixes=CHECK,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 ; CHECK-LABEL: .globl foo
29 ; Function Attrs: nounwind
30 define void @loop(i32 signext %x, ptr nocapture %a) #1 {
36 ; GENERIC-NOT: .p2align
42 vector.body: ; preds = %vector.body, %entry
43 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
44 %induction45 = or i64 %index, 1
45 %0 = getelementptr inbounds i32, ptr %a, i64 %index
46 %1 = getelementptr inbounds i32, ptr %a, i64 %induction45
47 %2 = load i32, ptr %0, align 4
48 %3 = load i32, ptr %1, align 4
49 %4 = add nsw i32 %2, 4
50 %5 = add nsw i32 %3, 4
51 %6 = mul nsw i32 %4, 3
52 %7 = mul nsw i32 %5, 3
53 store i32 %6, ptr %0, align 4
54 store i32 %7, ptr %1, align 4
55 %index.next = add i64 %index, 2
56 %8 = icmp eq i64 %index.next, 2048
57 br i1 %8, label %for.end, label %vector.body
59 for.end: ; preds = %vector.body
63 ; Function Attrs: nounwind
64 define void @sloop(i32 signext %x, ptr nocapture %a) #1 {
70 ; GENERIC-NOT: .p2align
75 for.body: ; preds = %for.body, %entry
76 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
77 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
78 %0 = load i32, ptr %arrayidx, align 4
79 %add = add nsw i32 %0, 4
80 %mul = mul nsw i32 %add, 3
81 store i32 %mul, ptr %arrayidx, align 4
82 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
83 %exitcond = icmp eq i64 %indvars.iv.next, 2048
84 br i1 %exitcond, label %for.end, label %for.body
86 for.end: ; preds = %for.body
90 ; Function Attrs: nounwind
91 define void @test_minsize(i32 signext %x, ptr nocapture %a) #2 {
95 ; CHECK-LABEL: @test_minsize
97 ; GENERIC-NOT: .p2align
103 vector.body: ; preds = %vector.body, %entry
104 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
105 %induction45 = or i64 %index, 1
106 %0 = getelementptr inbounds i32, ptr %a, i64 %index
107 %1 = getelementptr inbounds i32, ptr %a, i64 %induction45
108 %2 = load i32, ptr %0, align 4
109 %3 = load i32, ptr %1, align 4
110 %4 = add nsw i32 %2, 4
111 %5 = add nsw i32 %3, 4
112 %6 = mul nsw i32 %4, 3
113 %7 = mul nsw i32 %5, 3
114 store i32 %6, ptr %0, align 4
115 store i32 %7, ptr %1, align 4
116 %index.next = add i64 %index, 2
117 %8 = icmp eq i64 %index.next, 2048
118 br i1 %8, label %for.end, label %vector.body
120 for.end: ; preds = %vector.body
123 attributes #0 = { nounwind readnone }
124 attributes #1 = { nounwind }
125 attributes #2 = { nounwind minsize}