From 23ea6d343f60775e6877626fb97fca3c7bc55827 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 28 Oct 2016 18:05:05 +0000 Subject: [PATCH] TargetPassConfig: Move addPass of IPRA RegUsageInfoProp down. 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/TargetPassConfig.cpp b/lib/CodeGen/TargetPassConfig.cpp index e0f1b524da0..2798036aecb 100644 --- a/lib/CodeGen/TargetPassConfig.cpp +++ b/lib/CodeGen/TargetPassConfig.cpp @@ -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); -- 2.40.0