Make sure -print-machineinstrs applies to the first pass as well.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 Jul 2012 19:28:27 +0000 (19:28 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 Jul 2012 19:28:27 +0000 (19:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159720 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Passes.cpp

index e4ad6c17bc2aee1f7d727d4cca585cafd6bf9be4..69d6d00091adb225b45be12d5f56e6c7e73fd558 100644 (file)
@@ -433,9 +433,6 @@ void TargetPassConfig::addISelPrepare() {
 /// TODO: We could use a single addPre/Post(ID) hook to allow pass injection
 /// before/after any target-independent pass. But it's currently overkill.
 void TargetPassConfig::addMachinePasses() {
-  // Print the instruction selected machine code...
-  printAndVerify("After Instruction Selection");
-
   // Insert a machine instr printer pass after the specified pass.
   // If -print-machineinstrs specified, print machineinstrs after all passes.
   if (StringRef(PrintMachineInstrs.getValue()).equals(""))
@@ -451,6 +448,9 @@ void TargetPassConfig::addMachinePasses() {
     insertPass(TID, IID);
   }
 
+  // Print the instruction selected machine code...
+  printAndVerify("After Instruction Selection");
+
   // Expand pseudo-instructions emitted by ISel.
   addPass(&ExpandISelPseudosID);