summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-05-10 00:32:31 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-05-10 00:32:31 +0000
commit0b6518d24e327aac110e191dce4a8cc2b0e70dbf (patch)
tree6ccf55f46386b846230b4fc00e712502587c5bd8 /llvm
parent2512d0c8375d43b2d55e6c10f28f6c82c746269d (diff)
downloadbcm5719-llvm-0b6518d24e327aac110e191dce4a8cc2b0e70dbf.tar.gz
bcm5719-llvm-0b6518d24e327aac110e191dce4a8cc2b0e70dbf.zip
[SCEVExpander] Clang format expressions; NFC
The boolean expressions are somewhat hard to read otherwise. llvm-svn: 268998
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 83abb8f32a6..86c7bb9e289 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -1777,8 +1777,8 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
if (!OrigPhiRef) {
OrigPhiRef = Phi;
- if (Phi->getType()->isIntegerTy() && TTI
- && TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
+ if (Phi->getType()->isIntegerTy() && TTI &&
+ TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
// This phi can be freely truncated to the narrowest phi type. Map the
// truncated expression to it so it will be reused for narrow types.
const SCEV *TruncExpr =
@@ -1802,11 +1802,11 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
// If this phi has the same width but is more canonical, replace the
// original with it. As part of the "more canonical" determination,
// respect a prior decision to use an IV chain.
- if (OrigPhiRef->getType() == Phi->getType()
- && !(ChainedPhis.count(Phi)
- || isExpandedAddRecExprPHI(OrigPhiRef, OrigInc, L))
- && (ChainedPhis.count(Phi)
- || isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
+ if (OrigPhiRef->getType() == Phi->getType() &&
+ !(ChainedPhis.count(Phi) ||
+ isExpandedAddRecExprPHI(OrigPhiRef, OrigInc, L)) &&
+ (ChainedPhis.count(Phi) ||
+ isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
std::swap(OrigPhiRef, Phi);
std::swap(OrigInc, IsomorphicInc);
}
@@ -1818,14 +1818,13 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
// cycles that had postinc uses.
const SCEV *TruncExpr = SE.getTruncateOrNoop(SE.getSCEV(OrigInc),
IsomorphicInc->getType());
- if (OrigInc != IsomorphicInc
- && TruncExpr == SE.getSCEV(IsomorphicInc)
- && SE.LI.replacementPreservesLCSSAForm(IsomorphicInc, OrigInc)
- && ((isa<PHINode>(OrigInc) && isa<PHINode>(IsomorphicInc))
- || hoistIVInc(OrigInc, IsomorphicInc))) {
- DEBUG_WITH_TYPE(DebugType, dbgs()
- << "INDVARS: Eliminated congruent iv.inc: "
- << *IsomorphicInc << '\n');
+ if (OrigInc != IsomorphicInc && TruncExpr == SE.getSCEV(IsomorphicInc) &&
+ SE.LI.replacementPreservesLCSSAForm(IsomorphicInc, OrigInc) &&
+ ((isa<PHINode>(OrigInc) && isa<PHINode>(IsomorphicInc)) ||
+ hoistIVInc(OrigInc, IsomorphicInc))) {
+ DEBUG_WITH_TYPE(DebugType,
+ dbgs() << "INDVARS: Eliminated congruent iv.inc: "
+ << *IsomorphicInc << '\n');
Value *NewInc = OrigInc;
if (OrigInc->getType() != IsomorphicInc->getType()) {
Instruction *IP = nullptr;
@@ -1843,8 +1842,8 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
DeadInsts.emplace_back(IsomorphicInc);
}
}
- DEBUG_WITH_TYPE(DebugType, dbgs()
- << "INDVARS: Eliminated congruent iv: " << *Phi << '\n');
+ DEBUG_WITH_TYPE(DebugType, dbgs() << "INDVARS: Eliminated congruent iv: "
+ << *Phi << '\n');
++NumElim;
Value *NewIV = OrigPhiRef;
if (OrigPhiRef->getType() != Phi->getType()) {
OpenPOWER on IntegriCloud