diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-05-03 02:26:10 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-05-03 02:26:10 +0000 |
commit | 6a288c1e32351d4be3b7630841af078fa1c3bb8b (patch) | |
tree | 0d45bf1100f1f03afd603778cf5173969da8cc33 /llvm/lib/Transforms/Utils/BuildLibCalls.cpp | |
parent | 8955efc36ff1d051f0d97f69ed2db9c4e79e8325 (diff) | |
download | bcm5719-llvm-6a288c1e32351d4be3b7630841af078fa1c3bb8b.tar.gz bcm5719-llvm-6a288c1e32351d4be3b7630841af078fa1c3bb8b.zip |
Replace hardcoded intrinsic list with speculatable attribute.
No change in which intrinsics should be speculated.
llvm-svn: 301995
Diffstat (limited to 'llvm/lib/Transforms/Utils/BuildLibCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp index 6cd9f161499..c9884c750ae 100644 --- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp @@ -889,7 +889,13 @@ Value *llvm::emitUnaryFloatFnCall(Value *Op, StringRef Name, IRBuilder<> &B, Value *Callee = M->getOrInsertFunction(Name, Op->getType(), Op->getType()); CallInst *CI = B.CreateCall(Callee, Op, Name); - CI->setAttributes(Attrs); + + // The incoming attribute set may have come from a speculatable intrinsic, but + // is being replaced with a library call which is not allowed to be + // speculatable. + CI->setAttributes(Attrs.removeAttribute(B.getContext(), + AttributeList::FunctionIndex, + Attribute::Speculatable)); if (const Function *F = dyn_cast<Function>(Callee->stripPointerCasts())) CI->setCallingConv(F->getCallingConv()); |