summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineLICM.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-07-20 00:50:13 +0000
committerDale Johannesen <dalej@apple.com>2010-07-20 00:50:13 +0000
commit08645f199178e971a5f6d8ecb5ff4771f6f5623b (patch)
treeb85e51b180b44ee117c2b3db6874036167dc97ae /llvm/lib/CodeGen/MachineLICM.cpp
parent6c8041ea34dcff9f105153f778ad5e72d8e4e65a (diff)
downloadbcm5719-llvm-08645f199178e971a5f6d8ecb5ff4771f6f5623b.tar.gz
bcm5719-llvm-08645f199178e971a5f6d8ecb5ff4771f6f5623b.zip
Don't hoist things out of a large switch inside a
loop, for the reasons in the comments. This is a major win on 253.perlbmk on ARM Darwin. I expect it to be a good heuristic in general, but it's possible some things will regress; I'll be watching. 7940152. llvm-svn: 108792
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineLICM.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 4c054f51f3a..83f66ce0948 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -489,8 +489,12 @@ void MachineLICM::HoistRegion(MachineDomTreeNode *N) {
}
const std::vector<MachineDomTreeNode*> &Children = N->getChildren();
- for (unsigned I = 0, E = Children.size(); I != E; ++I)
- HoistRegion(Children[I]);
+ // Don't hoist things out of a large switch statement. This often causes
+ // code to be hoisted that wasn't going to be executed, and increases
+ // register pressure in a situation where it's likely to matter.
+ if (Children.size() < 10)
+ for (unsigned I = 0, E = Children.size(); I != E; ++I)
+ HoistRegion(Children[I]);
}
/// IsLICMCandidate - Returns true if the instruction may be a suitable
OpenPOWER on IntegriCloud