diff options
-rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 43fec9a9e39..6f26d51dcaa 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -94,7 +94,7 @@ Value *BlockGenerator::getNewValue(ScopStmt &Stmt, Value *Old, ValueMapT &BBMap, // We assume constants never change. // This avoids map lookups for many calls to this function. if (isa<Constant>(Old)) - return const_cast<Value *>(Old); + return Old; if (Value *New = GlobalMap.lookup(Old)) { if (Value *NewRemapped = GlobalMap.lookup(New)) @@ -114,12 +114,12 @@ Value *BlockGenerator::getNewValue(ScopStmt &Stmt, Value *Old, ValueMapT &BBMap, // A scop-constant value defined by a global or a function parameter. if (isa<GlobalValue>(Old) || isa<Argument>(Old)) - return const_cast<Value *>(Old); + return Old; // A scop-constant value defined by an instruction executed outside the scop. if (const Instruction *Inst = dyn_cast<Instruction>(Old)) if (!Stmt.getParent()->getRegion().contains(Inst->getParent())) - return const_cast<Value *>(Old); + return Old; // The scalar dependence is neither available nor SCEVCodegenable. llvm_unreachable("Unexpected scalar dependence in region!"); |