From cde1035a2fc6d472168ce6c6e117f16c76c5bbc4 Mon Sep 17 00:00:00 2001 From: Cameron McInally Date: Tue, 10 Jun 2025 10:25:33 -0400 Subject: [flang] Add support for -mrecip[=] (#143418) This patch adds support for the -mrecip command line option. The parsing of this options is equivalent to Clang's and it is implemented by setting the "reciprocal-estimates" function attribute. Also move the ParseMRecip(...) function to CommonArgs, so that Flang is able to make use of it as well. --------- Co-authored-by: Cameron McInally --- flang/lib/Frontend/CompilerInvocation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 5e156b4..15bcff2 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -307,8 +307,10 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, for (auto *a : args.filtered(clang::driver::options::OPT_fpass_plugin_EQ)) opts.LLVMPassPlugins.push_back(a->getValue()); + opts.Reciprocals = clang::driver::tools::parseMRecipOption(diags, args); + opts.PreferVectorWidth = - clang::driver::tools::ParseMPreferVectorWidthOption(diags, args); + clang::driver::tools::parseMPreferVectorWidthOption(diags, args); // -fembed-offload-object option for (auto *a : -- cgit v1.1