[llvm-commits] [llvm] r55059 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Dan Gohman
gohman at apple.com
Wed Aug 20 09:30:28 PDT 2008
Author: djg
Date: Wed Aug 20 11:30:28 2008
New Revision: 55059
URL: http://llvm.org/viewvc/llvm-project?rev=55059&view=rev
Log:
Disable DAGCombine's alignment inference in "fast" codegen mode.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=55059&r1=55058&r2=55059&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Aug 20 11:30:28 2008
@@ -169,7 +169,7 @@
/// certain types of nodes together, or eliminating superfluous nodes. When
/// the AfterLegalize argument is set to 'true', Combine takes care not to
/// generate any nodes that will be illegal on the target.
- void Combine(bool AfterLegalize, AliasAnalysis &AA);
+ void Combine(bool AfterLegalize, AliasAnalysis &AA, bool Fast);
/// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
/// only uses types natively supported by the target.
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=55059&r1=55058&r2=55059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Aug 20 11:30:28 2008
@@ -51,6 +51,7 @@
SelectionDAG &DAG;
TargetLowering &TLI;
bool AfterLegalize;
+ bool Fast;
// Worklist of all of the nodes that need to be simplified.
std::vector<SDNode*> WorkList;
@@ -237,10 +238,11 @@
SDValue FindBetterChain(SDNode *N, SDValue Chain);
public:
- DAGCombiner(SelectionDAG &D, AliasAnalysis &A)
+ DAGCombiner(SelectionDAG &D, AliasAnalysis &A, bool fast)
: DAG(D),
TLI(D.getTargetLoweringInfo()),
AfterLegalize(false),
+ Fast(fast),
AA(A) {}
/// Run - runs the dag combiner on all nodes in the work list
@@ -4411,7 +4413,7 @@
SDValue Ptr = LD->getBasePtr();
// Try to infer better alignment information than the load already has.
- if (LD->isUnindexed()) {
+ if (!Fast && LD->isUnindexed()) {
if (unsigned Align = InferAlignment(Ptr, DAG)) {
if (Align > LD->getAlignment())
return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0),
@@ -4529,7 +4531,7 @@
SDValue Ptr = ST->getBasePtr();
// Try to infer better alignment information than the store already has.
- if (ST->isUnindexed()) {
+ if (!Fast && ST->isUnindexed()) {
if (unsigned Align = InferAlignment(Ptr, DAG)) {
if (Align > ST->getAlignment())
return DAG.getTruncStore(Chain, Value, Ptr, ST->getSrcValue(),
@@ -5664,8 +5666,9 @@
// SelectionDAG::Combine - This is the entry point for the file.
//
-void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA) {
+void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA,
+ bool Fast) {
/// run - This is the main entry point to this class.
///
- DAGCombiner(*this, AA).Run(RunningAfterLegalize);
+ DAGCombiner(*this, AA, Fast).Run(RunningAfterLegalize);
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55059&r1=55058&r2=55059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Aug 20 11:30:28 2008
@@ -5369,9 +5369,9 @@
// Run the DAG combiner in pre-legalize mode.
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Combining 1", GroupName);
- DAG.Combine(false, *AA);
+ DAG.Combine(false, *AA, Fast);
} else {
- DAG.Combine(false, *AA);
+ DAG.Combine(false, *AA, Fast);
}
DOUT << "Optimized lowered selection DAG:\n";
@@ -5413,9 +5413,9 @@
// Run the DAG combiner in post-legalize mode.
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Combining 2", GroupName);
- DAG.Combine(true, *AA);
+ DAG.Combine(true, *AA, Fast);
} else {
- DAG.Combine(true, *AA);
+ DAG.Combine(true, *AA, Fast);
}
DOUT << "Optimized legalized selection DAG:\n";
More information about the llvm-commits
mailing list