[llvm-commits] [llvm] r52970 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Evan Cheng
evan.cheng at apple.com
Tue Jul 1 10:59:21 PDT 2008
Author: evancheng
Date: Tue Jul 1 12:59:20 2008
New Revision: 52970
URL: http://llvm.org/viewvc/llvm-project?rev=52970&view=rev
Log:
Apply Chris' suggestion.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=52970&r1=52969&r2=52970&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Jul 1 12:59:20 2008
@@ -5303,17 +5303,16 @@
}
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");
- DAG.Combine(false, *AA);
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("DAG Combining 1");
+ DAG.Combine(false, *AA);
+ } else {
+ DAG.Combine(false, *AA);
+ }
DOUT << "Optimized lowered selection DAG:\n";
DEBUG(DAG.dump());
@@ -5324,21 +5323,23 @@
DAG.LegalizeTypes();
// Someday even later, enable a dag combine pass here.
#endif
- if (TimePassesIsEnabled)
- RegionTimer = new NamedRegionTimer("DAG Legalization");
- DAG.Legalize();
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("DAG Legalization");
+ DAG.Legalize();
+ } 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");
- DAG.Combine(true, *AA);
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("DAG Combining 2");
+ DAG.Combine(true, *AA);
+ } else {
+ DAG.Combine(true, *AA);
+ }
DOUT << "Optimized legalized selection DAG:\n";
DEBUG(DAG.dump());
@@ -5350,26 +5351,29 @@
// Third, instruction select all of the operations to machine code, adding the
// code to the MachineBasicBlock.
- if (TimePassesIsEnabled)
- RegionTimer = new NamedRegionTimer("Instruction Selection");
- InstructionSelect(DAG);
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("Instruction Selection");
+ InstructionSelect(DAG);
+ } 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");
- ScheduleAndEmitDAG(DAG);
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("Instruction Scheduling");
+ ScheduleAndEmitDAG(DAG);
+ } else {
+ ScheduleAndEmitDAG(DAG);
+ }
// Perform target specific isel post processing.
- if (TimePassesIsEnabled)
- RegionTimer = new NamedRegionTimer("Instruction Selection Post Processing");
- InstructionSelectPostProcessing(DAG);
- if (TimePassesIsEnabled)
- delete RegionTimer;
+ if (TimePassesIsEnabled) {
+ NamedRegionTimer T("Instruction Selection Post Processing");
+ InstructionSelectPostProcessing(DAG);
+ } else {
+ InstructionSelectPostProcessing(DAG);
+ }
DOUT << "Selected machine code:\n";
DEBUG(BB->dump());
More information about the llvm-commits
mailing list