[PATCH] Add fveclib option and add several entries to table of vectorizable functions.

hfinkel at anl.gov hfinkel at anl.gov
Sun Mar 8 14:29:45 PDT 2015


================
Comment at: include/clang/Frontend/CodeGenOptions.def:164
@@ -163,1 +163,3 @@
 
+ENUM_CODEGENOPT(VecLib, VectorLibrary, 1, NoLibrary)
+
----------------
All of the entries here have a descriptive comment above them, please add one here as well.

================
Comment at: include/clang/Frontend/CodeGenOptions.h:51
@@ +50,3 @@
+    NoLibrary,          // Don't use any vector library.
+    Accelerate          // Use Accelerate framework.
+  };
----------------
Use -> Use the

================
Comment at: lib/Frontend/CompilerInvocation.cpp:375
@@ +374,3 @@
+            .Case("Accelerate", CodeGenOptions::Accelerate)
+            .Default(CodeGenOptions::NoLibrary);
+    Opts.setVecLib(VecLib);
----------------
I'd rather we actually validated the value here, instead of just mapping all unknown strings to 'NoLibrary'. I'd rather something like this:

  if (Arg *A = Args.getLastArg(OPT_fveclib)) {
    if (A->getValue() == "Accelerate")
      Opts.setVecLib(CodeGenOptions::Accelerate);
    else if (A->getValue() == "none")
      Opts.setVecLib(CodeGenOptions::NoLibrary);
    else
      Diags.Report(diag::err_drv_invalid_value)
        << A->getAsString(Args) << A->getValue();
  }

http://reviews.llvm.org/D8097

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list