FLANG
Public Types | Public Member Functions | List of all members
fir::factory::DoLoopHelper Class Reference

Helper to build fir.do_loop Ops. More...

#include <flang/Optimizer/Builder/DoLoopHelper.h>

Public Types

using BodyGenerator = std::function< void(fir::FirOpBuilder &, mlir::Value)>
 Type of a callback to generate the loop body.
 

Public Member Functions

 DoLoopHelper (fir::FirOpBuilder &builder, mlir::Location loc)
 
 DoLoopHelper (const DoLoopHelper &)=delete
 
fir::DoLoopOp createLoop (mlir::Value lb, mlir::Value ub, mlir::Value step, const BodyGenerator &bodyGenerator)
 
fir::DoLoopOp createLoop (mlir::Value lb, mlir::Value ub, const BodyGenerator &bodyGenerator)
 Build loop [lb, ub] with step 1.
 
fir::DoLoopOp createLoop (mlir::Value count, const BodyGenerator &bodyGenerator)
 Build loop [0, count) with step 1.
 

Detailed Description

Helper to build fir.do_loop Ops.

Member Function Documentation

◆ createLoop()

fir::DoLoopOp fir::factory::DoLoopHelper::createLoop ( mlir::Value  lb,
mlir::Value  ub,
mlir::Value  step,
const BodyGenerator bodyGenerator 
)

Build loop [lb, ub] with step step. If step is an empty value, 1 is used for the step.


The documentation for this class was generated from the following files: