summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2014-09-20 13:29:20 +0000
committerLenny Maiorani <lenny@colorado.edu>2014-09-20 13:29:20 +0000
commit9eefc8121928088d71ae59b6cd77d3badcf71b37 (patch)
tree5d714d9dfcae16ec3a71687475f15e46109a68cd /llvm/lib
parente59b0d2c48c43f3350b210c72efe9aea3df1c15b (diff)
downloadbcm5719-llvm-9eefc8121928088d71ae59b6cd77d3badcf71b37.tar.gz
bcm5719-llvm-9eefc8121928088d71ae59b6cd77d3badcf71b37.zip
Using a deque to manage the stack of nodes is faster here.
Vector is slow due to many reallocations as the size regularly changes in unpredictable ways. See the investigation provided on the mailing list for more information: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120116/135228.html llvm-svn: 218182
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/EarlyCSE.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
index 21ef34772d7..131a8cb3dcb 100644
--- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
@@ -26,7 +26,7 @@
#include "llvm/Support/RecyclingAllocator.h"
#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Transforms/Utils/Local.h"
-#include <vector>
+#include <deque>
using namespace llvm;
#define DEBUG_TYPE "early-cse"
@@ -560,7 +560,11 @@ bool EarlyCSE::runOnFunction(Function &F) {
if (skipOptnoneFunction(F))
return false;
- std::vector<StackNode *> nodesToProcess;
+ // Note, deque is being used here because there is significant performance gains
+ // over vector when the container becomes very large due to the specific access
+ // patterns. For more information see the mailing list discussion on this:
+ // http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120116/135228.html
+ std::deque<StackNode *> nodesToProcess;
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
DL = DLP ? &DLP->getDataLayout() : nullptr;
OpenPOWER on IntegriCloud