diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 283fcbc97a1..8cdccc6827f 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -121,14 +121,14 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { // ... to a pointer that has been stored to before... if (last) { - Instruction* dep = MD.getDependency(BBI); + Instruction* dep = const_cast<Instruction*>(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 = MD.getDependency(BBI, dep); + dep = const_cast<Instruction*>(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, - MD.getDependency(F), + const_cast<Instruction*>(MD.getDependency(F)), possiblyDead); // No known stores after the free last = 0; |