Apply Chris' suggestion.

llvm-svn: 52970
This commit is contained in:
Evan Cheng 2008-07-01 17:59:20 +00:00
parent 9dbe4d15ec
commit fb2573554c
1 changed files with 36 additions and 32 deletions

View File

@ -5303,17 +5303,16 @@ void SelectionDAGISel::ComputeLiveOutVRegInfo(SelectionDAG &DAG) {
}
void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
NamedRegionTimer *RegionTimer = 0;
DOUT << "Lowered selection DAG:\n";
DEBUG(DAG.dump());
// Run the DAG combiner in pre-legalize mode.
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("DAG Combining 1");
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Combining 1");
DAG.Combine(false, *AA);
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
DAG.Combine(false, *AA);
}
DOUT << "Optimized lowered selection DAG:\n";
DEBUG(DAG.dump());
@ -5324,21 +5323,23 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
DAG.LegalizeTypes();
// Someday even later, enable a dag combine pass here.
#endif
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("DAG Legalization");
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Legalization");
DAG.Legalize();
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
DAG.Legalize();
}
DOUT << "Legalized selection DAG:\n";
DEBUG(DAG.dump());
// Run the DAG combiner in post-legalize mode.
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("DAG Combining 2");
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Combining 2");
DAG.Combine(true, *AA);
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
DAG.Combine(true, *AA);
}
DOUT << "Optimized legalized selection DAG:\n";
DEBUG(DAG.dump());
@ -5350,26 +5351,29 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
// Third, instruction select all of the operations to machine code, adding the
// code to the MachineBasicBlock.
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("Instruction Selection");
if (TimePassesIsEnabled) {
NamedRegionTimer T("Instruction Selection");
InstructionSelect(DAG);
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
InstructionSelect(DAG);
}
// Emit machine code to BB. This can change 'BB' to the last block being
// inserted into.
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("Instruction Scheduling");
if (TimePassesIsEnabled) {
NamedRegionTimer T("Instruction Scheduling");
ScheduleAndEmitDAG(DAG);
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
ScheduleAndEmitDAG(DAG);
}
// Perform target specific isel post processing.
if (TimePassesIsEnabled)
RegionTimer = new NamedRegionTimer("Instruction Selection Post Processing");
if (TimePassesIsEnabled) {
NamedRegionTimer T("Instruction Selection Post Processing");
InstructionSelectPostProcessing(DAG);
if (TimePassesIsEnabled)
delete RegionTimer;
} else {
InstructionSelectPostProcessing(DAG);
}
DOUT << "Selected machine code:\n";
DEBUG(BB->dump());