brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · e0ba47c Raw
80 lines · plain
1; RUN: opt -module-summary %s -o %t.o2 3; Test SLP and Loop Vectorization are enabled by default at O2 and O3.4; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \5; RUN:     --plugin-opt=thinlto \6; RUN:     --plugin-opt=new-pass-manager \7; RUN:     --plugin-opt=debug-pass-manager \8; RUN:     --plugin-opt=cache-dir=%t.cache \9; RUN:     --plugin-opt=O0 \10; RUN:     --plugin-opt=save-temps \11; RUN:     -shared \12; RUN:     -o %t2.o %t.o 2>&1 | FileCheck %s --check-prefix=CHECK-O0-SLP13; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O0-LPV14 15; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \16; RUN:     --plugin-opt=thinlto \17; RUN:     --plugin-opt=new-pass-manager \18; RUN:     --plugin-opt=debug-pass-manager \19; RUN:     --plugin-opt=cache-dir=%t.cache \20; RUN:     --plugin-opt=O1 \21; RUN:     --plugin-opt=save-temps \22; RUN:     -shared \23; RUN:     -o %t3.o %t.o 2>&1 | FileCheck %s --check-prefix=CHECK-O1-SLP24; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O1-LPV25 26; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \27; RUN:     --plugin-opt=thinlto \28; RUN:     --plugin-opt=new-pass-manager \29; RUN:     --plugin-opt=debug-pass-manager \30; RUN:     --plugin-opt=cache-dir=%t.cache \31; RUN:     --plugin-opt=O2 \32; RUN:     --plugin-opt=save-temps \33; RUN:     -shared \34; RUN:     -o %t4.o %t.o 2>&1 | FileCheck %s --check-prefix=CHECK-O2-SLP35; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O2-LPV36 37; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \38; RUN:     --plugin-opt=thinlto \39; RUN:     --plugin-opt=new-pass-manager \40; RUN:     --plugin-opt=debug-pass-manager \41; RUN:     --plugin-opt=cache-dir=%t.cache \42; RUN:     --plugin-opt=O3 \43; RUN:     --plugin-opt=save-temps \44; RUN:     -shared \45; RUN:     -o %t5.o %t.o 2>&1 | FileCheck %s --check-prefix=CHECK-O3-SLP46; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-O3-LPV47 48; CHECK-O0-SLP-NOT: Running pass: SLPVectorizerPass49; CHECK-O1-SLP-NOT: Running pass: SLPVectorizerPass50; CHECK-O2-SLP: Running pass: SLPVectorizerPass51; CHECK-O3-SLP: Running pass: SLPVectorizerPass52; CHECK-O0-LPV-NOT: = !{!"llvm.loop.isvectorized", i32 1}53; CHECK-O1-LPV-NOT: = !{!"llvm.loop.isvectorized", i32 1}54; CHECK-O2-LPV: = !{!"llvm.loop.isvectorized", i32 1}55; CHECK-O3-LPV: = !{!"llvm.loop.isvectorized", i32 1}56 57target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"58target triple = "x86_64-unknown-linux-gnu"59 60define i32 @foo(ptr %a) {61entry:62  br label %for.body63 64for.body:65  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]66  %red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]67  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv68  %0 = load i32, ptr %arrayidx, align 469  %add = add nsw i32 %0, %red.0570  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 171  %exitcond = icmp eq i64 %indvars.iv.next, 25572  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !073 74for.end:75  ret i32 %add76}77 78!0 = distinct !{!0, !1}79!1 = !{!"llvm.loop.unroll.disable", i1 true}80