summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2016-08-09 20:10:18 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2016-08-09 20:10:18 +0000
commitffb60901fe088950c7683e20e7c9b198695cdddc (patch)
tree3e6028336673179653aa830c2d106d65fd1ba44b /clang/lib/CodeGen/CGCall.cpp
parentb61346b8b0804adcf7b08326fcb026e24a4d3ba9 (diff)
downloadbcm5719-llvm-ffb60901fe088950c7683e20e7c9b198695cdddc.tar.gz
bcm5719-llvm-ffb60901fe088950c7683e20e7c9b198695cdddc.zip
[OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrt
Let the driver pass the option to frontend. Do not set precision metadata for division instructions when this option is set. Set function attribute "correctly-rounded-divide-sqrt-fp-math" based on this option. Differential Revision: https://reviews.llvm.org/D22940 llvm-svn: 278155
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 242b5962070..fdd83ea2720 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1734,6 +1734,9 @@ void CodeGenModule::ConstructAttributeList(
llvm::utostr(CodeGenOpts.SSPBufferSize));
FuncAttrs.addAttribute("no-signed-zeros-fp-math",
llvm::toStringRef(CodeGenOpts.NoSignedZeros));
+ FuncAttrs.addAttribute(
+ "correctly-rounded-divide-sqrt-fp-math",
+ llvm::toStringRef(CodeGenOpts.CorrectlyRoundedDivSqrt));
if (CodeGenOpts.StackRealignment)
FuncAttrs.addAttribute("stackrealign");
OpenPOWER on IntegriCloud