From 9a12aab2ea2017b24fcff9fbf510139d20930303 Mon Sep 17 00:00:00 2001
From: Prakalp Srivastava <prakalps@gmail.com>
Date: Thu, 2 Jul 2015 11:04:06 -0500
Subject: [PATCH] Not required now Revert "Added a patch approved in future
 llvm branches which stop argument promotion for variagic functions. This was
 required to stop auto promotion of arguments in __visc__ calls"

This reverts commit f960f4d0da0bcdf187092f6961664375a27bccbf.
---
 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 483c363dd1..e6fa4edf61 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -125,13 +125,6 @@ CallGraphNode *ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
   // Make sure that it is local to this module.
   if (!F || !F->hasLocalLinkage()) return 0;
 
-  // Don't promote arguments for variadic functions. Adding, removing, or
-  // changing non-pack parameters can change the classification of pack
-  // parameters. Frontends encode that classification at the call site in the
-  // IR, while in the callee the classification is determined dynamically
-  // on the number of registers consumed so far.
-  if (F->isVarArg()) return nullptr;
-
   // First check: see if there are any pointer arguments!  If not, quick exit.
   SmallVector<std::pair<Argument*, unsigned>, 16> PointerArgs;
   unsigned ArgNo = 0;
-- 
GitLab