mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 21:35:07 +00:00
InlineSpiller: Store bucket pointers instead of iterators.
Lets us use a SetVector instead of an explicit set + vector combination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
061ff3409d
commit
2db14ba90c
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#define DEBUG_TYPE "regalloc"
|
#define DEBUG_TYPE "regalloc"
|
||||||
#include "Spiller.h"
|
#include "Spiller.h"
|
||||||
|
#include "llvm/ADT/SetVector.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/ADT/TinyPtrVector.h"
|
#include "llvm/ADT/TinyPtrVector.h"
|
||||||
#include "llvm/Analysis/AliasAnalysis.h"
|
#include "llvm/Analysis/AliasAnalysis.h"
|
||||||
@ -337,10 +338,12 @@ static raw_ostream &operator<<(raw_ostream &OS,
|
|||||||
/// propagateSiblingValue - Propagate the value in SVI to dependents if it is
|
/// propagateSiblingValue - Propagate the value in SVI to dependents if it is
|
||||||
/// known. Otherwise remember the dependency for later.
|
/// known. Otherwise remember the dependency for later.
|
||||||
///
|
///
|
||||||
/// @param SVI SibValues entry to propagate.
|
/// @param SVIIter SibValues entry to propagate.
|
||||||
/// @param VNI Dependent value, or NULL to propagate to all saved dependents.
|
/// @param VNI Dependent value, or NULL to propagate to all saved dependents.
|
||||||
void InlineSpiller::propagateSiblingValue(SibValueMap::iterator SVI,
|
void InlineSpiller::propagateSiblingValue(SibValueMap::iterator SVIIter,
|
||||||
VNInfo *VNI) {
|
VNInfo *VNI) {
|
||||||
|
SibValueMap::value_type *SVI = &*SVIIter;
|
||||||
|
|
||||||
// When VNI is non-NULL, add it to SVI's deps, and only propagate to that.
|
// When VNI is non-NULL, add it to SVI's deps, and only propagate to that.
|
||||||
TinyPtrVector<VNInfo*> FirstDeps;
|
TinyPtrVector<VNInfo*> FirstDeps;
|
||||||
if (VNI) {
|
if (VNI) {
|
||||||
@ -352,14 +355,12 @@ void InlineSpiller::propagateSiblingValue(SibValueMap::iterator SVI,
|
|||||||
if (!SVI->second.hasDef())
|
if (!SVI->second.hasDef())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Work list of values to propagate. It would be nice to use a SetVector
|
// Work list of values to propagate.
|
||||||
// here, but then we would be forced to use a SmallSet.
|
SmallSetVector<SibValueMap::value_type *, 8> WorkList;
|
||||||
SmallVector<SibValueMap::iterator, 8> WorkList(1, SVI);
|
WorkList.insert(SVI);
|
||||||
SmallPtrSet<VNInfo*, 8> WorkSet;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
SVI = WorkList.pop_back_val();
|
SVI = WorkList.pop_back_val();
|
||||||
WorkSet.erase(SVI->first);
|
|
||||||
TinyPtrVector<VNInfo*> *Deps = VNI ? &FirstDeps : &SVI->second.Deps;
|
TinyPtrVector<VNInfo*> *Deps = VNI ? &FirstDeps : &SVI->second.Deps;
|
||||||
VNI = 0;
|
VNI = 0;
|
||||||
|
|
||||||
@ -450,8 +451,7 @@ void InlineSpiller::propagateSiblingValue(SibValueMap::iterator SVI,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Something changed in DepSVI. Propagate to dependents.
|
// Something changed in DepSVI. Propagate to dependents.
|
||||||
if (WorkSet.insert(DepSVI->first))
|
WorkList.insert(&*DepSVI);
|
||||||
WorkList.push_back(DepSVI);
|
|
||||||
|
|
||||||
DEBUG(dbgs() << " update " << DepSVI->first->id << '@'
|
DEBUG(dbgs() << " update " << DepSVI->first->id << '@'
|
||||||
<< DepSVI->first->def << " to:\t" << DepSV);
|
<< DepSVI->first->def << " to:\t" << DepSV);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user