r187633 - Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3."

Rafael Espindola rafael.espindola at gmail.com
Thu Aug 1 16:56:42 PDT 2013


Author: rafael
Date: Thu Aug  1 18:56:42 2013
New Revision: 187633

URL: http://llvm.org/viewvc/llvm-project?rev=187633&view=rev
Log:
Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3."

This reverts commit r187630.

Looks like it is breaking the bots.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=187633&r1=187632&r2=187633&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Aug  1 18:56:42 2013
@@ -1974,12 +1974,6 @@ static bool isOptimizationLevelFast(cons
   return false;
 }
 
-static bool isOptimizationLevel3(const ArgList &Args) {
-  if (Arg *A = Args.getLastArg(options::OPT_O_Group))
-    return StringRef(A->getValue()).equals("3");
-  return false;
-}
-
 void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                          const InputInfo &Output,
                          const InputInfoList &Inputs,
@@ -3458,17 +3452,9 @@ void Clang::ConstructJob(Compilation &C,
                    options::OPT_fno_vectorize, true))
     CmdArgs.push_back("-vectorize-loops");
 
-  bool EnableSLP = false;
-  // If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection.
-  if (Arg *A = Args.getLastArg(options::OPT_fslp_vectorize,
-                      options::OPT_fno_slp_vectorize)) {
-    EnableSLP = A->getOption().matches(options::OPT_fslp_vectorize);
-  } else {
-    // Also enable SLP vectorization on O3 or OFast
-    EnableSLP = isOptimizationLevel3(Args) || isOptimizationLevelFast(Args);
-  }
-
-  if (EnableSLP)
+  // -fslp-vectorize is default.
+  if (Args.hasFlag(options::OPT_fslp_vectorize,
+                   options::OPT_fno_slp_vectorize, true))
     CmdArgs.push_back("-vectorize-slp");
 
   // -fno-slp-vectorize-aggressive is default.





More information about the cfe-commits mailing list