mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 04:33:40 +00:00
Cache the size of the vector instead of calling .size() all over the place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cac50c5ab8
commit
5d8ab0f02b
@ -1278,14 +1278,14 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
|
|||||||
// If we had to process more than one hundred blocks to find the
|
// If we had to process more than one hundred blocks to find the
|
||||||
// dependencies, this load isn't worth worrying about. Optimizing
|
// dependencies, this load isn't worth worrying about. Optimizing
|
||||||
// it will be too expensive.
|
// it will be too expensive.
|
||||||
if (Deps.size() > 100)
|
unsigned NumDeps = Deps.size();
|
||||||
|
if (NumDeps > 100)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If we had a phi translation failure, we'll have a single entry which is a
|
// If we had a phi translation failure, we'll have a single entry which is a
|
||||||
// clobber in the current block. Reject this early.
|
// clobber in the current block. Reject this early.
|
||||||
if (Deps.size() == 1
|
if (NumDeps == 1 &&
|
||||||
&& !Deps[0].getResult().isDef() && !Deps[0].getResult().isClobber())
|
!Deps[0].getResult().isDef() && !Deps[0].getResult().isClobber()) {
|
||||||
{
|
|
||||||
DEBUG(
|
DEBUG(
|
||||||
dbgs() << "GVN: non-local load ";
|
dbgs() << "GVN: non-local load ";
|
||||||
WriteAsOperand(dbgs(), LI);
|
WriteAsOperand(dbgs(), LI);
|
||||||
@ -1301,7 +1301,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
|
|||||||
SmallVector<AvailableValueInBlock, 16> ValuesPerBlock;
|
SmallVector<AvailableValueInBlock, 16> ValuesPerBlock;
|
||||||
SmallVector<BasicBlock*, 16> UnavailableBlocks;
|
SmallVector<BasicBlock*, 16> UnavailableBlocks;
|
||||||
|
|
||||||
for (unsigned i = 0, e = Deps.size(); i != e; ++i) {
|
for (unsigned i = 0, e = NumDeps; i != e; ++i) {
|
||||||
BasicBlock *DepBB = Deps[i].getBB();
|
BasicBlock *DepBB = Deps[i].getBB();
|
||||||
MemDepResult DepInfo = Deps[i].getResult();
|
MemDepResult DepInfo = Deps[i].getResult();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user