Move the instcombine pass before globaldce, so that if globals are made dead by instc...
authorChris Lattner <sabre@nondot.org>
Thu, 26 Jun 2003 04:32:31 +0000 (04:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Jun 2003 04:32:31 +0000 (04:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6910 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccld/gccld.cpp

index eadb5f43403ba3cbea37b6e633c6aedc6de9871d..283118d2940e411ce9871c66d3ade8062ceb140a 100644 (file)
@@ -400,15 +400,15 @@ int main(int argc, char **argv) {
   //
   Passes.add(createDeadArgEliminationPass());
 
-  // Now that we have optimized the program, discard unreachable functions...
-  //
-  Passes.add(createGlobalDCEPass());
-
   // The FuncResolve pass may leave cruft around if functions were prototyped
   // differently than they were defined.  Remove this cruft.
   //
   Passes.add(createInstructionCombiningPass());
 
+  // Now that we have optimized the program, discard unreachable functions...
+  //
+  Passes.add(createGlobalDCEPass());
+
   // Add the pass that writes bytecode to the output file...
   std::string RealBytecodeOutput = OutputFilename;
   if (!LinkAsLibrary) RealBytecodeOutput += ".bc";