mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Use smallptrset instead of std::set for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -282,7 +282,7 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const {
|
|||||||
|
|
||||||
// Because there could be several/many load instructions, remember which
|
// Because there could be several/many load instructions, remember which
|
||||||
// blocks we know to be transparent to the load.
|
// blocks we know to be transparent to the load.
|
||||||
std::set<BasicBlock*> TranspBlocks;
|
SmallPtrSet<BasicBlock*, 16> TranspBlocks;
|
||||||
|
|
||||||
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
|
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
|
||||||
TargetData &TD = getAnalysis<TargetData>();
|
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
|
// To do this, we perform a depth first search on the inverse CFG from the
|
||||||
// loading block.
|
// loading block.
|
||||||
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
|
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)
|
E = idf_ext_end(*PI, TranspBlocks); I != E; ++I)
|
||||||
if (AA.canBasicBlockModify(**I, Arg, LoadSize))
|
if (AA.canBasicBlockModify(**I, Arg, LoadSize))
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user