mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
Don't let the memory allocator outsmart GVN. ;-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b1f55ea24
commit
bf7d0bc4e5
@ -558,6 +558,11 @@ void ValueTable::clear() {
|
||||
nextValueNumber = 1;
|
||||
}
|
||||
|
||||
/// erase - Remove a value from the value numbering
|
||||
void ValueTable::erase(Value* V) {
|
||||
valueNumbering.erase(V);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ValueNumberedSet Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -871,6 +876,7 @@ bool GVN::processInstruction(Instruction* I,
|
||||
if (currAvail.test(num)) {
|
||||
Value* repl = find_leader(currAvail, num);
|
||||
|
||||
VN.erase(I);
|
||||
I->replaceAllUsesWith(repl);
|
||||
toErase.push_back(I);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user