mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Make NonLocal and None const in the right way. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40961 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -121,14 +121,14 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
||||
|
||||
// ... to a pointer that has been stored to before...
|
||||
if (last) {
|
||||
Instruction* dep = const_cast<Instruction*>(MD.getDependency(BBI));
|
||||
Instruction* dep = MD.getDependency(BBI);
|
||||
|
||||
// ... and no other memory dependencies are between them....
|
||||
while (dep != MemoryDependenceAnalysis::None &&
|
||||
dep != MemoryDependenceAnalysis::NonLocal &&
|
||||
isa<StoreInst>(dep)) {
|
||||
if (dep != last) {
|
||||
dep = const_cast<Instruction*>(MD.getDependency(BBI, dep));
|
||||
dep = MD.getDependency(BBI, dep);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
||||
if (FreeInst* F = dyn_cast<FreeInst>(BBI)) {
|
||||
if (!deletedStore)
|
||||
MadeChange |= handleFreeWithNonTrivialDependency(F,
|
||||
const_cast<Instruction*>(MD.getDependency(F)),
|
||||
MD.getDependency(F),
|
||||
possiblyDead);
|
||||
// No known stores after the free
|
||||
last = 0;
|
||||
|
@@ -803,7 +803,7 @@ bool GVN::processNonLocalLoad(LoadInst* L,
|
||||
return false;
|
||||
} else if (I->second == MemoryDependenceAnalysis::NonLocal) {
|
||||
continue;
|
||||
} else if (StoreInst* S = dyn_cast<StoreInst>(I->second)) {
|
||||
}else if (StoreInst* S = dyn_cast<StoreInst>(I->second)) {
|
||||
if (S->getPointerOperand() == L->getPointerOperand())
|
||||
repl[I->first] = S->getOperand(0);
|
||||
else
|
||||
@@ -856,7 +856,7 @@ bool GVN::processLoad(LoadInst* L,
|
||||
|
||||
// ... to a pointer that has been loaded from before...
|
||||
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
|
||||
Instruction* dep = const_cast<Instruction*>(MD.getDependency(L));
|
||||
Instruction* dep = MD.getDependency(L);
|
||||
if (dep == MemoryDependenceAnalysis::NonLocal &&
|
||||
L->getParent() != &L->getParent()->getParent()->getEntryBlock())
|
||||
processNonLocalLoad(L, toErase);
|
||||
@@ -895,7 +895,7 @@ bool GVN::processLoad(LoadInst* L,
|
||||
|
||||
break;
|
||||
} else {
|
||||
dep = const_cast<Instruction*>(MD.getDependency(L, dep));
|
||||
dep = MD.getDependency(L, dep);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ bool RLE::runOnBasicBlock(BasicBlock &BB) {
|
||||
LoadInst*& last = lastLoad[pointer];
|
||||
|
||||
// ... to a pointer that has been loaded from before...
|
||||
Instruction* dep = const_cast<Instruction*>(MD.getDependency(BBI));
|
||||
Instruction* dep = MD.getDependency(BBI);
|
||||
bool deletedLoad = false;
|
||||
|
||||
while (dep != MemoryDependenceAnalysis::None &&
|
||||
@@ -120,7 +120,7 @@ bool RLE::runOnBasicBlock(BasicBlock &BB) {
|
||||
|
||||
break;
|
||||
} else {
|
||||
dep = const_cast<Instruction*>(MD.getDependency(BBI, dep));
|
||||
dep = MD.getDependency(BBI, dep);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user