minor cleanups
authorNadav Rotem <nrotem@apple.com>
Fri, 30 Nov 2012 22:37:11 +0000 (22:37 +0000)
committerNadav Rotem <nrotem@apple.com>
Fri, 30 Nov 2012 22:37:11 +0000 (22:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169048 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/LoopVectorize.cpp

index d55b7bd360926ec2dd7c9a9ab6d01587e0b1e87a..8be31dc86d2556fd01a44c06e136fff594da72a4 100644 (file)
@@ -712,7 +712,7 @@ SingleBlockLoopVectorizer::addRuntimeCheck(LoopVectorizationLegality *Legal,
     const SCEV *Sc = SE->getSCEV(Ptr);
 
     if (SE->isLoopInvariant(Sc, OrigLoop)) {
     const SCEV *Sc = SE->getSCEV(Ptr);
 
     if (SE->isLoopInvariant(Sc, OrigLoop)) {
-      DEBUG(dbgs() << "LV1: Adding RT check for a loop invariant ptr:" <<
+      DEBUG(dbgs() << "LV: Adding RT check for a loop invariant ptr:" <<
             *Ptr <<"\n");
       Starts.push_back(Ptr);
       Ends.push_back(Ptr);
             *Ptr <<"\n");
       Starts.push_back(Ptr);
       Ends.push_back(Ptr);
@@ -1423,11 +1423,7 @@ void SingleBlockLoopVectorizer::updateAnalysis() {
 }
 
 bool LoopVectorizationLegality::canVectorize() {
 }
 
 bool LoopVectorizationLegality::canVectorize() {
-  if (!TheLoop->getLoopPreheader()) {
-    assert(false && "No preheader!!");
-    DEBUG(dbgs() << "LV: Loop not normalized." << "\n");
-    return false;
-  }
+  assert(TheLoop->getLoopPreheader() && "No preheader!!");
 
   // We can only vectorize single basic block loops.
   unsigned NumBlocks = TheLoop->getNumBlocks();
 
   // We can only vectorize single basic block loops.
   unsigned NumBlocks = TheLoop->getNumBlocks();
@@ -2008,9 +2004,8 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I, unsigned VF) {
     case Instruction::AShr:
     case Instruction::And:
     case Instruction::Or:
     case Instruction::AShr:
     case Instruction::And:
     case Instruction::Or:
-    case Instruction::Xor: {
+    case Instruction::Xor:
       return VTTI->getArithmeticInstrCost(I->getOpcode(), VectorTy);
       return VTTI->getArithmeticInstrCost(I->getOpcode(), VectorTy);
-    }
     case Instruction::Select: {
       SelectInst *SI = cast<SelectInst>(I);
       const SCEV *CondSCEV = SE->getSCEV(SI->getCondition());
     case Instruction::Select: {
       SelectInst *SI = cast<SelectInst>(I);
       const SCEV *CondSCEV = SE->getSCEV(SI->getCondition());