aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Bendersky <eliben@chromium.org>2013-06-27 14:49:34 -0700
committerEli Bendersky <eliben@chromium.org>2013-06-27 14:49:34 -0700
commit192dd614d8d7291768f808bbd6ad8f1a98d62c57 (patch)
tree69fea5c2e220fac8ca55b8bdd4704fe30a92c546 /lib
parent8f0218fcec810b1178a0515843aceef43a339869 (diff)
Clang should not generate calls to llvm.pow.* intrinsics.
Instead, it should generate calls to the pow* library functions, which get found within the pexe. This is a LOCALMOD for now, but I'm working on a more generic solution that can be upstreamed to Clang. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3513 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/18135002
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGBuiltin.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 9e09131a53..7f1709e10f 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -1293,14 +1293,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
case Builtin::BIpow:
case Builtin::BIpowf:
case Builtin::BIpowl: {
- // Rewrite sqrt to intrinsic if allowed.
- if (!FD->hasAttr<ConstAttr>())
- break;
- Value *Base = EmitScalarExpr(E->getArg(0));
- Value *Exponent = EmitScalarExpr(E->getArg(1));
- llvm::Type *ArgType = Base->getType();
- Value *F = CGM.getIntrinsic(Intrinsic::pow, ArgType);
- return RValue::get(Builder.CreateCall2(F, Base, Exponent));
+ // LOCALMOD: For PNACl we don't want pow* calls to ever turn into
+ // intrinsics. We want them to be resolved vs. the newlib implementation
+ // within the pexe during bitcode linking.
+ // TODO(eliben): upstream this
+ break;
}
case Builtin::BIfma: