]> granicus.if.org Git - llvm/commitdiff
TargetPassConfig: Move addPass of IPRA RegUsageInfoProp down.
authorMatthias Braun <matze@braunis.de>
Fri, 28 Oct 2016 18:05:05 +0000 (18:05 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 28 Oct 2016 18:05:05 +0000 (18:05 +0000)
TargetPassConfig::addMachinePasses() does some housekeeping first:
Handling the -print-machineinstrs flag and doing an initial printing
"After Instruction Selection". There is no reason for RegUsageInfoProp
to run before those two steps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285422 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetPassConfig.cpp

index e0f1b524da0ccb2939d98dfc6bd2de42dc7015ee..2798036aecb7c51ba75159e1545d2c3395a7a57e 100644 (file)
@@ -570,9 +570,6 @@ void TargetPassConfig::addISelPrepare() {
 void TargetPassConfig::addMachinePasses() {
   AddingMachinePasses = true;
 
-  if (TM->Options.EnableIPRA)
-    addPass(createRegUsageInfoPropPass());
-
   // Insert a machine instr printer pass after the specified pass.
   if (!StringRef(PrintMachineInstrs.getValue()).equals("") &&
       !StringRef(PrintMachineInstrs.getValue()).equals("option-unspecified")) {
@@ -588,6 +585,9 @@ void TargetPassConfig::addMachinePasses() {
   // Print the instruction selected machine code...
   printAndVerify("After Instruction Selection");
 
+  if (TM->Options.EnableIPRA)
+    addPass(createRegUsageInfoPropPass());
+
   // Expand pseudo-instructions emitted by ISel.
   addPass(&ExpandISelPseudosID);