Don't use static globals for params as it confuses the optimzer that their values...
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 2 Apr 2009 17:51:27 +0000 (17:51 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 2 Apr 2009 17:51:27 +0000 (17:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68328 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDecl.cpp

index 1277404e169776e1569233711ba54ba121d714d2..b8f5ca85cf56982c3ad26a0ec06f75f77fe67c0e 100644 (file)
@@ -426,12 +426,6 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) {
   if (!Ty->isConstantSizeType()) {
     // Variable sized values always are passed by-reference.
     DeclPtr = Arg;
-  } else if (Target.useGlobalsForAutomaticVariables()) {
-    // Targets that don't have stack use global address space for parameters.
-    // Specify external linkage for such globals so that llvm optimizer do
-    // not assume there values initialized as zero.
-    DeclPtr = CreateStaticBlockVarDecl(D, ".arg.",
-                                       llvm::GlobalValue::ExternalLinkage);
   } else {
     // A fixed sized single-value variable becomes an alloca in the entry block.
     const llvm::Type *LTy = ConvertTypeForMem(Ty);