[polly] r256266 - Reduce indention in BlockGenerator::trySynthesizeNewValue [NFC]
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 22 11:08:01 PST 2015
Author: jdoerfert
Date: Tue Dec 22 13:08:01 2015
New Revision: 256266
URL: http://llvm.org/viewvc/llvm-project?rev=256266&view=rev
Log:
Reduce indention in BlockGenerator::trySynthesizeNewValue [NFC]
Modified:
polly/trunk/lib/CodeGen/BlockGenerators.cpp
Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=256266&r1=256265&r2=256266&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Tue Dec 22 13:08:01 2015
@@ -63,30 +63,33 @@ Value *BlockGenerator::trySynthesizeNewV
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,
More information about the llvm-commits
mailing list