diff options
author | Devang Patel <dpatel@apple.com> | 2008-08-27 17:50:18 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-08-27 17:50:18 +0000 |
commit | 541532724e29203e28c2fe0136cf6eabd49d4532 (patch) | |
tree | a343ca1ad5f4ceb87458cd61c38cc29cf8d5a75d /lib/Transforms | |
parent | 505569dc9c0a9bc9687dfa0e8e9a90bcb8db7da0 (diff) |
Fix typos and whitespaces. Other cosmetic changes based on feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index c5a9c1f0a1..19095a6acf 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -44,8 +44,8 @@ using namespace llvm; STATISTIC(NumReduced , "Number of GEPs strength reduced"); STATISTIC(NumInserted, "Number of PHIs inserted"); STATISTIC(NumVariable, "Number of PHIs with variable strides"); -STATISTIC(NumEliminated , "Number of strides eliminated"); -STATISTIC(NumShadow , "Number of Shadow IVs optimized"); +STATISTIC(NumEliminated, "Number of strides eliminated"); +STATISTIC(NumShadow, "Number of Shadow IVs optimized"); namespace { @@ -1715,30 +1715,27 @@ void LoopStrengthReduce::OptimizeShadowIV(Loop *L) { for (std::vector<IVStrideUse>::iterator UI = SI->second.Users.begin(), E = SI->second.Users.end(); UI != E; /* empty */) { std::vector<IVStrideUse>::iterator CandidateUI = UI; - UI++; + ++UI; Instruction *ShadowUse = CandidateUI->User; const Type *DestTy = NULL; /* If shadow use is a int->float cast then insert a second IV - to elminate this cast. + to eliminate this cast. for (unsigned i = 0; i < n; ++i) foo((double)i); - is trnasformed into + is transformed into double d = 0.0; for (unsigned i = 0; i < n; ++i, ++d) foo(d); */ - UIToFPInst *UCast = dyn_cast<UIToFPInst>(CandidateUI->User); - if (UCast) + if (UIToFPInst *UCast = dyn_cast<UIToFPInst>(CandidateUI->User)) DestTy = UCast->getDestTy(); - else { - SIToFPInst *SCast = dyn_cast<SIToFPInst>(CandidateUI->User); - if (!SCast) continue; + else if (SIToFPInst *SCast = dyn_cast<SIToFPInst>(CandidateUI->User)) DestTy = SCast->getDestTy(); - } + if (!DestTy) continue; PHINode *PH = dyn_cast<PHINode>(ShadowUse->getOperand(0)); if (!PH) continue; @@ -1784,7 +1781,7 @@ void LoopStrengthReduce::OptimizeShadowIV(Loop *L) { /* Add new PHINode. */ PHINode *NewPH = PHINode::Create(DestTy, "IV.S.", PH); - /* create new icnrement. '++d' in above example. */ + /* create new increment. '++d' in above example. */ ConstantFP *CFP = ConstantFP::get(DestTy, C->getZExtValue()); BinaryOperator *NewIncr = BinaryOperator::Create(Incr->getOpcode(), |