127 lines · plain
1; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s -check-prefixes=CHECK,GENERIC2; RUN: llc -verify-machineinstrs -mcpu=970 < %s | FileCheck %s -check-prefixes=CHECK,PWR3; RUN: llc -verify-machineinstrs -mcpu=a2 < %s | FileCheck %s -check-prefixes=CHECK,BASIC4; RUN: llc -verify-machineinstrs -mcpu=e500mc < %s | FileCheck %s -check-prefixes=CHECK,BASIC5; RUN: llc -verify-machineinstrs -mcpu=e5500 < %s | FileCheck %s -check-prefixes=CHECK,BASIC6; RUN: llc -verify-machineinstrs -mcpu=pwr4 < %s | FileCheck %s -check-prefixes=CHECK,PWR7; RUN: llc -verify-machineinstrs -mcpu=pwr5 < %s | FileCheck %s -check-prefixes=CHECK,PWR8; RUN: llc -verify-machineinstrs -mcpu=pwr5x < %s | FileCheck %s -check-prefixes=CHECK,PWR9; RUN: llc -verify-machineinstrs -mcpu=pwr6 < %s | FileCheck %s -check-prefixes=CHECK,PWR10; RUN: llc -verify-machineinstrs -mcpu=pwr6x < %s | FileCheck %s -check-prefixes=CHECK,PWR11; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s -check-prefixes=CHECK,PWR12; RUN: llc -verify-machineinstrs -mcpu=pwr8 < %s | FileCheck %s -check-prefixes=CHECK,PWR13target datalayout = "E-m:e-i64:64-n32:64"14target triple = "powerpc64-unknown-linux-gnu"15 16; Function Attrs: nounwind readnone17define signext i32 @foo(i32 signext %x) #0 {18entry:19 %mul = shl nsw i32 %x, 120 ret i32 %mul21 22; CHECK-LABEL: .globl foo23; GENERIC: .p2align 224; BASIC: .p2align 425; PWR: .p2align 426; CHECK: @foo27}28 29; Function Attrs: nounwind30define void @loop(i32 signext %x, ptr nocapture %a) #1 {31entry:32 br label %vector.body33 34; CHECK-LABEL: @loop35; CHECK: mtctr36; GENERIC-NOT: .p2align37; BASIC: .p2align 438; PWR: .p2align 439; CHECK: lwzu40; CHECK: bdnz41 42vector.body: ; preds = %vector.body, %entry43 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]44 %induction45 = or i64 %index, 145 %0 = getelementptr inbounds i32, ptr %a, i64 %index46 %1 = getelementptr inbounds i32, ptr %a, i64 %induction4547 %2 = load i32, ptr %0, align 448 %3 = load i32, ptr %1, align 449 %4 = add nsw i32 %2, 450 %5 = add nsw i32 %3, 451 %6 = mul nsw i32 %4, 352 %7 = mul nsw i32 %5, 353 store i32 %6, ptr %0, align 454 store i32 %7, ptr %1, align 455 %index.next = add i64 %index, 256 %8 = icmp eq i64 %index.next, 204857 br i1 %8, label %for.end, label %vector.body58 59for.end: ; preds = %vector.body60 ret void61}62 63; Function Attrs: nounwind64define void @sloop(i32 signext %x, ptr nocapture %a) #1 {65entry:66 br label %for.body67 68; CHECK-LABEL: @sloop69; CHECK: mtctr70; GENERIC-NOT: .p2align71; BASIC: .p2align 472; PWR: .p2align 573; CHECK: bdnz74 75for.body: ; preds = %for.body, %entry76 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]77 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv78 %0 = load i32, ptr %arrayidx, align 479 %add = add nsw i32 %0, 480 %mul = mul nsw i32 %add, 381 store i32 %mul, ptr %arrayidx, align 482 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 183 %exitcond = icmp eq i64 %indvars.iv.next, 204884 br i1 %exitcond, label %for.end, label %for.body85 86for.end: ; preds = %for.body87 ret void88}89 90; Function Attrs: nounwind91define void @test_minsize(i32 signext %x, ptr nocapture %a) #2 {92entry:93 br label %vector.body94 95; CHECK-LABEL: @test_minsize96; CHECK: mtctr97; GENERIC-NOT: .p2align98; BASIC-NOT: .p2align99; PWR-NOT: .p2align100; CHECK: lwzu101; CHECK: bdnz102 103vector.body: ; preds = %vector.body, %entry104 %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]105 %induction45 = or i64 %index, 1106 %0 = getelementptr inbounds i32, ptr %a, i64 %index107 %1 = getelementptr inbounds i32, ptr %a, i64 %induction45108 %2 = load i32, ptr %0, align 4109 %3 = load i32, ptr %1, align 4110 %4 = add nsw i32 %2, 4111 %5 = add nsw i32 %3, 4112 %6 = mul nsw i32 %4, 3113 %7 = mul nsw i32 %5, 3114 store i32 %6, ptr %0, align 4115 store i32 %7, ptr %1, align 4116 %index.next = add i64 %index, 2117 %8 = icmp eq i64 %index.next, 2048118 br i1 %8, label %for.end, label %vector.body119 120for.end: ; preds = %vector.body121 ret void122}123attributes #0 = { nounwind readnone }124attributes #1 = { nounwind }125attributes #2 = { nounwind minsize}126 127