FLANG
|
#include <flang/Optimizer/Builder/TemporaryStorage.h>
Public Member Functions | |
Counter (mlir::Location loc, fir::FirOpBuilder &builder, mlir::Value initialValue, bool canCountThroughLoops=true) | |
Create a counter set to the initial value. | |
mlir::Value | getAndIncrementIndex (mlir::Location loc, fir::FirOpBuilder &builder) |
Return "counter++". | |
void | reset (mlir::Location loc, fir::FirOpBuilder &builder) |
Set the counter to the initial value. | |
Public Attributes | |
const bool | canCountThroughLoops |
Structure to create and manipulate counters in generated code. They are used to keep track of the insertion of fetching position in the temporary storages. By default, this counter is implemented with a value in memory and can be incremented inside generated loops or branches. The option canCountThroughLoops can be set to false to get a counter that is a simple SSA value that is swap by its incremented value (hence, the counter cannot count through loops since the SSA value in the loop becomes inaccessible after the loop). This form helps reducing compile times for huge array constructors without implied-do-loops.