59 lines · plain
1; RUN: opt -S -passes=inline < %s | FileCheck %s2; RUN: opt -S -passes='cgscc(inline)' < %s | FileCheck %s3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6; Function Attrs: norecurse nounwind uwtable7define void @Body(ptr nocapture %res, ptr nocapture readnone %c, ptr nocapture readonly %d, ptr nocapture readonly %p, i32 %i) #0 {8entry:9 %idxprom = sext i32 %i to i6410 %arrayidx = getelementptr inbounds i32, ptr %p, i64 %idxprom11 %0 = load i32, ptr %arrayidx, align 412 %cmp = icmp eq i32 %0, 013 %arrayidx2 = getelementptr inbounds i32, ptr %res, i64 %idxprom14 %1 = load i32, ptr %arrayidx2, align 415 br i1 %cmp, label %cond.end, label %cond.false16 17cond.false: ; preds = %entry18 %arrayidx6 = getelementptr inbounds i32, ptr %d, i64 %idxprom19 %2 = load i32, ptr %arrayidx6, align 420 %add = add nsw i32 %2, %121 br label %cond.end22 23cond.end: ; preds = %entry, %cond.false24 %cond = phi i32 [ %add, %cond.false ], [ %1, %entry ]25 store i32 %cond, ptr %arrayidx2, align 426 ret void27}28 29; Function Attrs: nounwind uwtable30define void @Test(ptr %res, ptr %c, ptr %d, ptr %p, i32 %n) #1 {31entry:32 br label %for.cond33 34for.cond: ; preds = %for.body, %entry35 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]36 %cmp = icmp slt i32 %i.0, 160037 br i1 %cmp, label %for.body, label %for.end38 39for.body: ; preds = %for.cond40 call void @Body(ptr %res, ptr undef, ptr %d, ptr %p, i32 %i.0), !llvm.access.group !041 %inc = add nsw i32 %i.0, 142 br label %for.cond, !llvm.loop !143 44for.end: ; preds = %for.cond45 ret void46}47 48; CHECK-LABEL: @Test49; CHECK: load i32,{{.*}}, !llvm.access.group !050; CHECK: load i32,{{.*}}, !llvm.access.group !051; CHECK: load i32,{{.*}}, !llvm.access.group !052; CHECK: store i32{{.*}}, !llvm.access.group !053; CHECK: br label %for.cond, !llvm.loop !154 55attributes #0 = { norecurse nounwind uwtable }56 57!0 = distinct !{}58!1 = distinct !{!0, !{!"llvm.loop.parallel_accesses", !0}}59