summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-11 19:36:30 +0000
committerChris Lattner <sabre@nondot.org>2008-01-11 19:36:30 +0000
commitb66fbdde42596386aea80bd1c27ed73070de188e (patch)
treec65cea3628fc0500416721bb4f6bda12dada9f44 /llvm/lib/Transforms/IPO
parent4a70261f006ab0f42df5e7a13e01d5d179d265c6 (diff)
downloadbcm5719-llvm-b66fbdde42596386aea80bd1c27ed73070de188e.tar.gz
bcm5719-llvm-b66fbdde42596386aea80bd1c27ed73070de188e.zip
Use smallptrset instead of std::set for efficiency.
llvm-svn: 45878
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 1c739adcea3..dc61a883542 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -282,7 +282,7 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const {
// Because there could be several/many load instructions, remember which
// blocks we know to be transparent to the load.
- std::set<BasicBlock*> TranspBlocks;
+ SmallPtrSet<BasicBlock*, 16> TranspBlocks;
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
TargetData &TD = getAnalysis<TargetData>();
@@ -304,7 +304,8 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const {
// To do this, we perform a depth first search on the inverse CFG from the
// loading block.
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- for (idf_ext_iterator<BasicBlock*> I = idf_ext_begin(*PI, TranspBlocks),
+ for (idf_ext_iterator<BasicBlock*, SmallPtrSet<BasicBlock*, 16> >
+ I = idf_ext_begin(*PI, TranspBlocks),
E = idf_ext_end(*PI, TranspBlocks); I != E; ++I)
if (AA.canBasicBlockModify(**I, Arg, LoadSize))
return false;
OpenPOWER on IntegriCloud