diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-12-14 16:19:54 +0000 | 
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-12-14 16:19:54 +0000 | 
| commit | 6f764bbd9c3541172146305b42a042a3f84ef993 (patch) | |
| tree | 97b2339171000d3635e42e310a575a22b9efc3d0 | |
| parent | f727e387be5fd9e4cc39a484ec939371131930a9 (diff) | |
| download | bcm5719-llvm-6f764bbd9c3541172146305b42a042a3f84ef993.tar.gz bcm5719-llvm-6f764bbd9c3541172146305b42a042a3f84ef993.zip  | |
BlockGenerator: Drop unneeded const_casts
llvm-svn: 255505
| -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!");  | 

