LLVM 22.0.0git
|
ScanInfo holds the information to assist in lowering of Scan reduction. More...
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
Public Member Functions | |
ScanInfo () | |
~ScanInfo () | |
Public Attributes | |
llvm::BasicBlock * | OMPBeforeScanBlock = nullptr |
Dominates the body of the loop before scan directive. | |
llvm::BasicBlock * | OMPAfterScanBlock = nullptr |
Dominates the body of the loop before scan directive. | |
llvm::BasicBlock * | OMPScanDispatch = nullptr |
Controls the flow to before or after scan blocks. | |
llvm::BasicBlock * | OMPScanLoopExit = nullptr |
Exit block of loop body. | |
llvm::BasicBlock * | OMPScanInit = nullptr |
Block before loop body where scan initializations are done. | |
llvm::BasicBlock * | OMPScanFinish = nullptr |
Block after loop body where scan finalizations are done. | |
bool | OMPFirstScanLoop = false |
If true, it indicates Input phase is lowered; else it indicates ScanPhase is lowered. | |
llvm::SmallDenseMap< llvm::Value *, llvm::Value * > * | ScanBuffPtrs |
Maps the private reduction variable to the pointer of the temporary buffer. | |
llvm::Value * | IV |
Keeps track of value of iteration variable for input/scan loop to be used for Scan directive lowering. | |
llvm::Value * | Span |
Stores the span of canonical loop being lowered to be used for temporary buffer allocation or Finalization. | |
ScanInfo holds the information to assist in lowering of Scan reduction.
Before lowering, the body of the for loop specifying scan reduction is expected to have the following structure
Loop Body Entry | Code before the scan directive | Scan Directive | Code after the scan directive | Loop Body Exit
When createCanonicalScanLoops
is executed, the bodyGen callback of it transforms the body to:
Loop Body Entry | OMPScanDispatch OMPBeforeScanBlock | OMPScanLoopExit | Loop Body Exit
The insert point is updated to the first insert point of OMPBeforeScanBlock. It dominates the control flow of code generated until scan directive is encountered and OMPAfterScanBlock dominates the control flow of code generated after scan is encountered. The successor of OMPScanDispatch can be OMPBeforeScanBlock or OMPAfterScanBlock based on 1.whether it is in Input phase or Scan Phase , 2. whether it is an exclusive or inclusive scan. This jump is added when createScan
is executed. If input loop is being generated, if it is inclusive scan, OMPAfterScanBlock
succeeds OMPScanDispatch
, if exclusive, OMPBeforeScanBlock
succeeds OMPDispatch
and vice versa for scan loop. At the end of the input loop, temporary buffer is populated and at the beginning of the scan loop, temporary buffer is read. After scan directive is encountered, insertion point is updated to OMPAfterScanBlock
as it is expected to dominate the code after the scan directive. Both Before and After scan blocks are succeeded by OMPScanLoopExit
. Temporary buffer allocations are done in ScanLoopInit
block before the lowering of for-loop. The results are copied back to reduction variable in ScanLoopFinish
block.
Definition at line 3959 of file OMPIRBuilder.h.
|
inline |
Definition at line 3995 of file OMPIRBuilder.h.
References ScanBuffPtrs.
|
inline |
Definition at line 3999 of file OMPIRBuilder.h.
References ScanBuffPtrs.
llvm::Value* llvm::ScanInfo::IV |
Keeps track of value of iteration variable for input/scan loop to be used for Scan directive lowering.
Definition at line 3989 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalLoop(), llvm::OpenMPIRBuilder::createCanonicalScanLoops(), and llvm::OpenMPIRBuilder::createScan().
llvm::BasicBlock* llvm::ScanInfo::OMPAfterScanBlock = nullptr |
Dominates the body of the loop before scan directive.
Definition at line 3965 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createScan().
llvm::BasicBlock* llvm::ScanInfo::OMPBeforeScanBlock = nullptr |
Dominates the body of the loop before scan directive.
Definition at line 3962 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops(), and llvm::OpenMPIRBuilder::createScan().
bool llvm::ScanInfo::OMPFirstScanLoop = false |
If true, it indicates Input phase is lowered; else it indicates ScanPhase is lowered.
Definition at line 3981 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createScan().
llvm::BasicBlock* llvm::ScanInfo::OMPScanDispatch = nullptr |
Controls the flow to before or after scan blocks.
Definition at line 3968 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops(), and llvm::OpenMPIRBuilder::createScan().
llvm::BasicBlock* llvm::ScanInfo::OMPScanFinish = nullptr |
Block after loop body where scan finalizations are done.
Definition at line 3977 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops().
llvm::BasicBlock* llvm::ScanInfo::OMPScanInit = nullptr |
Block before loop body where scan initializations are done.
Definition at line 3974 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops().
llvm::BasicBlock* llvm::ScanInfo::OMPScanLoopExit = nullptr |
Exit block of loop body.
Definition at line 3971 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops(), and llvm::OpenMPIRBuilder::createScan().
llvm::SmallDenseMap<llvm::Value *, llvm::Value *>* llvm::ScanInfo::ScanBuffPtrs |
Maps the private reduction variable to the pointer of the temporary buffer.
Definition at line 3985 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createScan(), llvm::OpenMPIRBuilder::emitScanReduction(), ScanInfo(), and ~ScanInfo().
llvm::Value* llvm::ScanInfo::Span |
Stores the span of canonical loop being lowered to be used for temporary buffer allocation or Finalization.
Definition at line 3993 of file OMPIRBuilder.h.
Referenced by llvm::OpenMPIRBuilder::createCanonicalScanLoops(), and llvm::OpenMPIRBuilder::emitScanReduction().