summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.h
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2013-07-03 19:19:12 +0000
committerEli Bendersky <eliben@google.com>2013-07-03 19:19:12 +0000
commit9b64ec18c10231d9890fe5f937384ab4756ac84d (patch)
treefd2de983118f7f67abe4d8ff363dfeb976342c6e /clang/lib/CodeGen/TargetInfo.h
parent7a433802cfc33ed6edc63d59284d4a4022cf4656 (diff)
downloadbcm5719-llvm-9b64ec18c10231d9890fe5f937384ab4756ac84d.tar.gz
bcm5719-llvm-9b64ec18c10231d9890fe5f937384ab4756ac84d.zip
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. llvm-svn: 185568
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.h')
-rw-r--r--clang/lib/CodeGen/TargetInfo.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h
index a7fb88649a3..1be7f4dfa45 100644
--- a/clang/lib/CodeGen/TargetInfo.h
+++ b/clang/lib/CodeGen/TargetInfo.h
@@ -74,6 +74,10 @@ namespace clang {
/// through such registers.
virtual bool extendPointerWithSExt() const { return false; }
+ /// Controls whether BIpow* emit an intrinsic call instead of a library
+ /// function call.
+ virtual bool emitIntrinsicForPow() const { return true; }
+
/// Determines the DWARF register number for the stack pointer, for
/// exception-handling purposes. Implements __builtin_dwarf_sp_column.
///
OpenPOWER on IntegriCloud