diff options
author | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-02-11 16:10:31 +0000 |
---|---|---|
committer | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-02-11 16:10:31 +0000 |
commit | bf8d0cc699b171c72a8fe48c67431d0a2e0a3a5d (patch) | |
tree | c4c1faf255b1bada66b21503adc360256dba8bc4 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 5f15a8b9596cbcea2a2974ac088405a3d9989d95 (diff) | |
download | bcm5719-llvm-bf8d0cc699b171c72a8fe48c67431d0a2e0a3a5d.tar.gz bcm5719-llvm-bf8d0cc699b171c72a8fe48c67431d0a2e0a3a5d.zip |
Fix SelectionDAG compile time issue with alias analysis.
Add new token factor node and its users to worklist if alias analysis is
turned on, in DAGCombiner::visitTokenFactor(). Alias analysis may cause
a lot of new token factors to be inserted into the DAG, and they need to
be optimized to avoid significant slow-downs.
Reviewed by Hal Finkel.
llvm-svn: 228841
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index cc7388b4bb5..c8b723a0de2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1540,8 +1540,11 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) { Result = DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Ops); } - // Don't add users to work list. - return CombineTo(N, Result, false); + // Add users to worklist if AA is enabled, since it may introduce + // a lot of new chained token factors while removing memory deps. + bool UseAA = CombinerAA.getNumOccurrences() > 0 ? CombinerAA + : DAG.getSubtarget().useAA(); + return CombineTo(N, Result, UseAA /*add to worklist*/); } return Result; |