diff options
| author | Tobias Grosser <tobias@grosser.es> | 2017-01-19 13:25:52 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2017-01-19 13:25:52 +0000 |
| commit | 943c369c604a4aec859e051e066c5a255dc62391 (patch) | |
| tree | 82877b7f79ff4d86731e339c02cc8b38f0e76b1b | |
| parent | e01512cecfafe338ed965db5c700f807be70af83 (diff) | |
| download | bcm5719-llvm-943c369c604a4aec859e051e066c5a255dc62391.tar.gz bcm5719-llvm-943c369c604a4aec859e051e066c5a255dc62391.zip | |
BlockGenerator: remove obfuscating const and const casts
Making certain values 'const' to just cast it away a little later mainly
obfuscates the code. Hence, we just drop the 'const' parts.
Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 292480
| -rw-r--r-- | polly/include/polly/CodeGen/BlockGenerators.h | 4 | ||||
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h index dcf6bc6b9ff..38a85b7195d 100644 --- a/polly/include/polly/CodeGen/BlockGenerators.h +++ b/polly/include/polly/CodeGen/BlockGenerators.h @@ -824,7 +824,7 @@ private: DenseMap<BasicBlock *, ValueMapT> RegionMaps; /// Mapping to remember PHI nodes that still need incoming values. - using PHINodePairTy = std::pair<const PHINode *, PHINode *>; + using PHINodePairTy = std::pair<PHINode *, PHINode *>; DenseMap<BasicBlock *, SmallVector<PHINodePairTy, 4>> IncompletePHINodeMap; /// Repair the dominance tree after we created a copy block for @p BB. @@ -840,7 +840,7 @@ private: /// @param IncomingBB An incoming block of @p PHI. /// @param LTS A map from old loops to new induction variables as /// SCEVs. - void addOperandToPHI(ScopStmt &Stmt, const PHINode *PHI, PHINode *PHICopy, + void addOperandToPHI(ScopStmt &Stmt, PHINode *PHI, PHINode *PHICopy, BasicBlock *IncomingBB, LoopToScevMapT <S); /// Create a PHI that combines the incoming values from all incoming blocks diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index a18640911b4..46a066a1086 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -1400,7 +1400,7 @@ void RegionGenerator::generateScalarStores( } } -void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, const PHINode *PHI, +void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, PHINode *PHI, PHINode *PHICopy, BasicBlock *IncomingBB, LoopToScevMapT <S) { Region *StmtR = Stmt.getRegion(); @@ -1436,7 +1436,7 @@ void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, const PHINode *PHI, if (PHICopy->getBasicBlockIndex(BBCopy) >= 0) return; - Value *PHIOpAddr = getOrCreatePHIAlloca(const_cast<PHINode *>(PHI)); + Value *PHIOpAddr = getOrCreatePHIAlloca(PHI); OpCopy = new LoadInst(PHIOpAddr, PHIOpAddr->getName() + ".reload", BlockMap[IncomingBB]->getTerminator()); } |

