diff options
| author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-12-22 19:08:01 +0000 |
|---|---|---|
| committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-12-22 19:08:01 +0000 |
| commit | 42df8d1db65ca12a816d7a73b60af6a4ea9602b3 (patch) | |
| tree | 11bcda7f94cf7bfe52f3057741300f1565e18767 /polly/lib/CodeGen/BlockGenerators.cpp | |
| parent | 0ee3f255210f76c095f5d8d2275c2d3a5efed009 (diff) | |
| download | bcm5719-llvm-42df8d1db65ca12a816d7a73b60af6a4ea9602b3.tar.gz bcm5719-llvm-42df8d1db65ca12a816d7a73b60af6a4ea9602b3.zip | |
Reduce indention in BlockGenerator::trySynthesizeNewValue [NFC]
llvm-svn: 256266
Diffstat (limited to 'polly/lib/CodeGen/BlockGenerators.cpp')
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index dc5d91ab9b0..ff7a35db537 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -63,30 +63,33 @@ Value *BlockGenerator::trySynthesizeNewValue(ScopStmt &Stmt, Value *Old, ValueMapT &BBMap, LoopToScevMapT <S, Loop *L) const { - if (SE.isSCEVable(Old->getType())) - if (const SCEV *Scev = SE.getSCEVAtScope(Old, L)) { - if (!isa<SCEVCouldNotCompute>(Scev)) { - const SCEV *NewScev = apply(Scev, LTS, SE); - ValueMapT VTV; - VTV.insert(BBMap.begin(), BBMap.end()); - VTV.insert(GlobalMap.begin(), GlobalMap.end()); - - Scop &S = *Stmt.getParent(); - const DataLayout &DL = - S.getRegion().getEntry()->getParent()->getParent()->getDataLayout(); - auto IP = Builder.GetInsertPoint(); - - assert(IP != Builder.GetInsertBlock()->end() && - "Only instructions can be insert points for SCEVExpander"); - Value *Expanded = expandCodeFor(S, SE, DL, "polly", NewScev, - Old->getType(), &*IP, &VTV); - - BBMap[Old] = Expanded; - return Expanded; - } - } + if (!SE.isSCEVable(Old->getType())) + return nullptr; - return nullptr; + const SCEV *Scev = SE.getSCEVAtScope(Old, L); + if (!Scev) + return nullptr; + + if (isa<SCEVCouldNotCompute>(Scev)) + return nullptr; + + const SCEV *NewScev = apply(Scev, LTS, SE); + ValueMapT VTV; + VTV.insert(BBMap.begin(), BBMap.end()); + VTV.insert(GlobalMap.begin(), GlobalMap.end()); + + Scop &S = *Stmt.getParent(); + const DataLayout &DL = + S.getRegion().getEntry()->getParent()->getParent()->getDataLayout(); + auto IP = Builder.GetInsertPoint(); + + assert(IP != Builder.GetInsertBlock()->end() && + "Only instructions can be insert points for SCEVExpander"); + Value *Expanded = + expandCodeFor(S, SE, DL, "polly", NewScev, Old->getType(), &*IP, &VTV); + + BBMap[Old] = Expanded; + return Expanded; } Value *BlockGenerator::getNewValue(ScopStmt &Stmt, Value *Old, ValueMapT &BBMap, |

