FLANG
|
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. | |
Helper to build fir.do_loop Ops.
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.