summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-11-06 23:55:38 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-11-06 23:55:38 +0000
commit5cfcce12eb0446db614ae3f213f9c02ed4aa87a3 (patch)
tree1f4b89a02b6964f005f6fbc5e724620c72c3db3a /llvm/lib/Bitcode
parent6e680b2be7e2af65fa054a61133f4930844975a4 (diff)
downloadbcm5719-llvm-5cfcce12eb0446db614ae3f213f9c02ed4aa87a3.tar.gz
bcm5719-llvm-5cfcce12eb0446db614ae3f213f9c02ed4aa87a3.zip
Add 'notail' marker for call instructions.
This marker prevents optimization passes from adding 'tail' or 'musttail' markers to a call. Is is used to prevent tail call optimization from being performed on the call. rdar://problem/22667622 Differential Revision: http://reviews.llvm.org/D12923 llvm-svn: 252368
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index bc846192fcf..a0029b26ff9 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5002,6 +5002,8 @@ std::error_code BitcodeReader::parseFunctionBody(Function *F) {
TCK = CallInst::TCK_Tail;
if (CCInfo & (1 << 14))
TCK = CallInst::TCK_MustTail;
+ if (CCInfo & (1 << 16))
+ TCK = CallInst::TCK_NoTail;
cast<CallInst>(I)->setTailCallKind(TCK);
cast<CallInst>(I)->setAttributes(PAL);
break;
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 941e54765f5..b88e55c92cb 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2131,7 +2131,8 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
Vals.push_back(VE.getAttributeID(CI.getAttributes()));
Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()) |
- unsigned(CI.isMustTailCall()) << 14 | 1 << 15);
+ unsigned(CI.isMustTailCall()) << 14 | 1 << 15 |
+ unsigned(CI.isNoTailCall()) << 16);
Vals.push_back(VE.getTypeID(FTy));
PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee
OpenPOWER on IntegriCloud