Preserve calling conv when hacking on calls
[oota-llvm.git] / lib / Transforms / LevelRaise.cpp
index c15aa257d94ff9fd7b2cf637b299fe2f4ccdb6ef..718f07de82e5ccf300e7312fe7898cebe4477860 100644 (file)
@@ -538,6 +538,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
       // Create a new call instruction...
       CallInst *NewCall = new CallInst(NewCast,
                            std::vector<Value*>(CI->op_begin()+1, CI->op_end()));
+      if (CI->isTailCall()) NewCall->setTailCall();
+      NewCall->setCallingConv(CI->getCallingConv());
       ++BI;
       ReplaceInstWithInst(CI, NewCall);