diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-07-10 08:54:29 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-07-10 08:54:29 -0700 |
commit | f69ebb4201da8bb5045f9335150ed6ef6bcfc2cc (patch) | |
tree | 6d0ef75997255e633806335ddf7e8647dbcd5459 /lib/CodeGen/TargetInfo.cpp | |
parent | 3ae70608405cf8180c89f8d3393049b4acd58104 (diff) |
Cherry-picking the pow-for-le32 fix from upstream clang.
SVN log from upstream clang:
r185568 | eliben | 2013-07-03 12:19:12 -0700 (Wed, 03 Jul 2013)
Add target hook CodeGen queries when generating builtin pow*.
Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics
when it sees pow*(). This may not be suitable for all targets (for
example le32/PNaCl), so the attached patch adds a target hook that CodeGen
queries. The target can state its preference for having or not having the
intrinsic generated. Non-PNaCl behavior remains unchanged;
PNaCl-specific test added.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3513
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/18953003
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index b870ae9eb1..6ca2910d79 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -416,6 +416,10 @@ class PNaClTargetCodeGenInfo : public TargetCodeGenInfo { public: PNaClTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT) : TargetCodeGenInfo(new PNaClABIInfo(CGT)) {} + + /// For PNaCl we don't want llvm.pow.* intrinsics to be emitted instead + /// of library function calls. + bool emitIntrinsicForPow() const { return false; } }; void PNaClABIInfo::computeInfo(CGFunctionInfo &FI) const { |