diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-04-24 20:14:34 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-04-24 20:14:34 +0000 |
commit | 5772b77789728e045ccd8c93d79820632e81c4e6 (patch) | |
tree | 6f4029a3081e1f1e6a0f9e9576737c5506e59bd1 /llvm/lib/Bitcode/Writer | |
parent | 0fbb1e91e57829d277bbea3ef1402ee7bc871dea (diff) | |
download | bcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.tar.gz bcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.zip |
Add 'musttail' marker to call instructions
This is similar to the 'tail' marker, except that it guarantees that
tail call optimization will occur. It also comes with convervative IR
verification rules that ensure that tail call optimization is possible.
Reviewers: nicholas
Differential Revision: http://llvm-reviews.chandlerc.com/D3240
llvm-svn: 207143
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 62dba414608..92965fa7e44 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1469,7 +1469,8 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, Code = bitc::FUNC_CODE_INST_CALL; Vals.push_back(VE.getAttributeID(CI.getAttributes())); - Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall())); + Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()) | + unsigned(CI.isMustTailCall()) << 14); PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee // Emit value #'s for the fixed parameters. |