Commit fac80bee authored by Patrick Flynn's avatar Patrick Flynn
Browse files

Fixed error with loop being optimized away on higher optimization levels

parent b828adf3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -317,6 +317,10 @@ bool CodeGenFunction::EmitKokkosParallelFor(const CallExpr *CE,
  InductionVarDecl = EmitKokkosParallelForInductionVar(Lambda).at(0);
  EmitVarDecl(*InductionVarDecl);
  
  Address Addr = GetAddrOfLocalVar(InductionVarDecl);
  llvm::Value *Zero = llvm::ConstantInt::get(ConvertType(InductionVarDecl->getType()), 0);
  Builder.CreateStore(Zero, Addr);

   // Create the sync region. 
  PushSyncRegion();
  llvm::Instruction *SRStart = EmitSyncRegionStart();