preserve the tail marker
authorChris Lattner <sabre@nondot.org>
Fri, 6 May 2005 06:46:58 +0000 (06:46 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 May 2005 06:46:58 +0000 (06:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/ExprTypeConvert.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp

index f43390da836d3ac6a887e2adcd73b4476bb95072..a022461d333690c06dfe0501ba4843cf644f533f 100644 (file)
@@ -523,6 +523,8 @@ Value *llvm::ConvertExpressionToType(Value *V, const Type *Ty,
     Res = new CallInst(Constant::getNullValue(NewPTy),
                        std::vector<Value*>(I->op_begin()+1, I->op_end()),
                        Name);
+    if (cast<CallInst>(I)->isTailCall())
+      cast<CallInst>(Res)->setTailCall();
     VMC.ExprMap[I] = Res;
     Res->setOperand(0, ConvertExpressionToType(I->getOperand(0),NewPTy,VMC,TD));
     break;
index 028fda9aebe2f83c11d93f94827712668af2e5d7..fd5a5d0215f066efe31b9d04437144a082eae922 100644 (file)
@@ -443,6 +443,8 @@ Function *ArgPromotion::DoPromotion(Function *F,
                            Args, "", Call);
     } else {
       New = new CallInst(NF, Args, "", Call);
+      if (cast<CallInst>(Call)->isTailCall())
+        cast<CallInst>(New)->setTailCall();
     }
     Args.clear();
 
index 3a2a5f08a842ebfbf42978d895e2929b123cfddf..2dbc5c3169ab602cdf1ba589d9a6926ed9151bcc 100644 (file)
@@ -430,6 +430,8 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
                            Args, "", Call);
     } else {
       New = new CallInst(NF, Args, "", Call);
+      if (cast<CallInst>(Call)->isTailCall())
+        cast<CallInst>(New)->setTailCall();
     }
     Args.clear();