aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/DeadStoreElimination.cpp6
-rw-r--r--lib/Transforms/Scalar/GVN.cpp6
-rw-r--r--lib/Transforms/Scalar/RedundantLoadElimination.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 283fcbc97a..8cdccc6827 100644
--- a/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/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;
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index edd11e8e49..b8b58bd003 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -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 = MD.getDependency(L);
+ Instruction* dep = const_cast<Instruction*>(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 = MD.getDependency(L, dep);
+ dep = const_cast<Instruction*>(MD.getDependency(L, dep));
}
}
diff --git a/lib/Transforms/Scalar/RedundantLoadElimination.cpp b/lib/Transforms/Scalar/RedundantLoadElimination.cpp
index 3b719df4f6..2dace31e30 100644
--- a/lib/Transforms/Scalar/RedundantLoadElimination.cpp
+++ b/lib/Transforms/Scalar/RedundantLoadElimination.cpp
@@ -80,7 +80,7 @@ bool RLE::runOnBasicBlock(BasicBlock &BB) {
LoadInst*& last = lastLoad[pointer];
// ... to a pointer that has been loaded from before...
- Instruction* dep = MD.getDependency(BBI);
+ Instruction* dep = const_cast<Instruction*>(MD.getDependency(BBI));
bool deletedLoad = false;
while (dep != MemoryDependenceAnalysis::None &&
@@ -120,7 +120,7 @@ bool RLE::runOnBasicBlock(BasicBlock &BB) {
break;
} else {
- dep = MD.getDependency(BBI, dep);
+ dep = const_cast<Instruction*>(MD.getDependency(BBI, dep));
}
}