Commit 9e688403 authored by Patrick Flynn's avatar Patrick Flynn Committed by Patrick McCormick
Browse files

Very slight cleanup to inner loop generator

parent 958f5a06
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -446,7 +446,11 @@ bool CodeGenFunction::EmitKokkosParallelFor(const CallExpr *CE,
  return true;
}

// This is in charge of building an inner loop
// This is in charge of building an inner loop. It works as a recursive function to allow the loops
// to actually end up being nested
//
// This should be usuable by any function that requires inner loops
//
bool CodeGenFunction::EmitKokkosInnerLoop(const CallExpr *CE, const LambdaExpr *Lambda,
            llvm::BasicBlock *TopBlock,
            std::queue<const Expr*> DimQueue,
@@ -468,9 +472,8 @@ bool CodeGenFunction::EmitKokkosInnerLoop(const CallExpr *CE, const LambdaExpr *
  llvm::BasicBlock *LoopBody = createBasicBlock("kokkos.forall.body" + std::to_string(pos));
  llvm::BasicBlock *Increment = createBasicBlock("kokkos.forall.inc" + std::to_string(pos));
  JumpDest EndDest = getJumpDestInCurrentScope("kokkos.forall.endlbl" + std::to_string(pos));
  llvm::BasicBlock *End = createBasicBlock("kokkos.forall.end" + std::to_string(pos));

  // Zero out the induction variable
  // Set the induction variable's starting point
  EmitBlock(InductionSet);
  llvm::Value *LoopStart = EmitScalarExpr(SE);
  Builder.CreateStore(LoopStart, GetAddrOfLocalVar(InductionVarDecl));
@@ -508,7 +511,6 @@ bool CodeGenFunction::EmitKokkosInnerLoop(const CallExpr *CE, const LambdaExpr *
  }

  EmitBlock(EndDest.getBlock());
  EmitBlock(End, true);
  
  return true;           
}