From bdc9ff449800079c194d30e919ca74ce15f64284 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Mon, 26 Aug 2013 22:33:26 +0000 Subject: LoopVectorize: Implement partial loop unrolling when vectorization is not profitable. This patch enables unrolling of loops when vectorization is legal but not profitable. We add a new class InnerLoopUnroller, that extends InnerLoopVectorizer and replaces some of the vector-specific logic with scalars. This patch does not introduce any runtime regressions and improves the following workloads: SingleSource/Benchmarks/Shootout/matrix -22.64% SingleSource/Benchmarks/Shootout-C++/matrix -13.06% External/SPEC/CINT2006/464_h264ref/464_h264ref -3.99% SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding -1.95% llvm-svn: 189281 --- llvm/test/Transforms/LoopVectorize/unroll_novec.ll | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 llvm/test/Transforms/LoopVectorize/unroll_novec.ll (limited to 'llvm/test/Transforms') diff --git a/llvm/test/Transforms/LoopVectorize/unroll_novec.ll b/llvm/test/Transforms/LoopVectorize/unroll_novec.ll new file mode 100644 index 00000000000..33f128da905 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/unroll_novec.ll @@ -0,0 +1,39 @@ +; RUN: opt < %s -loop-vectorize -force-vector-width=1 -force-vector-unroll=2 -dce -instcombine -S | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.8.0" + +@a = common global [2048 x i32] zeroinitializer, align 16 + +; This is the loop. +; for (i=0; i