mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
Eliminate a bunch of work from ValueSymbolTable::insert for the common case
where a symbol name doesn't conflict. This speeds up bc reading 16% on 176.gcc! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33981 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
670ccfe6a4
commit
f5111552c2
@ -81,7 +81,13 @@ void ValueSymbolTable::insert(Value* V) {
|
|||||||
assert(V && "Can't insert null Value into symbol table!");
|
assert(V && "Can't insert null Value into symbol table!");
|
||||||
assert(V->hasName() && "Can't insert nameless Value into symbol table");
|
assert(V->hasName() && "Can't insert nameless Value into symbol table");
|
||||||
|
|
||||||
// Check to see if there is a naming conflict. If so, rename this value
|
// Try inserting the name, assuming it won't conflict.
|
||||||
|
if (vmap.insert(make_pair(V->Name, V)).second) {
|
||||||
|
DOUT << " Inserted value: " << V->Name << ": " << *V << "\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, there is a naming conflict. Rename this value.
|
||||||
std::string UniqueName = getUniqueName(V->getName());
|
std::string UniqueName = getUniqueName(V->getName());
|
||||||
|
|
||||||
DEBUG(DOUT << " Inserting value: " << UniqueName << ": " << *V << "\n");
|
DEBUG(DOUT << " Inserting value: " << UniqueName << ": " << *V << "\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user