summaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 2ec670e662..55e1606230 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -857,6 +857,11 @@ void BytecodeReader::ParseInstruction(std::vector<unsigned> &Oprnds,
}
Result = new CallInst(F, Params);
+ if (CallInst* newCI = UpgradeIntrinsicCall(cast<CallInst>(Result))) {
+ Result->replaceAllUsesWith(newCI);
+ Result->eraseFromParent();
+ Result = newCI;
+ }
if (isTailCall) cast<CallInst>(Result)->setTailCall();
if (CallingConv) cast<CallInst>(Result)->setCallingConv(CallingConv);
break;