aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-10-16 20:52:31 +0000
committerJim Laskey <jlaskey@mac.com>2006-10-16 20:52:31 +0000
commitc7c3f110eda0ff8040e4bd99e38d3112b910810f (patch)
tree6a1d25f92303ca94d3ce6f150772a4998face05e /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parenta7fa1476b6d8dd5e5b546aa5b700a85c650d6904 (diff)
Pass AliasAnalysis thru to DAGCombiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 1cac34d8d8..ba90e23b04 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -30,6 +30,7 @@
#define DEBUG_TYPE "dagcombine"
#include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
@@ -60,6 +61,9 @@ namespace {
// Worklist of all of the nodes that need to be simplified.
std::vector<SDNode*> WorkList;
+ // AA - Used for DAG load/store alias analysis.
+ AliasAnalysis &AA;
+
/// AddUsersToWorkList - When an instruction is simplified, add all users of
/// the instruction to the work lists because they might get more simplified
/// now.
@@ -262,8 +266,11 @@ namespace {
SDOperand FindBetterChain(SDNode *N, SDOperand Chain);
public:
- DAGCombiner(SelectionDAG &D)
- : DAG(D), TLI(D.getTargetLoweringInfo()), AfterLegalize(false) {}
+ DAGCombiner(SelectionDAG &D, AliasAnalysis &A)
+ : DAG(D),
+ TLI(D.getTargetLoweringInfo()),
+ AfterLegalize(false),
+ AA(A) {}
/// Run - runs the dag combiner on all nodes in the work list
void Run(bool RunningAfterLegalize);
@@ -4133,8 +4140,8 @@ SDOperand DAGCombiner::FindBetterChain(SDNode *N, SDOperand OldChain) {
// SelectionDAG::Combine - This is the entry point for the file.
//
-void SelectionDAG::Combine(bool RunningAfterLegalize) {
+void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA) {
/// run - This is the main entry point to this class.
///
- DAGCombiner(*this).Run(RunningAfterLegalize);
+ DAGCombiner(*this, AA).Run(RunningAfterLegalize);
}