mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Fix a bug in codegenprep where it was losing track of values OptimizeMemoryInst
by switching to a ValueMap. Patch by Andrea DiBiagio! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/SmallSet.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/ADT/ValueMap.h"
|
||||
#include "llvm/Analysis/DominatorInternals.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include "llvm/Analysis/InstructionSimplify.h"
|
||||
@@ -88,7 +89,7 @@ namespace {
|
||||
/// Keeps track of non-local addresses that have been sunk into a block.
|
||||
/// This allows us to avoid inserting duplicate code for blocks with
|
||||
/// multiple load/stores of the same address.
|
||||
DenseMap<Value*, Value*> SunkAddrs;
|
||||
ValueMap<Value*, Value*> SunkAddrs;
|
||||
|
||||
/// ModifiedDT - If CFG is modified in anyway, dominator tree may need to
|
||||
/// be updated.
|
||||
@@ -1653,10 +1654,6 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
|
||||
// start of the block.
|
||||
CurInstIterator = BB->begin();
|
||||
SunkAddrs.clear();
|
||||
} else {
|
||||
// This address is now available for reassignment, so erase the table
|
||||
// entry; we don't want to match some completely different instruction.
|
||||
SunkAddrs[Addr] = 0;
|
||||
}
|
||||
}
|
||||
++NumMemoryInsts;
|
||||
|
Reference in New Issue
Block a user