52 lines · plain
1; RUN: opt -module-summary %s -o %t1.bc2 3; Test SLP and Loop Vectorization are enabled by default at O2 and O3.4; RUN: llvm-lto2 run %t1.bc -o %t2.o -O0 -r %t1.bc,foo,plx -debug-pass-manager \5; RUN: -save-temps 2>&1 | FileCheck %s --check-prefix=CHECK-O0-SLP6; RUN: llvm-dis %t2.o.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O0-LPV7 8; RUN: llvm-lto2 run %t1.bc -o %t3.o -O1 -r %t1.bc,foo,plx -debug-pass-manager \9; RUN: -save-temps 2>&1 | FileCheck %s --check-prefix=CHECK-O1-SLP10; RUN: llvm-dis %t3.o.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O1-LPV11 12; RUN: llvm-lto2 run %t1.bc -o %t4.o -O2 -r %t1.bc,foo,plx -debug-pass-manager \13; RUN: -save-temps 2>&1 | FileCheck %s --check-prefix=CHECK-O2-SLP14; RUN: llvm-dis %t4.o.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O2-LPV15 16; RUN: llvm-lto2 run %t1.bc -o %t5.o -O3 -r %t1.bc,foo,plx -debug-pass-manager \17; RUN: -save-temps 2>&1 | FileCheck %s --check-prefix=CHECK-O3-SLP18; RUN: llvm-dis %t5.o.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O3-LPV19 20; CHECK-O0-SLP-NOT: Running pass: SLPVectorizerPass21; CHECK-O1-SLP-NOT: Running pass: SLPVectorizerPass22; CHECK-O2-SLP: Running pass: SLPVectorizerPass23; CHECK-O3-SLP: Running pass: SLPVectorizerPass24; CHECK-O0-LPV-NOT: = !{!"llvm.loop.isvectorized", i32 1}25; CHECK-O1-LPV-NOT: = !{!"llvm.loop.isvectorized", i32 1}26; CHECK-O2-LPV: = !{!"llvm.loop.isvectorized", i32 1}27; CHECK-O3-LPV: = !{!"llvm.loop.isvectorized", i32 1}28 29target datalayout = "e-m:e-i64:64-i128:128-f80:128-n8:16:32:64-S128"30target triple = "x86_64-unknown-linux-gnu"31 32define i32 @foo(ptr %a) {33entry:34 br label %for.body35 36for.body:37 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]38 %red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]39 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv40 %0 = load i32, ptr %arrayidx, align 441 %add = add nsw i32 %0, %red.0542 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 143 %exitcond = icmp eq i64 %indvars.iv.next, 25544 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !045 46for.end:47 ret i32 %add48}49 50!0 = distinct !{!0, !1}51!1 = !{!"llvm.loop.unroll.disable", i1 true}52