[dragonegg] r182654 - Enable the loop vectorizer.
Duncan Sands
baldrick at free.fr
Fri May 24 10:12:18 PDT 2013
Author: baldrick
Date: Fri May 24 12:12:17 2013
New Revision: 182654
URL: http://llvm.org/viewvc/llvm-project?rev=182654&view=rev
Log:
Enable the loop vectorizer.
Added:
dragonegg/trunk/test/validator/c/vectorizer.c
Modified:
dragonegg/trunk/src/Backend.cpp
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=182654&r1=182653&r2=182654&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Fri May 24 12:12:17 2013
@@ -661,12 +661,11 @@ static void InitializeBackend(void) {
// Configure the pass builder.
PassBuilder.SizeLevel = optimize_size;
PassBuilder.DisableSimplifyLibCalls = flag_no_simplify_libcalls;
- PassBuilder.DisableUnrollLoops = !flag_unroll_loops;
PassBuilder.DisableUnitAtATime = !flag_unit_at_a_time;
- // FIXME: Hack around the fact the we initialize PassBuilder before processing
- // command line arguments. The following makes it possible to enable the LLVM
- // vectorizer using -fplugin-arg-dragonegg-llvm-option=-vectorize
- PassBuilder.SLPVectorize = PassManagerBuilder().SLPVectorize;
+ PassBuilder.DisableUnrollLoops = !flag_unroll_loops;
+// Don't turn on the SLP vectorizer by default at -O3 for the moment.
+// PassBuilder.SLPVectorize = flag_tree_slp_vectorize;
+ PassBuilder.LoopVectorize = flag_tree_vectorize;
PassBuilder.LibraryInfo =
new TargetLibraryInfo((Triple) TheModule->getTargetTriple());
Added: dragonegg/trunk/test/validator/c/vectorizer.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/validator/c/vectorizer.c?rev=182654&view=auto
==============================================================================
--- dragonegg/trunk/test/validator/c/vectorizer.c (added)
+++ dragonegg/trunk/test/validator/c/vectorizer.c Fri May 24 12:12:17 2013
@@ -0,0 +1,10 @@
+// RUN: %dragonegg -S %s -o - -O3 | FileCheck -check-prefix=VON %s
+// RUN: %dragonegg -S %s -o - -O3 -fno-tree-vectorize | FileCheck -check-prefix=VOFF %s
+// VON: fadd <
+// VOFF-NOT: fadd <
+
+void bar(float *A, float* B, float K) {
+ int i;
+ for (i = 0; i < 64; ++i)
+ A[i] *= B[i] + K;
+}
More information about the llvm-commits
mailing list