[dragonegg] r182833 - Port enabling of loop vectorization and fast math from mainline.

Duncan Sands baldrick at free.fr
Wed May 29 01:09:04 PDT 2013


Author: baldrick
Date: Wed May 29 03:09:04 2013
New Revision: 182833

URL: http://llvm.org/viewvc/llvm-project?rev=182833&view=rev
Log:
Port enabling of loop vectorization and fast math from mainline.

Added:
    dragonegg/branches/release_33/test/validator/c/fast-math.c
      - copied unchanged from r182663, dragonegg/trunk/test/validator/c/fast-math.c
    dragonegg/branches/release_33/test/validator/c/vectorizer.c
      - copied unchanged from r182654, dragonegg/trunk/test/validator/c/vectorizer.c
Modified:
    dragonegg/branches/release_33/   (props changed)
    dragonegg/branches/release_33/src/Backend.cpp
    dragonegg/branches/release_33/src/Convert.cpp
    dragonegg/branches/release_33/test/compilator/compilator-lit.cfg

Propchange: dragonegg/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 29 03:09:04 2013
@@ -1 +1 @@
-/dragonegg/trunk:181689-182277,182565,182591
+/dragonegg/trunk:181689-182277,182565,182591,182654,182663

Modified: dragonegg/branches/release_33/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/Backend.cpp?rev=182833&r1=182832&r2=182833&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/Backend.cpp (original)
+++ dragonegg/branches/release_33/src/Backend.cpp Wed May 29 03:09:04 2013
@@ -643,12 +643,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());

Modified: dragonegg/branches/release_33/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/Convert.cpp?rev=182833&r1=182832&r2=182833&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/Convert.cpp (original)
+++ dragonegg/branches/release_33/src/Convert.cpp Wed May 29 03:09:04 2013
@@ -1639,6 +1639,19 @@ void TreeToLLVM::EmitBasicBlock(basic_bl
 }
 
 Function *TreeToLLVM::EmitFunction() {
+  FastMathFlags FMF;
+  if (flag_finite_math_only) {
+    FMF.setNoInfs();
+    FMF.setNoNaNs();
+  }
+  if (!flag_signed_zeros)
+    FMF.setNoSignedZeros();
+  if (flag_reciprocal_math)
+    FMF.setAllowReciprocal();
+  if (flag_unsafe_math_optimizations && flag_finite_math_only)
+    FMF.setUnsafeAlgebra();
+  Builder.SetFastMathFlags(FMF);
+
   // Set up parameters and prepare for return, for the function.
   StartFunctionBody();
 

Modified: dragonegg/branches/release_33/test/compilator/compilator-lit.cfg
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/test/compilator/compilator-lit.cfg?rev=182833&r1=182832&r2=182833&view=diff
==============================================================================
--- dragonegg/branches/release_33/test/compilator/compilator-lit.cfg (original)
+++ dragonegg/branches/release_33/test/compilator/compilator-lit.cfg Wed May 29 03:09:04 2013
@@ -39,8 +39,8 @@ def addMutuallyExclusiveFlags(flags):
 addMutuallyExclusiveFlags([None, '-O1', '-O2', '-O3'])
 # The following are not mutually exclusive, but pretending they are speeds up
 # testing.  Doing this fails to catch tests that pass with -g and also with
-# -march=native but fail with -g -march=native.  Do such tests even exist?
-addMutuallyExclusiveFlags([None, '-g', '-march=native'])
+# -march=native but fail with -g -march=native etc.
+addMutuallyExclusiveFlags([None, '-g', '-march=native', '-ffast-math'])
 
 config.skip = [
     'gcc-testsuite/g++.dg/eh/cleanup1.C', # PR11811





More information about the llvm-commits mailing list