[PATCH] D82756: Port some floating point options to new option marshalling infrastructure

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 09:46:46 PDT 2020


Anastasia added inline comments.


================
Comment at: clang/test/CodeGen/fp-function-attrs.cpp:2
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -ffast-math -ffinite-math-only -menable-unsafe-fp-math \
+// RUN:   -menable-no-infs -menable-no-nans -fno-signed-zeros -freciprocal-math \
+// RUN:   -fapprox-func -mreassociate -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s
----------------
dang wrote:
> Anastasia wrote:
> > Not clear why do you need to pass these extra flags now?
> Previously passing -ffast-math to CC1 implied all these other flags. I am trying to make CC1 option parsing as simple as possible, so that we can then make it easy to generate a command line from a CompilerInvocation instance. You can refer to [[ http://lists.llvm.org/pipermail/cfe-dev/2020-May/065421.html | http://lists.llvm.org/pipermail/cfe-dev/2020-May/065421.html ]] for more details on why we want to be able to do this
Just to understand, there used to be implied flags and it made the manual command line use of clang more compact and easy... Is the idea now to change those compound flags such that individul flags always need to be passed?

Although I thought you are still adding the implicit flags:

          {options::OPT_cl_fast_relaxed_math,
           [&](const Arg *Arg) {
             RenderArg(Arg);

             CmdArgs.push_back(GetArgString(options::OPT_cl_mad_enable));
             CmdArgs.push_back(GetArgString(options::OPT_ffast_math));
             CmdArgs.push_back(GetArgString(options::OPT_ffinite_math_only));
             CmdArgs.push_back(
                 GetArgString(options::OPT_menable_unsafe_fp_math));
             CmdArgs.push_back(GetArgString(options::OPT_mreassociate));
             CmdArgs.push_back(GetArgString(options::OPT_menable_no_nans));
             CmdArgs.push_back(
                 GetArgString(options::OPT_menable_no_infinities));
             CmdArgs.push_back(GetArgString(options::OPT_fno_signed_zeros));
             CmdArgs.push_back(GetArgString(options::OPT_freciprocal_math));
             CmdArgs.push_back(GetArgString(options::OPT_fapprox_func));
           }}

Do I just misunderstand something?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82756/new/

https://reviews.llvm.org/D82756





More information about the cfe-commits mailing list