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