diff options
author | Cameron McInally <cameron.mcinally@nyu.edu> | 2025-06-10 10:25:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-10 08:25:33 -0600 |
commit | cde1035a2fc6d472168ce6c6e117f16c76c5bbc4 (patch) | |
tree | 1145714cdff89b512fb29245f8199ce4c84dd1be /mlir/lib/Target/LLVMIR/ModuleImport.cpp | |
parent | 326429022ff8c9275c7c49fed095ab1310dabca2 (diff) | |
download | llvm-cde1035a2fc6d472168ce6c6e117f16c76c5bbc4.zip llvm-cde1035a2fc6d472168ce6c6e117f16c76c5bbc4.tar.gz llvm-cde1035a2fc6d472168ce6c6e117f16c76c5bbc4.tar.bz2 |
[flang] Add support for -mrecip[=<list>] (#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 <cmcinally@nvidia.com>
Diffstat (limited to 'mlir/lib/Target/LLVMIR/ModuleImport.cpp')
-rw-r--r-- | mlir/lib/Target/LLVMIR/ModuleImport.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp index 85417da..803ecb39 100644 --- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp @@ -2636,6 +2636,11 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, funcOp.setTargetFeaturesAttr( LLVM::TargetFeaturesAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("reciprocal-estimates"); + attr.isStringAttribute()) + funcOp.setReciprocalEstimatesAttr( + StringAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("prefer-vector-width"); attr.isStringAttribute()) funcOp.setPreferVectorWidth(attr.getValueAsString()); |