aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-09-07 00:15:36 +0000
committerNate Begeman <natebegeman@mac.com>2005-09-07 00:15:36 +0000
commit2300f5504643eaddc307d3db8a3ccd224c4fa251 (patch)
treea8b7fe18edb0bafed32921abc0121c5491fa10b6 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent6b5d9cdfcfcc886141b3c3d6449f69a5cb499502 (diff)
Add an option to the DAG Combiner to enable it for beta runs, and turn on
that option for PowerPC's beta. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index ecf9797b48..26421c148f 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -36,6 +36,18 @@
#include <iostream>
using namespace llvm;
+// Temporary command line code to enable use of the dag combiner as a beta
+// option.
+namespace llvm {
+ bool CombinerEnabled;
+}
+namespace {
+ cl::opt<bool, true>
+ CombineDAG("enable-dag-combiner", cl::Hidden,
+ cl::desc("Run the DAG combiner before and after Legalize"),
+ cl::location(CombinerEnabled),
+ cl::init(false));
+}
#ifndef NDEBUG
static cl::opt<bool>
ViewDAGs("view-isel-dags", cl::Hidden,
@@ -44,6 +56,7 @@ ViewDAGs("view-isel-dags", cl::Hidden,
static const bool ViewDAGs = 0;
#endif
+
namespace llvm {
//===--------------------------------------------------------------------===//
/// FunctionLoweringInfo - This contains information that is global to a
@@ -1234,6 +1247,9 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
// types that are not supported by the target.
BuildSelectionDAG(DAG, LLVMBB, PHINodesToUpdate, FuncInfo);
+ // Run the DAG combiner in pre-legalize mode, if we are told to do so
+ if (CombinerEnabled) DAG.Combine(false);
+
DEBUG(std::cerr << "Lowered selection DAG:\n");
DEBUG(DAG.dump());
@@ -1246,6 +1262,9 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
if (ViewDAGs) DAG.viewGraph();
+ // Run the DAG combiner in post-legalize mode, if we are told to do so
+ if (CombinerEnabled) DAG.Combine(true);
+
// Third, instruction select all of the operations to machine code, adding the
// code to the MachineBasicBlock.
InstructionSelectBasicBlock(DAG);