40 lines · plain
1; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s2target datalayout = "E-m:e-i64:64-n32:64"3target triple = "powerpc64-unknown-linux-gnu"4 5@phasor = external constant [4096 x i32]6 7; Function Attrs: nounwind8define void @test(ptr nocapture %out, i32 zeroext %step_size) #0 {9entry:10 %shl = shl i32 %step_size, 211 %idxprom = zext i32 %shl to i6412 br label %for.body13 14; Make sure that the TOC load has been hoisted out of the loop.15; CHECK-LABEL: @test16; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc@l17; CHECK: %for.body18; CHECK: blr19 20for.body: ; preds = %entry, %for.body21 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]22 %0 = trunc i64 %indvars.iv to i3223 %shl1 = shl i32 %0, %step_size24 %idxprom2 = sext i32 %shl1 to i6425 %arrayidx.sum = add nsw i64 %idxprom2, %idxprom26 %arrayidx3 = getelementptr inbounds [4096 x i32], ptr @phasor, i64 0, i64 %arrayidx.sum27 %1 = load i32, ptr %arrayidx3, align 428 %arrayidx5 = getelementptr inbounds i32, ptr %out, i64 %indvars.iv29 store i32 %1, ptr %arrayidx5, align 430 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 431 %cmp = icmp slt i64 %indvars.iv.next, 102032 br i1 %cmp, label %for.body, label %for.end33 34for.end: ; preds = %for.body35 ret void36}37 38attributes #0 = { nounwind }39 40