mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Reduce double set lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c9c6ed761
commit
9f9dcf8046
@ -113,9 +113,8 @@ private:
|
|||||||
while (It != GT::child_end(Node)) {
|
while (It != GT::child_end(Node)) {
|
||||||
NodeType *Next = *It++;
|
NodeType *Next = *It++;
|
||||||
// Has our next sibling been visited?
|
// Has our next sibling been visited?
|
||||||
if (Next && !this->Visited.count(Next)) {
|
if (Next && this->Visited.insert(Next).second) {
|
||||||
// No, do it now.
|
// No, do it now.
|
||||||
this->Visited.insert(Next);
|
|
||||||
VisitStack.push_back(std::make_pair(PointerIntTy(Next, 0),
|
VisitStack.push_back(std::make_pair(PointerIntTy(Next, 0),
|
||||||
GT::child_begin(Next)));
|
GT::child_begin(Next)));
|
||||||
return;
|
return;
|
||||||
|
@ -346,11 +346,10 @@ namespace {
|
|||||||
/// Push BV onto BlockValueStack unless it's already in there.
|
/// Push BV onto BlockValueStack unless it's already in there.
|
||||||
/// Returns true on success.
|
/// Returns true on success.
|
||||||
bool pushBlockValue(const std::pair<BasicBlock *, Value *> &BV) {
|
bool pushBlockValue(const std::pair<BasicBlock *, Value *> &BV) {
|
||||||
if (BlockValueSet.count(BV))
|
if (!BlockValueSet.insert(BV).second)
|
||||||
return false; // It's already in the stack.
|
return false; // It's already in the stack.
|
||||||
|
|
||||||
BlockValueStack.push(BV);
|
BlockValueStack.push(BV);
|
||||||
BlockValueSet.insert(BV);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,8 +622,7 @@ public:
|
|||||||
void removeValue(const Value *V) {
|
void removeValue(const Value *V) {
|
||||||
// This is to support hack in lowerCallFromStatepoint
|
// This is to support hack in lowerCallFromStatepoint
|
||||||
// Should be removed when hack is resolved
|
// Should be removed when hack is resolved
|
||||||
if (NodeMap.count(V))
|
NodeMap.erase(V);
|
||||||
NodeMap.erase(V);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUnusedArgValue(const Value *V, SDValue NewN) {
|
void setUnusedArgValue(const Value *V, SDValue NewN) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user