mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Don't DSe volatile stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -111,9 +111,12 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
||||
continue;
|
||||
|
||||
Value* pointer = 0;
|
||||
if (StoreInst* S = dyn_cast<StoreInst>(BBI))
|
||||
if (StoreInst* S = dyn_cast<StoreInst>(BBI)) {
|
||||
if (!S->isVolatile())
|
||||
pointer = S->getPointerOperand();
|
||||
else
|
||||
continue;
|
||||
} else
|
||||
pointer = cast<FreeInst>(BBI)->getPointerOperand();
|
||||
|
||||
StoreInst*& last = lastStore[pointer];
|
||||
@@ -194,6 +197,8 @@ bool DSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep,
|
||||
StoreInst* dependency = dyn_cast<StoreInst>(dep);
|
||||
if (!dependency)
|
||||
return false;
|
||||
else if (dependency->isVolatile())
|
||||
return false;
|
||||
|
||||
Value* depPointer = dependency->getPointerOperand();
|
||||
const Type* depType = dependency->getOperand(0)->getType();
|
||||
@@ -253,6 +258,7 @@ bool DSE::handleEndBlock(BasicBlock& BB,
|
||||
|
||||
// If we find a store whose pointer is dead...
|
||||
if (StoreInst* S = dyn_cast<StoreInst>(BBI)) {
|
||||
if (!S->isVolatile()) {
|
||||
Value* pointerOperand = S->getPointerOperand();
|
||||
// See through pointer-to-pointer bitcasts
|
||||
TranslatePointerBitCasts(pointerOperand);
|
||||
@@ -272,6 +278,7 @@ bool DSE::handleEndBlock(BasicBlock& BB,
|
||||
NumFastStores++;
|
||||
MadeChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user