|
MLIR 24.0.0git
|
#include "mlir/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.h"#include "mlir/Analysis/TopologicalSortUtils.h"#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/LLVMIR/LLVMDialect.h"#include "mlir/Dialect/LLVMIR/LLVMTypes.h"#include "mlir/Dialect/OpenMP/OpenMPDialect.h"#include "mlir/Dialect/OpenMP/OpenMPInterfaces.h"#include "mlir/Dialect/OpenMP/Utils/Utils.h"#include "mlir/IR/Operation.h"#include "mlir/Interfaces/SideEffectInterfaces.h"#include "mlir/Support/LLVM.h"#include "mlir/Target/LLVMIR/Dialect/OpenMPCommon.h"#include "mlir/Target/LLVMIR/ModuleTranslation.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Frontend/OpenMP/OMPConstants.h"#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/ReplaceConstant.h"#include "llvm/Support/AMDGPUAddrSpace.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/NVPTXAddrSpace.h"#include "llvm/Support/SaveAndRestore.h"#include "llvm/Support/VirtualFileSystem.h"#include "llvm/TargetParser/Triple.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include <cstdint>#include <iterator>#include <numeric>#include <optional>#include <utility>Go to the source code of this file.
Classes | |
| struct | ComplexComparePattern |
| Result of matching the decomposed complex equality pattern inside an atomic compare region. More... | |
| struct | AtomicComparePatternInfo |
| Holds the extracted comparison pattern information from an atomic compare region. More... | |
Typedefs | |
| using | IteratorStoreEntryTy |
Functions | |
| static llvm::Expected< llvm::Value * > | getPrivateDataAddress (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, omp::PrivateClauseOp privatizer, llvm::Value *var) |
| Returns the address of the data in var, via the data_address region. | |
| static OpenMPTranslationState & | getOpenMPState (LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::OpenMPIRBuilder * | getOpenMPBuilder (LLVM::ModuleTranslation &moduleTranslation) |
| Returns the OpenMP IR builder associated with the LLVM IR module being constructed. | |
| static llvm::CanonicalLoopInfo * | lookupOMPLoop (LLVM::ModuleTranslation &moduleTranslation, Value mlir) |
| Find the LLVM-IR loop that represents an MLIR loop. | |
| static void | invalidateOmpLoop (LLVM::ModuleTranslation &moduleTranslation, Value mlir) |
| Mark an OpenMP loop as having been consumed. | |
| static void | mapOmpLoop (LLVM::ModuleTranslation &moduleTranslation, Value mlir, llvm::CanonicalLoopInfo *llvm) |
| Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo. | |
| static omp::PrivateClauseOp | findPrivatizer (Operation *from, SymbolRefAttr symbolName) |
| Looks up from the operation from and returns the PrivateClauseOp with name symbolName. | |
| static LogicalResult | checkImplementationStatus (Operation &op) |
| Check whether translation to LLVM IR for the given operation is currently supported. | |
| static LogicalResult | handleError (llvm::Error error, Operation &op) |
| template<typename T> | |
| static LogicalResult | handleError (llvm::Expected< T > &result, Operation &op) |
| static llvm::OpenMPIRBuilder::InsertPointTy | findAllocInsertPoints (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::SmallVectorImpl< llvm::BasicBlock * > *deallocBlocks=nullptr) |
| Find the insertion point for allocas given the current insertion point for normal operations in the builder. | |
| static llvm::CanonicalLoopInfo * | findCurrentLoopInfo (LLVM::ModuleTranslation &moduleTranslation) |
| Find the loop information structure for the loop nest being translated. | |
| static llvm::Expected< llvm::BasicBlock * > | convertOmpOpRegions (Region ®ion, StringRef blockName, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, SmallVectorImpl< llvm::PHINode * > *continuationBlockPHIs=nullptr) |
| Converts the given region that appears within an OpenMP dialect operation to LLVM IR, creating a branch from the sourceBlock to the entry block of the region, and a branch from any block with an successor-less OpenMP terminator to continuationBlock. | |
| static llvm::omp::ProcBindKind | getProcBindKind (omp::ClauseProcBindKind kind) |
| Convert ProcBindKind from MLIR-generated enum to LLVM enum. | |
| static LogicalResult | convertOmpDispatch (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Convert 'dispatch' operation into LLVM IR. | |
| static LogicalResult | convertOmpMasked (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP 'masked' operation into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpMaster (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP 'master' operation into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpCritical (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP 'critical' operation into LLVM IR using OpenMPIRBuilder. | |
| template<typename T> | |
| static void | collectReductionDecls (T op, SmallVectorImpl< omp::DeclareReductionOp > &reductions) |
| Populates reductions with reduction declarations used in the given op. | |
| static LogicalResult | collectAndValidateTaskloopRedDecls (Operation *contextOp, std::optional< ArrayAttr > syms, StringRef opName, StringRef clauseName, SmallVectorImpl< omp::DeclareReductionOp > &out) |
| Look up and validate the declare_reduction ops referenced by a reduction-like clause on the omp.taskloop.context translation path. | |
| static LogicalResult | inlineConvertOmpRegions (Region ®ion, StringRef blockName, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, SmallVectorImpl< llvm::Value * > *continuationBlockArgs=nullptr) |
| Translates the blocks contained in the given region and appends them to at the current insertion point of builder. | |
| static OwningReductionGen | makeReductionGen (omp::DeclareReductionOp decl, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Create an OpenMPIRBuilder-compatible reduction generator for the given reduction declaration. | |
| static OwningAtomicReductionGen | makeAtomicReductionGen (omp::DeclareReductionOp decl, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Create an OpenMPIRBuilder-compatible atomic reduction generator for the given reduction declaration. | |
| static OwningDataPtrPtrReductionGen | makeRefDataPtrGen (omp::DeclareReductionOp decl, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, bool isByRef) |
| Create an OpenMPIRBuilder-compatible data_ptr_ptr reduction generator for the given reduction declaration. | |
| static LogicalResult | convertOmpOrdered (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP 'ordered' operation into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpOrderedRegion (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP 'ordered_region' operation into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | allocReductionVars (Operation &op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, const llvm::OpenMPIRBuilder::InsertPointTy &allocaIP, ReductionVarsInfo &redInfo) |
| Allocate space for privatized reduction variables. | |
| static void | mapInitializationArgs (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, const ReductionVarsInfo::VarInfo &redVarInfo) |
| Map input arguments to reduction initialization region. | |
| static void | setInsertPointForPossiblyEmptyBlock (llvm::IRBuilderBase &builder, llvm::BasicBlock *block=nullptr) |
| allocatedType moduleTranslation static convertType(allocatedType) LogicalResult | inlineOmpRegionCleanup (llvm::SmallVectorImpl< Region * > &cleanupRegions, llvm::ArrayRef< llvm::Value * > privateVariables, LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, StringRef regionName, bool shouldLoadCleanupRegionArg=true) |
| handling of DeclareReductionOp's cleanup region | |
| static LogicalResult | createReductionsAndCleanup (Operation &op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::OpenMPIRBuilder::InsertPointTy &allocaIP, ReductionVarsInfo &redInfo, bool isNowait=false, bool isTeamsReduction=false) |
| static LogicalResult | allocAndInitializeReductionVars (Operation &op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::OpenMPIRBuilder::InsertPointTy &allocaIP, ReductionVarsInfo &redInfo) |
| static llvm::Value * | findAssociatedValue (Value privateVar, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::DenseMap< Value, Value > *mappedPrivateVars=nullptr) |
| Return the llvm::Value * corresponding to the privateVar that is being privatized. It isn't always as simple as looking up moduleTranslation with privateVar. For instance, in case of an allocatable, the descriptor for the allocatable is privatized. This descriptor is mapped using an MapInfoOp. So, this function will return a pointer to the llvm::Value corresponding to the block argument for the mapped descriptor. | |
| static llvm::Value * | materializeRegionArgValue (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, BlockArgument regionArg, llvm::Value *value) |
| static llvm::Expected< llvm::Value * > | initPrivateVar (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, omp::PrivateClauseOp &privDecl, llvm::Value *nonPrivateVar, BlockArgument &blockArg, llvm::Value *llvmPrivateVar, llvm::BasicBlock *privInitBlock, llvm::DenseMap< Value, Value > *mappedPrivateVars=nullptr) |
| Initialize a single (first)private variable. You probably want to use allocateAndInitPrivateVars instead of this. This returns the private variable which has been initialized. This variable should be mapped before constructing the body of the Op. | |
| static llvm::Expected< llvm::Value * > | initPrivateVar (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, omp::PrivateClauseOp &privDecl, Value mlirPrivVar, BlockArgument &blockArg, llvm::Value *llvmPrivateVar, llvm::BasicBlock *privInitBlock, llvm::DenseMap< Value, Value > *mappedPrivateVars=nullptr) |
| Version of initPrivateVar which looks up the nonPrivateVar from mlirPrivVar. | |
| static llvm::Error | initPrivateVars (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, PrivateVarsInfo &privateVarsInfo, llvm::DenseMap< Value, Value > *mappedPrivateVars=nullptr) |
| static LogicalResult | convertAllocatorVars (Operation &op, ValueRange allocatorVars, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, PrivateVarsInfo &privateVarsInfo) |
| template<typename T> | |
| static llvm::Expected< llvm::BasicBlock * > | allocatePrivateVars (T op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, PrivateVarsInfo &privateVarsInfo, llvm::OpenMPIRBuilder::InsertPointTy &allocaIP, llvm::DenseMap< Value, Value > *mappedPrivateVars=nullptr, std::optional< llvm::OpenMPIRBuilder::InsertPointTy > allocatorIP=std::nullopt) |
| Allocate and initialize delayed private variables. Returns the basic block which comes after all of these allocations. llvm::Value * for each of these private variables are populated in llvmPrivateVars. | |
| static bool | opMightBeSafeForBarriers (mlir::Operation *op) |
| A compiler-generated barrier is unsafe when only part of the current team can reach it. This cannot always be determined statically (e.g. across a function call), but the enclosing OpenMP constructs can rule it out. | |
| static LogicalResult | emitPrivatizationBarrier (mlir::Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | completePrivateVars (mlir::Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, const PrivateVarsInfo &privateVarsInfo, bool insertBarrier, ArrayRef< llvm::Value * > moldVars={}, ArrayRef< llvm::Value * > llvmPrivateVars={}, DenseMap< Value, Value > *mappedPrivateVars=nullptr) |
| Applies the firstprivate copy region for each variable, pairing the mold values with the private allocations and privatizer declarations from privateVarsInfo, and emits a barrier if requested. | |
| template<typename T> | |
| static LogicalResult | cleanupPrivateVars (T op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, Location loc, PrivateVarsInfo &privateVarsInfo) |
| static bool | constructIsCancellable (Operation *op) |
| Returns true if the construct contains omp.cancel or omp.cancellation_point. | |
| static llvm::Value * | emitTaskReductionInitCall (ArrayRef< omp::DeclareReductionOp > redDecls, ArrayRef< llvm::Value * > origPtrs, StringRef helperNamePrefix, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder::InsertPointTy allocaIP, LLVM::ModuleTranslation &moduleTranslation, bool isModifier, bool isWorksharing) |
Emit the per-taskgroup task_reduction descriptor array and the __kmpc_taskred_init runtime call. origPtrs holds the LLVM values for the original (shared) variables, one per declaration in redDecls. builder must be set to the point at which the descriptor stores and the init call should be emitted; the descriptor array itself is allocated at allocaIP. helperNamePrefix is used to disambiguate the generated init/combiner helper symbol names between taskgroup and taskloop callers. | |
| static void | emitTaskReductionModifierFini (bool isWorksharing, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Emits __kmpc_task_reduction_modifier_fini(loc, gtid, is_ws) at the current builder insertion point, closing the task-reduction scope opened by the task reduction modifier on a parallel or worksharing construct. | |
| template<typename OpTy> | |
| static llvm::Value * | emitTaskReductionModifierInitCall (OpTy op, ArrayRef< omp::DeclareReductionOp > reductionDecls, ArrayRef< llvm::Value * > privateReductionVariables, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder::InsertPointTy allocaIP, LLVM::ModuleTranslation &moduleTranslation, bool isWorksharing) |
| Register only the task-modified items. All items still participate in the enclosing construct's ordinary reduction combination and cleanup. | |
| static LogicalResult | convertOmpSections (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpScope (omp::ScopeOp &scopeOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP scope construct into LLVM IR. | |
| static LogicalResult | convertOmpSingle (omp::SingleOp &singleOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP single construct into LLVM IR using OpenMPIRBuilder. | |
| static omp::DistributeOp | getDistributeCapturingTeamsReduction (omp::TeamsOp teamsOp) |
| static LogicalResult | convertOmpTeams (omp::TeamsOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::omp::RTLDependenceKindTy | convertDependKind (mlir::omp::ClauseTaskDepend kind) |
| static void | buildDependDataLocator (std::optional< ArrayAttr > dependKinds, OperandRange dependVars, LLVM::ModuleTranslation &moduleTranslation, SmallVectorImpl< llvm::OpenMPIRBuilder::DependData > &dds) |
| static void | pushCancelFinalizationCB (SmallVectorImpl< llvm::UncondBrInst * > &cancelTerminators, llvm::IRBuilderBase &llvmBuilder, llvm::OpenMPIRBuilder &ompBuilder, mlir::Operation *op, llvm::omp::Directive cancelDirective) |
Shared implementation of a callback which adds a termiator for the new block created for the branch taken when an openmp construct is cancelled. The terminator is saved in cancelTerminators. This callback is invoked only if there is cancellation inside of the taskgroup body. The terminator will need to be fixed to branch to the correct block to cleanup the construct. | |
| static void | popCancelFinalizationCB (const ArrayRef< llvm::UncondBrInst * > cancelTerminators, llvm::OpenMPIRBuilder &ompBuilder, llvm::BasicBlock *afterBB) |
| If we cancelled the construct, we should branch to the finalization block of that construct. OMPIRBuilder structures the CFG such that the cleanup block is immediately before the continuation block. Now this finalization has been created we can fix the branch. | |
| static void | storeAffinityEntry (llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, llvm::Value *affinityList, llvm::Value *index, llvm::Value *addr, llvm::Value *len) |
| static void | fillAffinityLocators (Operation::operand_range affinityVars, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::Value *affinityList) |
| static mlir::LogicalResult | convertIteratorRegion (llvm::Value *linearIV, IteratorInfo &iterInfo, mlir::Region &iteratorRegion, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static mlir::LogicalResult | fillIteratorLoop (mlir::omp::IteratorOp itersOp, llvm::IRBuilderBase &builder, mlir::LLVM::ModuleTranslation &moduleTranslation, IteratorInfo &iterInfo, llvm::StringRef loopName, IteratorStoreEntryTy genStoreEntry) |
| static mlir::LogicalResult | buildAffinityData (mlir::omp::TaskOp &taskOp, llvm::IRBuilderBase &builder, mlir::LLVM::ModuleTranslation &moduleTranslation, llvm::OpenMPIRBuilder::AffinityData &ad) |
| static mlir::LogicalResult | buildDependData (OperandRange dependVars, std::optional< ArrayAttr > dependKinds, OperandRange dependIterated, std::optional< ArrayAttr > dependIteratedKinds, llvm::IRBuilderBase &builder, mlir::LLVM::ModuleTranslation &moduleTranslation, llvm::OpenMPIRBuilder::DependenciesInfo &taskDeps) |
| static LogicalResult | convertOmpTaskOp (omp::TaskOp taskOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP task construct into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpTaskloopWrapperOp (omp::TaskloopWrapperOp loopWrapperOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| The correct entry point is convertOmpTaskloopContextOp. This gets called whilst lowering the body of the taskloop context (i.e. the task function). | |
| static llvm::Expected< llvm::Value * > | lookupOrTranslatePureValue (Value value, LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder) |
| Look up the given value in the mapping, and if it's not there, translate its defining operation at the current builder insertion point. Only pure, regionless operations are supported because the same operation will later be translated again when the taskloop body itself is lowered. | |
| static llvm::Error | computeTaskloopBounds (omp::LoopNestOp loopOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::Value *&lbVal, llvm::Value *&ubVal, llvm::Value *&stepVal) |
| static LogicalResult | convertOmpTaskloopContextOp (omp::TaskloopContextOp contextOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::Function * | emitTaskReductionInitFn (omp::DeclareReductionOp decl, StringRef baseName, LLVM::ModuleTranslation &moduleTranslation) |
| Build an outlined init helper for a task_reduction declare_reduction op. Signature: void(ptr priv, ptr orig). For non-byref reductions, the init region's mold argument is mapped following the same rule as the regular reduction path (mapInitializationArgs): a non-pointer mold loads the value from orig, while a pointer-typed mold receives orig directly. The yielded value is stored into priv. | |
| static llvm::Function * | emitTaskReductionCombFn (omp::DeclareReductionOp decl, StringRef baseName, LLVM::ModuleTranslation &moduleTranslation) |
| Build an outlined combiner helper for a task_reduction declare_reduction op. Signature: void(ptr lhs, ptr rhs). For non-byref reductions, the values at *lhs and *rhs are loaded, fed into the combiner region, and the yielded scalar is stored back into *lhs. | |
| static LogicalResult | convertOmpTaskgroupOp (omp::TaskgroupOp tgOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP taskgroup construct into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpInteropInitOp (omp::InteropInitOp initOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpInteropDestroyOp (omp::InteropDestroyOp destroyOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpInteropUseOp (omp::InteropUseOp useOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpTaskwaitOp (omp::TaskwaitOp twOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpWsloop (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP workshare loop into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpParallel (omp::ParallelOp opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts the OpenMP parallel operation to LLVM IR. | |
| static llvm::omp::OrderKind | convertOrderKind (std::optional< omp::ClauseOrderKind > o) |
| Convert Order attribute to llvm::omp::OrderKind. | |
| static LogicalResult | convertOmpSimd (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP simd loop into LLVM IR using OpenMPIRBuilder. | |
| static llvm::OpenMPIRBuilder::CollapseIVMapping | selectCollapseIVMapping (omp::LoopNestOp loopOp, bool isTargetDevice) |
| Select Virtual only for two host worksharing loops. | |
| static LogicalResult | convertOmpLoopNest (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP loop nest into LLVM IR using OpenMPIRBuilder. | |
| static LogicalResult | convertOmpCanonicalLoopOp (omp::CanonicalLoopOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Convert an omp.canonical_loop to LLVM-IR. | |
| static LogicalResult | applyUnrollHeuristic (omp::UnrollHeuristicOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Apply a #pragma omp unroll / "!$omp unroll" transformation using the OpenMPIRBuilder. | |
| static LogicalResult | applyUnrollFull (omp::UnrollFullOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Apply a #pragma omp unroll full / !$omp unroll full transformation using the OpenMPIRBuilder. | |
| static LogicalResult | applyUnrollPartial (omp::UnrollPartialOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Apply a #pragma omp unroll partial / !$omp unroll partial transformation using the OpenMPIRBuilder. | |
| static LogicalResult | applyTile (omp::TileOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Apply a #pragma omp tile / !$omp tile transformation using the OpenMPIRBuilder. | |
| static LogicalResult | applyFuse (omp::FuseOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Apply a #pragma omp fuse / !$omp fuse transformation using the OpenMPIRBuilder. | |
| static llvm::AtomicOrdering | convertAtomicOrdering (std::optional< omp::ClauseMemoryOrderKind > ao) |
| Convert an Atomic Ordering attribute to llvm::AtomicOrdering. | |
| static llvm::AtomicOrdering | getAtomicCompareFailureOrdering (omp::AtomicCompareOp atomicCompareOp, llvm::AtomicOrdering atomicOrdering) |
| Compute the cmpxchg failure ordering for an atomic compare op: use the fail clause ordering when present (the verifier guarantees it is a valid cmpxchg failure ordering), otherwise the strongest failure ordering derived from the success ordering (which matches the OpenMPIRBuilder default). | |
| static LogicalResult | convertOmpAtomicRead (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Convert omp.atomic.read operation to LLVM IR. | |
| static LogicalResult | convertOmpAtomicWrite (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an omp.atomic.write operation to LLVM IR. | |
| static llvm::AtomicRMWInst::BinOp | convertBinOpToAtomic (Operation &op) |
| Converts an LLVM dialect binary operation to the corresponding enum value for atomicrmw supported binary operation. | |
| static void | extractAtomicControlFlags (omp::AtomicUpdateOp atomicUpdateOp, bool &isIgnoreDenormalMode, bool &isFineGrainedMemory, bool &isRemoteMemory) |
| static LogicalResult | convertOmpAtomicUpdate (omp::AtomicUpdateOp &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP atomic update operation using OpenMPIRBuilder. | |
| static std::optional< llvm::omp::OMPAtomicCompareOp > | convertICmpPredicateToAtomicCompareOp (LLVM::ICmpPredicate predicate) |
| Helper to extract the OMPAtomicCompareOp from an integer comparison predicate. Returns std::nullopt for unsupported predicates. | |
| static std::optional< llvm::omp::OMPAtomicCompareOp > | convertFCmpPredicateToAtomicCompareOp (LLVM::FCmpPredicate predicate) |
| Helper to extract the OMPAtomicCompareOp from a floating-point comparison predicate. Returns std::nullopt for unsupported predicates. | |
| static ComplexComparePattern | detectComplexCompareEq (Block &block) |
| Detect a decomposed complex equality comparison in an atomic compare region: re_x = llvm.extractvalue xval[0] re_e = llvm.extractvalue eStruct[0] cmp_re = llvm.fcmp "oeq" re_x, re_e im_x = llvm.extractvalue xval[1] im_e = llvm.extractvalue eStruct[1] cmp_im = llvm.fcmp "oeq" im_x, im_e cmp = llvm.and cmp_re, cmp_im (llvm.or would be NE) It is recognised by an and/or whose operands are both fcmps operating on extractvalues, one chain rooted at the block argument (x) and the other at the expected complex value (e). | |
| static void | emitComplexAtomicCmpXchg (llvm::IRBuilderBase &builder, llvm::Value *llvmX, llvm::Type *complexTy, llvm::Value *eVal, llvm::Value *dVal, llvm::AtomicOrdering atomicOrdering, llvm::AtomicOrdering failOrdering, bool isWeak, llvm::Value *&oldComplex, llvm::Value *&cmpOk) |
Emit an IEEE-754-correct cmpxchg for a complex (struct-typed) atomic compare with fcmp oeq. The old value of X is returned (as the complex struct type) in oldComplex and the success flag (i1) in cmpOk. failOrdering is the memory ordering used when the compare-exchange does not store; it must be a valid cmpxchg failure ordering. | |
| static LogicalResult | extractAtomicComparePattern (Block &block, llvm::function_ref< llvm::Value *(mlir::Value)> materializeValue, omp::AtomicCompareOp atomicCompareOp, AtomicComparePatternInfo &info) |
| Extract comparison predicate, expected value (e), desired value (d), and related flags from an atomic compare region block by scanning for icmp/fcmp/select/min/max operations. | |
| static LogicalResult | convertOmpAtomicCapture (omp::AtomicCaptureOp atomicCaptureOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpAtomicCompare (omp::AtomicCompareOp atomicCompareOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an omp.atomic.compare operation to LLVM IR. | |
| static llvm::omp::Directive | convertCancellationConstructType (omp::ClauseCancellationConstructType directive) |
| static LogicalResult | convertOmpCancel (omp::CancelOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpCancellationPoint (omp::CancellationPointOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpThreadprivate (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP Threadprivate operation into LLVM IR using OpenMPIRBuilder. | |
| static llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind | convertToDeviceClauseKind (mlir::omp::DeclareTargetDeviceType deviceClause) |
| static llvm::OffloadEntriesInfoManager::OMPTargetGlobalVarEntryKind | convertToCaptureClauseKind (mlir::omp::DeclareTargetCaptureClause captureClause) |
| static Operation * | getGlobalOpFromValue (Value value) |
| static Value | getBaseValueForTypeLookup (Value value) |
| static llvm::Type * | getAllocatedLlvmTypeForVariable (Value var, Value baseVar, LLVM::ModuleTranslation &moduleTranslation) |
| static std::optional< llvm::Value * > | getDynamicAllocatedSize (Value var, Value baseVar, LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, const llvm::DataLayout &dataLayout) |
| static llvm::SmallString< 64 > | getDeclareTargetRefPtrSuffix (LLVM::GlobalOp globalOp, llvm::OpenMPIRBuilder &ompBuilder, llvm::vfs::FileSystem &vfs) |
| static bool | isDeclareTargetLink (Value value) |
| static bool | isDeclareTargetTo (Value value) |
| static llvm::Value * | getRefPtrIfDeclareTarget (Value value, LLVM::ModuleTranslation &moduleTranslation) |
| static uint64_t | getArrayElementSizeInBits (LLVM::LLVMArrayType arrTy, DataLayout &dl) |
| static bool | checkIfPointerMap (omp::MapInfoOp mapOp) |
| static bool | isPrivatizeableAttachMap (omp::ClauseMapFlags mapType) |
| static llvm::Value * | getSizeInBytes (DataLayout &dl, const mlir::Type &type, Operation *clauseOp, llvm::Value *basePointer, llvm::Type *baseType, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::omp::OpenMPOffloadMappingFlags | convertClauseMapFlags (omp::ClauseMapFlags mlirFlags) |
| static StringRef | getMapClauseName (omp::MapInfoOp mapOp) |
| static void | collectMapDataFromMapOperands (MapInfoData &mapData, SmallVectorImpl< Value > &mapVars, LLVM::ModuleTranslation &moduleTranslation, DataLayout &dl, llvm::IRBuilderBase &builder, ArrayRef< Value > useDevPtrOperands={}, ArrayRef< Value > useDevAddrOperands={}, ArrayRef< Value > hasDevAddrOperands={}) |
| static int | getMapDataMemberIdx (MapInfoData &mapData, omp::MapInfoOp memberOp) |
| static void | sortMapIndices (llvm::SmallVectorImpl< size_t > &indices, omp::MapInfoOp mapInfo, bool first=true) |
| static omp::MapInfoOp | getFirstOrLastMappedMemberPtr (omp::MapInfoOp mapInfo, bool first) |
| static std::vector< llvm::Value * > | calculateBoundsOffset (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, bool isArrayTy, OperandRange bounds, bool &isByteOffset) |
| This function calculates the array/pointer offset for map data provided with bounds operations, e.g. when provided something like the following: | |
| static void | getAsIntegers (ArrayAttr values, llvm::SmallVector< int64_t > &ints) |
| static void | getOverlappedMembers (llvm::SmallVectorImpl< size_t > &overlapMapDataIdxs, omp::MapInfoOp parentOp) |
| static void | addNonContiguousUpdate (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, MapInfoData &mapData, size_t mapDataIdx, MapInfosTy &combinedInfo) |
| Describe a bounded update as a set of contiguous pieces. Bounds follow the dialect's normalized fastest-to-slowest varying order, which matches Fortran's column-major dimension order. Frontends for row-major languages such as C/C++ must normalize their source dimensions to this order. OpenMPIRBuilder reverses the vectors when emitting the runtime descriptor, which uses byte offsets and strides with the slowest varying dimension first. | |
| static void | processIndividualMap (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, MapInfoData &mapData, size_t mapDataIdx, MapInfosTy &combinedInfo, TargetDirectiveEnumTy targetDirective, llvm::omp::OpenMPOffloadMappingFlags memberOfFlag=llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_NONE, bool isTargetParam=true, int mapDataParentIdx=-1) |
| This function handles the insertion of a single item of map data from MapInfoData into the OMPIRBuilder's MapInfo list. Utilising this function means the map being inserted can be treated as a non-parent map entity, if the memberOfFlag is set then the map being inserted is treated as a member map of a larger entity. The insertion into the MapInfo list of the OMPIRBuilder can vary based on a number of factors, such as if it's a ref_ptr or ref_ptee map, if it's a member of a record, what construct the map belongs to and the various map type bit flags that are set for the map. | |
| static void | mapParentWithMembers (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, DataLayout &dl, MapInfosTy &combinedInfo, MapInfoData &mapData, uint64_t mapDataIndex, llvm::omp::OpenMPOffloadMappingFlags memberOfFlag, TargetDirectiveEnumTy targetDirective) |
| static void | processMapWithMembersOf (LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, DataLayout &dl, MapInfosTy &combinedInfo, MapInfoData &mapData, uint64_t mapDataIndex, TargetDirectiveEnumTy targetDirective) |
| static void | createAlteredByCaptureMap (MapInfoData &mapData, LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder) |
| static void | genMapInfos (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, DataLayout &dl, MapInfosTy &combinedInfo, MapInfoData &mapData, TargetDirectiveEnumTy targetDirective) |
| static llvm::Expected< llvm::Function * > | emitUserDefinedMapper (Operation *declMapperOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, llvm::StringRef mapperFuncName, TargetDirectiveEnumTy targetDirective) |
| static llvm::Expected< llvm::Function * > | getOrCreateUserDefinedMapperFunc (Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, TargetDirectiveEnumTy targetDirective) |
| static void | hoistMapperAllocasToEntry (llvm::Function &mapperFn) |
| The mapper body (and any iterator regions in it) is emitted inside the mapper's per-element loop, so temporaries Flang allocates in the mapper region (e.g. the storage for an iterator variable) would be allocated once per element and grow the stack with every iteration. Move constant-size allocas to the function's entry block, where a frontend would place them. | |
| static llvm::Value * | getSourceLocIdentFromOp (llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, Operation *op) |
| static LogicalResult | convertOmpTargetData (Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpDistribute (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertFlagsAttr (Operation *op, mlir::omp::FlagsAttr attribute, LLVM::ModuleTranslation &moduleTranslation) |
| Lowers the FlagsAttr which is applied to the module when offloading. This attribute contains OpenMP RTL globals that can be passed as flags to the frontend, otherwise they are set to default. | |
| static void | getTargetEntryUniqueInfo (llvm::TargetRegionEntryInfo &targetInfo, omp::TargetOp targetOp, llvm::OpenMPIRBuilder &ompBuilder, llvm::vfs::FileSystem &vfs, llvm::StringRef parentName="") |
| static llvm::IRBuilderBase::InsertPoint | createDeviceArgumentAccessor (omp::TargetOp targetOp, MapInfoData &mapData, llvm::Argument &arg, llvm::Value *input, llvm::Value *&retVal, llvm::IRBuilderBase &builder, llvm::OpenMPIRBuilder &ompBuilder, LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase::InsertPoint allocaIP, llvm::IRBuilderBase::InsertPoint codeGenIP, llvm::ArrayRef< llvm::IRBuilderBase::InsertPoint > deallocIPs) |
| static void | extractHostEvalClauses (omp::TargetOp targetOp, Value &numThreads, Value &numTeamsLower, Value &numTeamsUpper, Value &threadLimit, llvm::SmallVectorImpl< Value > *lowerBounds=nullptr, llvm::SmallVectorImpl< Value > *upperBounds=nullptr, llvm::SmallVectorImpl< Value > *steps=nullptr) |
| Follow uses of host_eval-defined block arguments of the given omp.target operation and populate output variables with their corresponding host value (i.e. operand evaluated outside of the target region), based on their uses inside of the target region. | |
| template<typename OpTy> | |
| static OpTy | castOrGetParentOfType (Operation *op, bool immediateParent=false) |
If op is of the given type parameter, return it casted to that type. Otherwise, if its immediate parent operation (or some other higher-level parent, if immediateParent is false) is of that type, return that parent casted to the given type. | |
| static std::optional< int64_t > | extractConstInteger (Value value) |
If the given value is defined by an llvm.mlir.constant operation and it is of an integer type, return its value. | |
| static uint64_t | getTypeByteSize (mlir::Type type, const DataLayout &dl) |
| template<typename OpTy> | |
| static uint64_t | getReductionDataSize (OpTy &op) |
| static void | initTargetDefaultAttrs (omp::TargetOp targetOp, Operation *capturedOp, llvm::OpenMPIRBuilder::TargetKernelDefaultAttrs &attrs, bool isTargetDevice, bool isGPU) |
| Populate default MinTeams, MaxTeams and MaxThreads to their default values as stated by the corresponding clauses, if constant. | |
| static void | initTargetRuntimeAttrs (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, omp::TargetOp targetOp, Operation *capturedOp, llvm::OpenMPIRBuilder::TargetKernelRuntimeAttrs &attrs) |
| Gather LLVM runtime values for all clauses evaluated in the host that are passed to the kernel invocation. | |
| static llvm::omp::OMPDynGroupprivateFallbackType | getDynGroupprivateFallbackType (omp::FallbackModifierAttr fallbackAttr) |
| static LogicalResult | convertOmpTarget (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertDeclareTargetAttr (Operation *op, mlir::omp::DeclareTargetAttr attribute, llvm::OpenMPIRBuilder *ompBuilder, LLVM::ModuleTranslation &moduleTranslation) |
| static bool | isHostDeviceOp (Operation *op) |
| static llvm::Function * | getOmpTargetAlloc (llvm::IRBuilderBase &builder, llvm::Module *llvmModule) |
| template<typename T> | |
| static llvm::Value * | getAllocationSize (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, T op) |
| template<> | |
| llvm::Value * | getAllocationSize (llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, omp::TargetAllocMemOp op) |
| static LogicalResult | convertTargetAllocMemOp (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertAllocSharedMemOp (omp::AllocSharedMemOp allocMemOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertAllocateDirOp (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, const OpenMPDialectLLVMIRTranslationInterface &ompIface) |
| static LogicalResult | convertAllocateFreeOp (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, const OpenMPDialectLLVMIRTranslationInterface &ompIface) |
| static llvm::Function * | getOmpTargetFree (llvm::IRBuilderBase &builder, llvm::Module *llvmModule) |
| static LogicalResult | convertTargetFreeMemOp (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertFreeSharedMemOp (omp::FreeSharedMemOp freeMemOp, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOmpGroupprivate (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Converts an OpenMP groupprivate operation into LLVM IR. | |
Variables | |
| redGen | |
| nullptr | |
| atomicGen | |
| dataPtrPtrRedGen | |
| using IteratorStoreEntryTy |
Definition at line 3326 of file OpenMPToLLVMIRTranslation.cpp.
|
static |
Describe a bounded update as a set of contiguous pieces. Bounds follow the dialect's normalized fastest-to-slowest varying order, which matches Fortran's column-major dimension order. Frontends for row-major languages such as C/C++ must normalize their source dimensions to this order. OpenMPIRBuilder reverses the vectors when emitting the runtime descriptor, which uses byte offsets and strides with the slowest varying dimension first.
Definition at line 8096 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by processIndividualMap().
|
static |
Definition at line 2016 of file OpenMPToLLVMIRTranslation.cpp.
References allocReductionVars(), and success().
Referenced by convertOmpDistribute(), convertOmpScope(), convertOmpSections(), and convertOmpTeams().
|
static |
Allocate and initialize delayed private variables. Returns the basic block which comes after all of these allocations. llvm::Value * for each of these private variables are populated in llvmPrivateVars.
Definition at line 2215 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::omp::allocaUsesRequireSharedMem(), mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), and mlir::omp::opInSharedDeviceContext().
Referenced by convertOmpDistribute(), convertOmpParallel(), convertOmpScope(), convertOmpSimd(), convertOmpTarget(), and convertOmpWsloop().
|
static |
Allocate space for privatized reduction variables.
deferredStores contains information to create store operations which needs to be inserted after all allocas
Definition at line 1636 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Operation::emitError(), mlir::Region::empty(), getOpenMPBuilder(), inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::mapValue(), mlir::omp::opInSharedDeviceContext(), and success().
Referenced by allocAndInitializeReductionVars(), convertOmpParallel(), convertOmpSimd(), and convertOmpWsloop().
|
static |
Apply a #pragma omp fuse / !$omp fuse transformation using the OpenMPIRBuilder.
Definition at line 5876 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), mapOmpLoop(), and success().
|
static |
Apply a #pragma omp tile / !$omp tile transformation using the OpenMPIRBuilder.
Definition at line 5837 of file OpenMPToLLVMIRTranslation.cpp.
References genLoop(), getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), mlir::LLVM::ModuleTranslation::lookupValue(), mapOmpLoop(), and success().
|
static |
Apply a #pragma omp unroll full / !$omp unroll full transformation using the OpenMPIRBuilder.
Definition at line 5795 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), and success().
|
static |
Apply a #pragma omp unroll / "!$omp unroll" transformation using the OpenMPIRBuilder.
Definition at line 5776 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), and success().
|
static |
Apply a #pragma omp unroll partial / !$omp unroll partial transformation using the OpenMPIRBuilder.
Definition at line 5814 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), and success().
|
static |
Definition at line 3375 of file OpenMPToLLVMIRTranslation.cpp.
References fillAffinityLocators(), fillIteratorLoop(), findAllocInsertPoints(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and storeAffinityEntry().
Referenced by convertOmpTaskOp().
|
static |
Definition at line 3496 of file OpenMPToLLVMIRTranslation.cpp.
References buildDependDataLocator(), convertDependKind(), fillIteratorLoop(), getOpenMPBuilder(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertOmpTarget(), convertOmpTaskOp(), and convertOmpTaskwaitOp().
|
static |
Definition at line 2959 of file OpenMPToLLVMIRTranslation.cpp.
References convertDependKind(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by buildDependData().
|
static |
This function calculates the array/pointer offset for map data provided with bounds operations, e.g. when provided something like the following:
Fortran map(tofrom: array(2:5, 3:2))
We must calculate the initial pointer offset to pass across, this function performs this using bounds.
TODO/WARNING: This only supports Fortran's column major indexing currently as is noted in the note below and comments in the function, we must extend this function when we add a C++ frontend. NOTE: which while specified in row-major order it currently needs to be flipped for Fortran's column order array allocation and access (as opposed to C++'s row-major, hence the backwards processing where order is important). This is likely important to keep in mind for the future when we incorporate a C++ frontend, both frontends will need to agree on the ordering of generated bounds operations (one may have to flip them) to make the below lowering frontend agnostic. The offload size calcualtion may also have to be adjusted for C++.
Definition at line 7942 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by createAlteredByCaptureMap(), and emitUserDefinedMapper().
|
static |
If op is of the given type parameter, return it casted to that type. Otherwise, if its immediate parent operation (or some other higher-level parent, if immediateParent is false) is of that type, return that parent casted to the given type.
If op is null or neither it or its parent(s) are of the specified type, return a null operation.
Definition at line 9872 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::getParentOfType(), and mlir::Operation::getParentOp().
Referenced by initTargetDefaultAttrs(), and initTargetRuntimeAttrs().
|
static |
Definition at line 7436 of file OpenMPToLLVMIRTranslation.cpp.
References isDeclareTargetLink().
Referenced by createAlteredByCaptureMap(), getSizeInBytes(), mapParentWithMembers(), and processIndividualMap().
|
static |
Check whether translation to LLVM IR for the given operation is currently supported.
If not, descriptive diagnostics will be emitted to let users know this is a not-yet-implemented feature.
Definition at line 532 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitError(), mlir::Operation::emitWarning(), mlir::Region::empty(), mlir::Region::front(), mlir::Block::getArgument(), mlir::Operation::getName(), mlir::omp::getOpenMPVersionAttribute(), mlir::Operation::getParentOfType(), mlir::Operation::getRegion(), mlir::Value::getType(), mlir::DataLayout::getTypeSizeInBits(), mlir::SymbolTable::lookupNearestSymbolFrom(), result, and success().
Referenced by convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpCancel(), convertOmpCancellationPoint(), convertOmpCritical(), convertOmpDispatch(), convertOmpDistribute(), convertOmpGroupprivate(), convertOmpLoopNest(), convertOmpMasked(), convertOmpMaster(), convertOmpOrdered(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskloopWrapperOp(), convertOmpTaskOp(), convertOmpTaskwaitOp(), convertOmpTeams(), convertOmpThreadprivate(), convertOmpWsloop(), and emitUserDefinedMapper().
|
static |
Definition at line 2488 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::omp::allocaUsesRequireSharedMem(), mlir::LLVM::ModuleTranslation::convertType(), mlir::emitError(), getOpenMPBuilder(), inlineOmpRegionCleanup(), mlir::omp::opInSharedDeviceContext(), setInsertPointForPossiblyEmptyBlock(), and success().
Referenced by convertOmpDistribute(), convertOmpParallel(), convertOmpScope(), convertOmpSimd(), convertOmpTarget(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), and convertOmpWsloop().
|
static |
Look up and validate the declare_reduction ops referenced by a reduction-like clause on the omp.taskloop.context translation path.
Only the non-byref, single-init-arg, no-cleanup form is supported in this initial cut; richer shapes are rejected here with a diagnostic. syms is the clause's symbol list (e.g. getReductionSyms() or getInReductionSyms()), opName is the textual op name used in diagnostics, and clauseName distinguishes "reduction" from "in_reduction" in those diagnostics.
Definition at line 1290 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitError(), mlir::SymbolTable::lookupNearestSymbolFrom(), and success().
Referenced by convertOmpTaskloopContextOp(), and convertOmpTaskOp().
|
static |
Definition at line 7630 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpTarget(), convertOmpTargetData(), and emitUserDefinedMapper().
|
static |
Populates reductions with reduction declarations used in the given op.
Definition at line 1268 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::SymbolTable::lookupNearestSymbolFrom().
Referenced by getReductionDataSize().
|
static |
Applies the firstprivate copy region for each variable, pairing the mold values with the private allocations and privatizer declarations from privateVarsInfo, and emits a barrier if requested.
moldVars and llvmPrivateVars are optional overrides that, if empty, are read directly from privateVarsInfo. mappedPrivateVars is only consulted while materializing mold values from privateVarsInfo (i.e. empty moldVars).
Definition at line 2396 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpDistribute(), convertOmpParallel(), convertOmpScope(), convertOmpTarget(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), and convertOmpWsloop().
|
static |
Definition at line 3961 of file OpenMPToLLVMIRTranslation.cpp.
References lookupOrTranslatePureValue().
Referenced by convertOmpTaskloopContextOp().
Returns true if the construct contains omp.cancel or omp.cancellation_point.
Definition at line 2529 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::WalkResult::advance(), mlir::WalkResult::interrupt(), and mlir::Operation::walk().
Referenced by convertOmpParallel(), convertOmpSections(), and pushCancelFinalizationCB().
|
static |
Definition at line 11093 of file OpenMPToLLVMIRTranslation.cpp.
References getAllocatedLlvmTypeForVariable(), getBaseValueForTypeLookup(), getDynamicAllocatedSize(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::remapAllValuesWith(), and success().
|
static |
Definition at line 11172 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitError(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 2186 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitError(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
Referenced by convertOmpParallel(), and convertOmpScope().
|
static |
Definition at line 11082 of file OpenMPToLLVMIRTranslation.cpp.
References getAllocationSize(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Convert an Atomic Ordering attribute to llvm::AtomicOrdering.
Definition at line 5921 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), and getAtomicCompareFailureOrdering().
|
static |
Converts an LLVM dialect binary operation to the corresponding enum value for atomicrmw supported binary operation.
Definition at line 6005 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpAtomicCapture(), and convertOmpAtomicUpdate().
|
static |
Definition at line 7056 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpCancel(), and convertOmpCancellationPoint().
|
static |
Definition at line 7568 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by createAlteredByCaptureMap(), emitUserDefinedMapper(), and processIndividualMap().
|
static |
Definition at line 10626 of file OpenMPToLLVMIRTranslation.cpp.
References convertToCaptureClauseKind(), convertToDeviceClauseKind(), mlir::LocationAttr::findInstanceOf(), mlir::LLVM::ModuleTranslation::getFileSystem(), mlir::LLVM::ModuleTranslation::getLLVMModule(), mlir::Operation::getLoc(), getOpenMPBuilder(), mlir::Operation::getParentOfType(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::SymbolTable::Private, and success().
|
static |
Definition at line 2941 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by buildDependData(), and buildDependDataLocator().
|
static |
Helper to extract the OMPAtomicCompareOp from a floating-point comparison predicate. Returns std::nullopt for unsupported predicates.
Definition at line 6149 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by extractAtomicComparePattern().
|
static |
Lowers the FlagsAttr which is applied to the module when offloading. This attribute contains OpenMP RTL globals that can be passed as flags to the frontend, otherwise they are set to default.
Definition at line 9585 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitOpError(), getOpenMPBuilder(), and success().
|
static |
Definition at line 11239 of file OpenMPToLLVMIRTranslation.cpp.
References getAllocationSize(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Helper to extract the OMPAtomicCompareOp from an integer comparison predicate. Returns std::nullopt for unsupported predicates.
Definition at line 6131 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by extractAtomicComparePattern().
|
static |
Definition at line 3263 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::detail::connectPHINodes(), mlir::LLVM::ModuleTranslation::convertBlock(), mlir::Region::front(), mlir::Block::getArgument(), mlir::getBlocksSortedByDominance(), mlir::Region::hasOneBlock(), mlir::LLVM::ModuleTranslation::lookupBlock(), mlir::LLVM::ModuleTranslation::mapBlock(), and mlir::LLVM::ModuleTranslation::mapValue().
Referenced by emitUserDefinedMapper(), and fillIteratorLoop().
|
static |
Definition at line 6424 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Block::begin(), checkImplementationStatus(), AtomicComparePatternInfo::compareOp, convertAtomicOrdering(), convertBinOpToAtomic(), mlir::LLVM::ModuleTranslation::convertBlock(), mlir::LLVM::ModuleTranslation::convertOperation(), mlir::LLVM::ModuleTranslation::convertType(), AtomicComparePatternInfo::dVal, emitComplexAtomicCmpXchg(), AtomicComparePatternInfo::eVal, extractAtomicComparePattern(), extractAtomicControlFlags(), findAllocInsertPoints(), mlir::Region::front(), mlir::Block::getArgument(), getAtomicCompareFailureOrdering(), getOpenMPBuilder(), mlir::Operation::getOperand(), mlir::Operation::getOperands(), mlir::Operation::getRegion(), mlir::Block::getTerminator(), mlir::Value::getType(), handleError(), AtomicComparePatternInfo::isSigned, AtomicComparePatternInfo::isXBinopExpr, mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapBlock(), mlir::LLVM::ModuleTranslation::mapValue(), success(), and mlir::Block::without_terminator().
|
static |
Converts an omp.atomic.compare operation to LLVM IR.
if (x == e) x = d The region contains a comparison + select pattern: ^bb0(xval: T): cmp = llvm.icmp/fcmp <pred> xval, e : T sel = llvm.select cmp, d, xval : i1, T omp.yield(sel : T)
From MLIR extract: 1) comparison operator 2) expected value (e) 3) desired value (d) These are passed to OpenMPIRBuilder::createAtomicCompare which generates the actual cmpxchg / atomicrmw instruction.
Definition at line 6865 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), AtomicComparePatternInfo::compareOp, convertAtomicOrdering(), mlir::LLVM::ModuleTranslation::convertOperation(), mlir::LLVM::ModuleTranslation::convertType(), detectComplexCompareEq(), AtomicComparePatternInfo::dVal, ComplexComparePattern::eAggregate, emitComplexAtomicCmpXchg(), AtomicComparePatternInfo::eVal, extractAtomicComparePattern(), mlir::Region::front(), mlir::Block::getArgument(), getAtomicCompareFailureOrdering(), getOpenMPBuilder(), mlir::Operation::getOperands(), mlir::Block::getOperations(), mlir::Block::getTerminator(), mlir::Value::getType(), handleError(), ComplexComparePattern::isComplex, ComplexComparePattern::isNE, AtomicComparePatternInfo::isSigned, AtomicComparePatternInfo::isXBinopExpr, ComplexComparePattern::isXBinopExpr, mlir::LLVM::ModuleTranslation::lookupValue(), success(), and mlir::Block::without_terminator().
|
static |
Convert omp.atomic.read operation to LLVM IR.
Definition at line 5954 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertAtomicOrdering(), mlir::LLVM::ModuleTranslation::convertType(), findAllocInsertPoints(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP atomic update operation using OpenMPIRBuilder.
Definition at line 6045 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Block::begin(), checkImplementationStatus(), convertAtomicOrdering(), convertBinOpToAtomic(), mlir::LLVM::ModuleTranslation::convertBlock(), mlir::LLVM::ModuleTranslation::convertType(), extractAtomicControlFlags(), findAllocInsertPoints(), mlir::Region::front(), getOpenMPBuilder(), mlir::Operation::getOperand(), mlir::Operation::getOperands(), mlir::Operation::getRegion(), mlir::Block::getTerminator(), handleError(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapBlock(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Converts an omp.atomic.write operation to LLVM IR.
Definition at line 5981 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertAtomicOrdering(), mlir::LLVM::ModuleTranslation::convertType(), findAllocInsertPoints(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 7072 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertCancellationConstructType(), getOpenMPBuilder(), handleError(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 7099 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertCancellationConstructType(), getOpenMPBuilder(), handleError(), and success().
|
static |
Convert an omp.canonical_loop to LLVM-IR.
Definition at line 5733 of file OpenMPToLLVMIRTranslation.cpp.
References convertOmpOpRegions(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), mapOmpLoop(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Converts an OpenMP 'critical' operation into LLVM IR using OpenMPIRBuilder.
Definition at line 1136 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), mlir::LLVM::ModuleTranslation::getLLVMContext(), getOpenMPBuilder(), handleError(), mlir::SymbolTable::lookupNearestSymbolFrom(), and success().
|
static |
Convert 'dispatch' operation into LLVM IR.
Definition at line 1037 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), handleError(), result, and success().
|
static |
Process teams op reduction in distribute if the reduction is contained in this specific distribute op.
Definition at line 9457 of file OpenMPToLLVMIRTranslation.cpp.
References allocAndInitializeReductionVars(), allocatePrivateVars(), checkImplementationStatus(), cleanupPrivateVars(), completePrivateVars(), convertOmpOpRegions(), createReductionsAndCleanup(), findAllocInsertPoints(), findCurrentLoopInfo(), getDistributeCapturingTeamsReduction(), getOpenMPBuilder(), mlir::Operation::getParentOfType(), handleError(), initPrivateVars(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP groupprivate operation into LLVM IR.
Definition at line 11251 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), mlir::LLVM::ModuleTranslation::convertType(), mlir::Operation::emitError(), mlir::Operation::emitWarning(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::Operation::getResult(), mlir::LLVM::ModuleTranslation::lookupGlobal(), mlir::SymbolTable::lookupNearestSymbolFrom(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Definition at line 4898 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 4853 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 4926 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP loop nest into LLVM IR using OpenMPIRBuilder.
Definition at line 5604 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), getOpenMPBuilder(), handleError(), mlir::WalkResult::interrupt(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), selectCollapseIVMapping(), mlir::LLVM::ModuleTranslation::stackWalk(), success(), and mlir::tile().
|
static |
Converts an OpenMP 'masked' operation into LLVM IR using OpenMPIRBuilder.
Definition at line 1055 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), getOpenMPBuilder(), handleError(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP 'master' operation into LLVM IR using OpenMPIRBuilder.
Definition at line 1100 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), getOpenMPBuilder(), handleError(), and success().
|
static |
Converts the given region that appears within an OpenMP dialect operation to LLVM IR, creating a branch from the sourceBlock to the entry block of the region, and a branch from any block with an successor-less OpenMP terminator to continuationBlock.
Populates continuationBlockPHIs with the PHI nodes of the continuation block if provided.
Definition at line 897 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::detail::connectPHINodes(), mlir::LLVM::ModuleTranslation::convertBlock(), mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::Region::getBlocks(), mlir::getBlocksSortedByDominance(), mlir::Operation::getNumOperands(), mlir::Operation::getOperand(), mlir::Region::getParentOp(), mlir::LLVM::ModuleTranslation::lookupBlock(), mlir::LLVM::ModuleTranslation::lookupValue(), and mlir::LLVM::ModuleTranslation::mapBlock().
Referenced by convertOmpCanonicalLoopOp(), convertOmpCritical(), convertOmpDispatch(), convertOmpDistribute(), convertOmpLoopNest(), convertOmpMasked(), convertOmpMaster(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskloopWrapperOp(), convertOmpTaskOp(), convertOmpTeams(), convertOmpWsloop(), and inlineConvertOmpRegions().
|
static |
Converts an OpenMP 'ordered' operation into LLVM IR using OpenMPIRBuilder.
Definition at line 1504 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), findAllocInsertPoints(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValues(), and success().
|
static |
Converts an OpenMP 'ordered_region' operation into LLVM IR using OpenMPIRBuilder.
Definition at line 1539 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), getOpenMPBuilder(), handleError(), and success().
|
static |
Converts the OpenMP parallel operation to LLVM IR.
Definition at line 5193 of file OpenMPToLLVMIRTranslation.cpp.
References allocatePrivateVars(), allocReductionVars(), checkImplementationStatus(), cleanupPrivateVars(), completePrivateVars(), constructIsCancellable(), convertAllocatorVars(), convertOmpOpRegions(), emitTaskReductionModifierFini(), emitTaskReductionModifierInitCall(), findAllocInsertPoints(), getOpenMPBuilder(), getProcBindKind(), handleError(), initPrivateVars(), inlineOmpRegionCleanup(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP scope construct into LLVM IR.
Definition at line 2702 of file OpenMPToLLVMIRTranslation.cpp.
References allocAndInitializeReductionVars(), allocatePrivateVars(), checkImplementationStatus(), cleanupPrivateVars(), completePrivateVars(), convertAllocatorVars(), convertOmpOpRegions(), createReductionsAndCleanup(), findAllocInsertPoints(), getOpenMPBuilder(), handleError(), and initPrivateVars().
|
static |
Definition at line 2581 of file OpenMPToLLVMIRTranslation.cpp.
References allocAndInitializeReductionVars(), mlir::Region::begin(), checkImplementationStatus(), constructIsCancellable(), convertOmpOpRegions(), createReductionsAndCleanup(), emitTaskReductionModifierFini(), emitTaskReductionModifierInitCall(), findAllocInsertPoints(), mlir::Region::getArguments(), mlir::Region::getNumArguments(), getOpenMPBuilder(), mlir::Operation::getRegion(), handleError(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Converts an OpenMP simd loop into LLVM IR using OpenMPIRBuilder.
Definition at line 5406 of file OpenMPToLLVMIRTranslation.cpp.
References allocatePrivateVars(), allocReductionVars(), checkImplementationStatus(), cleanupPrivateVars(), convertOmpOpRegions(), convertOrderKind(), mlir::LLVM::ModuleTranslation::convertType(), findAllocInsertPoints(), findCurrentLoopInfo(), getOpenMPBuilder(), handleError(), initPrivateVars(), inlineOmpRegionCleanup(), mlir::LLVM::ModuleTranslation::lookupValue(), and makeReductionGen().
|
static |
Converts an OpenMP single construct into LLVM IR using OpenMPIRBuilder.
Definition at line 2791 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), getOpenMPBuilder(), handleError(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::SymbolTable::lookupNearestSymbolFrom(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 10161 of file OpenMPToLLVMIRTranslation.cpp.
References allocatePrivateVars(), buildDependData(), checkImplementationStatus(), cleanupPrivateVars(), collectMapDataFromMapOperands(), completePrivateVars(), convertOmpOpRegions(), mlir::LLVM::ModuleTranslation::convertType(), createDeviceArgumentAccessor(), findAllocInsertPoints(), findPrivatizer(), genMapInfos(), mlir::Value::getDefiningOp(), getDynGroupprivateFallbackType(), mlir::LLVM::ModuleTranslation::getFileSystem(), getOpenMPBuilder(), getOrCreateUserDefinedMapperFunc(), mlir::Operation::getParentOfType(), getSourceLocIdentFromOp(), getTargetEntryUniqueInfo(), handleError(), initPrivateVars(), initTargetDefaultAttrs(), initTargetRuntimeAttrs(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Definition at line 9202 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), collectMapDataFromMapOperands(), mlir::Operation::emitOpError(), findAllocInsertPoints(), genMapInfos(), getOpenMPBuilder(), getOrCreateUserDefinedMapperFunc(), mlir::Operation::getParentOfType(), getSourceLocIdentFromOp(), handleError(), inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), result, and success().
|
static |
Converts an OpenMP taskgroup construct into LLVM IR using OpenMPIRBuilder.
Definition at line 4770 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), emitTaskReductionInitCall(), findAllocInsertPoints(), getOpenMPBuilder(), handleError(), mlir::SymbolTable::lookupNearestSymbolFrom(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Definition at line 4074 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), cleanupPrivateVars(), collectAndValidateTaskloopRedDecls(), completePrivateVars(), computeTaskloopBounds(), convertOmpOpRegions(), mlir::LLVM::ModuleTranslation::convertType(), emitTaskReductionInitCall(), findAllocInsertPoints(), findCurrentLoopInfo(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::Value::getType(), handleError(), initPrivateVar(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), materializeRegionArgValue(), popCancelFinalizationCB(), pushCancelFinalizationCB(), setInsertPointForPossiblyEmptyBlock(), and success().
|
static |
The correct entry point is convertOmpTaskloopContextOp. This gets called whilst lowering the body of the taskloop context (i.e. the task function).
Definition at line 3888 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), convertOmpOpRegions(), handleError(), and success().
|
static |
Converts an OpenMP task construct into LLVM IR using OpenMPIRBuilder.
Definition at line 3582 of file OpenMPToLLVMIRTranslation.cpp.
References buildAffinityData(), buildDependData(), checkImplementationStatus(), cleanupPrivateVars(), collectAndValidateTaskloopRedDecls(), completePrivateVars(), convertOmpOpRegions(), mlir::LLVM::ModuleTranslation::convertType(), findAllocInsertPoints(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::Value::getType(), handleError(), initPrivateVar(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), popCancelFinalizationCB(), pushCancelFinalizationCB(), setInsertPointForPossiblyEmptyBlock(), and success().
|
static |
Definition at line 4951 of file OpenMPToLLVMIRTranslation.cpp.
References buildDependData(), checkImplementationStatus(), getOpenMPBuilder(), and success().
|
static |
Definition at line 2874 of file OpenMPToLLVMIRTranslation.cpp.
References allocAndInitializeReductionVars(), checkImplementationStatus(), convertOmpOpRegions(), createReductionsAndCleanup(), findAllocInsertPoints(), getDistributeCapturingTeamsReduction(), getOpenMPBuilder(), handleError(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Converts an OpenMP Threadprivate operation into LLVM IR using OpenMPIRBuilder.
Definition at line 7125 of file OpenMPToLLVMIRTranslation.cpp.
References checkImplementationStatus(), mlir::Operation::emitError(), mlir::Value::getDefiningOp(), getOpenMPBuilder(), mlir::Operation::getOperand(), mlir::Operation::getResult(), mlir::LLVM::ModuleTranslation::lookupGlobal(), mlir::LLVM::ModuleTranslation::mapValue(), success(), and mlir::LLVM::ModuleTranslation::symbolTable().
|
static |
Converts an OpenMP workshare loop into LLVM IR using OpenMPIRBuilder.
Definition at line 4974 of file OpenMPToLLVMIRTranslation.cpp.
References allocatePrivateVars(), allocReductionVars(), checkImplementationStatus(), cleanupPrivateVars(), completePrivateVars(), convertOmpOpRegions(), createReductionsAndCleanup(), emitTaskReductionModifierFini(), emitTaskReductionModifierInitCall(), findAllocInsertPoints(), findCurrentLoopInfo(), getOpenMPBuilder(), mlir::Operation::getParentOp(), handleError(), initPrivateVars(), mlir::LLVM::ModuleTranslation::lookupValue(), popCancelFinalizationCB(), and pushCancelFinalizationCB().
|
static |
Convert Order attribute to llvm::omp::OrderKind.
Definition at line 5394 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpSimd().
|
static |
Definition at line 11056 of file OpenMPToLLVMIRTranslation.cpp.
References getAllocationSize(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOmpTargetAlloc(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Definition at line 11216 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::getLLVMModule(), getOmpTargetFree(), mlir::LLVM::ModuleTranslation::lookupValue(), and success().
|
static |
Definition at line 7174 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertDeclareTargetAttr().
|
static |
Definition at line 7158 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertDeclareTargetAttr().
|
static |
Definition at line 8646 of file OpenMPToLLVMIRTranslation.cpp.
References calculateBoundsOffset(), checkIfPointerMap(), convertClauseMapFlags(), findAllocInsertPoints(), and getOpenMPBuilder().
Referenced by genMapInfos().
|
static |
Definition at line 9673 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::omp::allocaUsesRequireSharedMem(), mlir::LLVM::TypeToLLVMIRTranslator::getPreferredAlignment(), and mlir::omp::opInSharedDeviceContext().
Referenced by convertOmpTarget().
|
static |
Definition at line 1940 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Operation::emitOpError(), getOpenMPBuilder(), handleError(), inlineOmpRegionCleanup(), mlir::omp::opInSharedDeviceContext(), result, and success().
Referenced by convertOmpDistribute(), convertOmpScope(), convertOmpSections(), convertOmpTeams(), and convertOmpWsloop().
|
static |
Detect a decomposed complex equality comparison in an atomic compare region: re_x = llvm.extractvalue xval[0] re_e = llvm.extractvalue eStruct[0] cmp_re = llvm.fcmp "oeq" re_x, re_e im_x = llvm.extractvalue xval[1] im_e = llvm.extractvalue eStruct[1] cmp_im = llvm.fcmp "oeq" im_x, im_e cmp = llvm.and cmp_re, cmp_im (llvm.or would be NE) It is recognised by an and/or whose operands are both fcmps operating on extractvalues, one chain rooted at the block argument (x) and the other at the expected complex value (e).
Definition at line 6185 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Block::getArgument(), mlir::Value::getDefiningOp(), mlir::Operation::getOperand(), mlir::Block::getOperations(), and result.
Referenced by convertOmpAtomicCompare(), and extractAtomicComparePattern().
|
static |
Emit an IEEE-754-correct cmpxchg for a complex (struct-typed) atomic compare with fcmp oeq. The old value of X is returned (as the complex struct type) in oldComplex and the success flag (i1) in cmpOk. failOrdering is the memory ordering used when the compare-exchange does not store; it must be a valid cmpxchg failure ordering.
Definition at line 6222 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpAtomicCapture(), and convertOmpAtomicCompare().
|
static |
Definition at line 2376 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), handleError(), opMightBeSafeForBarriers(), and success().
|
static |
Build an outlined combiner helper for a task_reduction declare_reduction op. Signature: void(ptr lhs, ptr rhs). For non-byref reductions, the values at *lhs and *rhs are loaded, fed into the combiner region, and the yielded scalar is stored back into *lhs.
Definition at line 4588 of file OpenMPToLLVMIRTranslation.cpp.
References b, mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::Block::front(), mlir::Block::getArgument(), mlir::LLVM::ModuleTranslation::getLLVMModule(), mlir::Block::getNumArguments(), inlineConvertOmpRegions(), and mlir::LLVM::ModuleTranslation::mapValue().
Referenced by emitTaskReductionInitCall().
|
static |
Emit the per-taskgroup task_reduction descriptor array and the __kmpc_taskred_init runtime call. origPtrs holds the LLVM values for the original (shared) variables, one per declaration in redDecls. builder must be set to the point at which the descriptor stores and the init call should be emitted; the descriptor array itself is allocated at allocaIP. helperNamePrefix is used to disambiguate the generated init/combiner helper symbol names between taskgroup and taskloop callers.
When isModifier is false, emits __kmpc_taskred_init and returns the ptr value it produces (the taskgroup reduction handle). When isModifier is true, emits __kmpc_taskred_modifier_init instead to open a task-reduction scope for a parallel or worksharing construct, passing isWorksharing as the runtime is_ws argument. Returns null on failure.
Only the non-byref form is handled here. Byref reductions have already been rejected by checkImplementationStatus.
Definition at line 4647 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), emitTaskReductionCombFn(), emitTaskReductionInitFn(), mlir::LLVM::ModuleTranslation::getLLVMModule(), and getOpenMPBuilder().
Referenced by convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), and emitTaskReductionModifierInitCall().
|
static |
Build an outlined init helper for a task_reduction declare_reduction op. Signature: void(ptr priv, ptr orig). For non-byref reductions, the init region's mold argument is mapped following the same rule as the regular reduction path (mapInitializationArgs): a non-pointer mold loads the value from orig, while a pointer-typed mold receives orig directly. The yielded value is stored into priv.
Definition at line 4538 of file OpenMPToLLVMIRTranslation.cpp.
References b, mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::LLVM::ModuleTranslation::getLLVMModule(), mlir::Value::getType(), inlineConvertOmpRegions(), and mlir::LLVM::ModuleTranslation::mapValue().
Referenced by emitTaskReductionInitCall().
|
static |
Emits __kmpc_task_reduction_modifier_fini(loc, gtid, is_ws) at the current builder insertion point, closing the task-reduction scope opened by the task reduction modifier on a parallel or worksharing construct.
Definition at line 4751 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::getLLVMModule(), and getOpenMPBuilder().
Referenced by convertOmpParallel(), convertOmpSections(), and convertOmpWsloop().
|
static |
Register only the task-modified items. All items still participate in the enclosing construct's ordinary reduction combination and cleanup.
Definition at line 2562 of file OpenMPToLLVMIRTranslation.cpp.
References emitTaskReductionInitCall().
Referenced by convertOmpParallel(), convertOmpSections(), and convertOmpWsloop().
|
static |
Definition at line 8822 of file OpenMPToLLVMIRTranslation.cpp.
References b, calculateBoundsOffset(), checkImplementationStatus(), collectMapDataFromMapOperands(), mlir::LLVM::ModuleTranslation::convertBlock(), convertClauseMapFlags(), convertIteratorRegion(), mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::createMappingInformation(), mlir::LLVM::ModuleTranslation::forgetMapping(), genMapInfos(), getArrayElementSizeInBits(), getOpenMPBuilder(), getOrCreateUserDefinedMapperFunc(), mlir::DataLayout::getTypeSizeInBits(), hoistMapperAllocasToEntry(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::SymbolTable::lookupNearestSymbolFrom(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapBlock(), mlir::LLVM::ModuleTranslation::mapFunction(), and mlir::LLVM::ModuleTranslation::mapValue().
Referenced by getOrCreateUserDefinedMapperFunc().
|
static |
Extract comparison predicate, expected value (e), desired value (d), and related flags from an atomic compare region block by scanning for icmp/fcmp/select/min/max operations.
Definition at line 6319 of file OpenMPToLLVMIRTranslation.cpp.
References AtomicComparePatternInfo::compareOp, convertFCmpPredicateToAtomicCompareOp(), convertICmpPredicateToAtomicCompareOp(), detectComplexCompareEq(), AtomicComparePatternInfo::dVal, AtomicComparePatternInfo::eVal, mlir::Block::getArgument(), mlir::Operation::getOperand(), mlir::Block::getOperations(), ComplexComparePattern::isComplex, AtomicComparePatternInfo::isSigned, AtomicComparePatternInfo::isXBinopExpr, result, and success().
Referenced by convertOmpAtomicCapture(), and convertOmpAtomicCompare().
|
static |
Definition at line 6027 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpAtomicCapture(), and convertOmpAtomicUpdate().
If the given value is defined by an llvm.mlir.constant operation and it is of an integer type, return its value.
Definition at line 9887 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Value::getDefiningOp().
Referenced by initTargetDefaultAttrs().
|
static |
Follow uses of host_eval-defined block arguments of the given omp.target operation and populate output variables with their corresponding host value (i.e. operand evaluated outside of the target region), based on their uses inside of the target region.
Loop bounds and steps are only optionally populated, if output vectors are provided.
Definition at line 9805 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::getUsers().
Referenced by initTargetDefaultAttrs(), and initTargetRuntimeAttrs().
|
static |
Definition at line 3247 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupValue(), and storeAffinityEntry().
Referenced by buildAffinityData().
|
static |
Definition at line 3330 of file OpenMPToLLVMIRTranslation.cpp.
References convertIteratorRegion(), mlir::LLVM::ModuleTranslation::forgetMapping(), getOpenMPBuilder(), and handleError().
Referenced by buildAffinityData(), and buildDependData().
|
static |
Find the insertion point for allocas given the current insertion point for normal operations in the builder.
Definition at line 815 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::WalkResult::interrupt(), mlir::LLVM::ModuleTranslation::stackWalk(), and mlir::WalkResult::wasInterrupted().
Referenced by buildAffinityData(), convertOmpAtomicCapture(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpDistribute(), convertOmpOrdered(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOmpTeams(), convertOmpWsloop(), and createAlteredByCaptureMap().
|
static |
Return the llvm::Value * corresponding to the privateVar that is being privatized. It isn't always as simple as looking up moduleTranslation with privateVar. For instance, in case of an allocatable, the descriptor for the allocatable is privatized. This descriptor is mapped using an MapInfoOp. So, this function will return a pointer to the llvm::Value corresponding to the block argument for the mapped descriptor.
Definition at line 2039 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Value::getType(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by initPrivateVar().
|
static |
Find the loop information structure for the loop nest being translated.
It will return a null value unless called from the translation function for a loop wrapper operation after successfully translating its body.
Definition at line 882 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::WalkResult::interrupt(), and mlir::LLVM::ModuleTranslation::stackWalk().
Referenced by convertOmpDistribute(), convertOmpSimd(), convertOmpTaskloopContextOp(), and convertOmpWsloop().
|
static |
Looks up from the operation from and returns the PrivateClauseOp with name symbolName.
Definition at line 517 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::SymbolTable::lookupNearestSymbolFrom().
Referenced by convertOmpTarget().
|
static |
Definition at line 8723 of file OpenMPToLLVMIRTranslation.cpp.
References createAlteredByCaptureMap(), getOpenMPBuilder(), processIndividualMap(), and processMapWithMembersOf().
Referenced by convertOmpTarget(), convertOmpTargetData(), and emitUserDefinedMapper().
|
static |
Definition at line 7224 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Value::getDefiningOp(), getGlobalOpFromValue(), mlir::Value::getType(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertAllocateDirOp().
| llvm::Value * getAllocationSize | ( | llvm::IRBuilderBase & | builder, |
| LLVM::ModuleTranslation & | moduleTranslation, | ||
| omp::TargetAllocMemOp | op ) |
Definition at line 11037 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::getLLVMModule(), and mlir::LLVM::ModuleTranslation::lookupValue().
|
static |
Definition at line 11016 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::getLLVMModule(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertAllocSharedMemOp(), convertFreeSharedMemOp(), and convertTargetAllocMemOp().
|
static |
Definition at line 7421 of file OpenMPToLLVMIRTranslation.cpp.
References getArrayElementSizeInBits(), and mlir::DataLayout::getTypeSizeInBits().
Referenced by emitUserDefinedMapper(), getArrayElementSizeInBits(), and getSizeInBytes().
|
static |
Definition at line 8034 of file OpenMPToLLVMIRTranslation.cpp.
References ArrayAttr().
Referenced by getOverlappedMembers().
|
static |
Compute the cmpxchg failure ordering for an atomic compare op: use the fail clause ordering when present (the verifier guarantees it is a valid cmpxchg failure ordering), otherwise the strongest failure ordering derived from the success ordering (which matches the OpenMPIRBuilder default).
Definition at line 5945 of file OpenMPToLLVMIRTranslation.cpp.
References convertAtomicOrdering().
Referenced by convertOmpAtomicCapture(), and convertOmpAtomicCompare().
Definition at line 7200 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Value::getDefiningOp(), mlir::OperationName::getIdentifier(), mlir::Operation::getName(), mlir::Operation::getNumOperands(), and mlir::Operation::getOperand().
Referenced by convertAllocateDirOp().
|
static |
Definition at line 7278 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::SymbolTable::Private.
Referenced by getRefPtrIfDeclareTarget().
|
static |
Definition at line 2834 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::WalkResult::interrupt(), and mlir::WalkResult::skip().
Referenced by convertOmpDistribute(), and convertOmpTeams().
|
static |
Definition at line 7247 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Value::getDefiningOp(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertAllocateDirOp().
|
static |
Definition at line 10145 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpTarget().
|
static |
Definition at line 7908 of file OpenMPToLLVMIRTranslation.cpp.
References ArrayAttr(), indices, and sortMapIndices().
Referenced by mapParentWithMembers().
Definition at line 7189 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Value::getDefiningOp(), and mlir::Operation::getOperand().
Referenced by getAllocatedLlvmTypeForVariable(), getRefPtrIfDeclareTarget(), isDeclareTargetLink(), and isDeclareTargetTo().
|
static |
Definition at line 7624 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by mapParentWithMembers().
|
static |
Definition at line 7856 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by mapParentWithMembers(), and processMapWithMembersOf().
|
static |
Definition at line 11002 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertTargetAllocMemOp().
|
static |
Definition at line 11203 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertTargetFreeMemOp().
|
static |
Returns the OpenMP IR builder associated with the LLVM IR module being constructed.
Definition at line 170 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPState().
Referenced by allocatePrivateVars(), allocReductionVars(), applyFuse(), applyTile(), applyUnrollFull(), applyUnrollHeuristic(), applyUnrollPartial(), buildAffinityData(), buildDependData(), cleanupPrivateVars(), convertAllocateDirOp(), convertAllocateFreeOp(), convertAllocSharedMemOp(), convertDeclareTargetAttr(), convertFlagsAttr(), convertFreeSharedMemOp(), convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpCancel(), convertOmpCancellationPoint(), convertOmpCanonicalLoopOp(), convertOmpCritical(), convertOmpDistribute(), convertOmpGroupprivate(), convertOmpInteropDestroyOp(), convertOmpInteropInitOp(), convertOmpInteropUseOp(), convertOmpLoopNest(), convertOmpMasked(), convertOmpMaster(), convertOmpOrdered(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOmpTaskwaitOp(), convertOmpTeams(), convertOmpThreadprivate(), convertOmpWsloop(), createAlteredByCaptureMap(), createReductionsAndCleanup(), emitPrivatizationBarrier(), emitTaskReductionInitCall(), emitTaskReductionModifierFini(), emitUserDefinedMapper(), fillAffinityLocators(), fillIteratorLoop(), genMapInfos(), getOrCreateUserDefinedMapperFunc(), getRefPtrIfDeclareTarget(), and initTargetRuntimeAttrs().
|
static |
Definition at line 162 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::getLLVMModule(), and mlir::LLVM::ModuleTranslation::getOrCreateExtension().
Referenced by getOpenMPBuilder(), invalidateOmpLoop(), lookupOMPLoop(), and mapOmpLoop().
|
static |
Definition at line 8775 of file OpenMPToLLVMIRTranslation.cpp.
References emitUserDefinedMapper(), mlir::LLVM::ModuleTranslation::getLLVMModule(), getOpenMPBuilder(), mlir::LLVM::ModuleTranslation::lookupFunction(), and mlir::LLVM::ModuleTranslation::mapFunction().
Referenced by convertOmpTarget(), convertOmpTargetData(), and emitUserDefinedMapper().
|
static |
Definition at line 8043 of file OpenMPToLLVMIRTranslation.cpp.
References ArrayAttr(), and getAsIntegers().
Referenced by mapParentWithMembers().
|
static |
Returns the address of the data in var, via the data_address region.
Definition at line 2087 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Region::empty(), inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::mapValue(), materializeRegionArgValue(), and setInsertPointForPossiblyEmptyBlock().
|
static |
Convert ProcBindKind from MLIR-generated enum to LLVM enum.
Definition at line 1021 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpParallel().
|
static |
Definition at line 9905 of file OpenMPToLLVMIRTranslation.cpp.
References collectReductionDecls(), mlir::Operation::getContext(), mlir::Operation::getParentOfType(), and getTypeByteSize().
Referenced by initTargetDefaultAttrs().
|
static |
|
static |
Definition at line 7470 of file OpenMPToLLVMIRTranslation.cpp.
References checkIfPointerMap(), getArrayElementSizeInBits(), mlir::DataLayout::getTypeSizeInBits(), and mlir::LLVM::ModuleTranslation::lookupValue().
|
static |
Definition at line 9187 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::createSourceLocStrFromLocation(), mlir::LocationAttr::findInstanceOf(), and mlir::Operation::getLoc().
Referenced by convertOmpTarget(), and convertOmpTargetData().
|
static |
Definition at line 9617 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpTarget().
|
static |
Definition at line 9898 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::DataLayout::getTypeSizeInBits().
Referenced by getReductionDataSize().
|
static |
Definition at line 792 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::emitError(), result, and success().
Referenced by convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicUpdate(), convertOmpCancel(), convertOmpCancellationPoint(), convertOmpCritical(), convertOmpDispatch(), convertOmpDistribute(), convertOmpLoopNest(), convertOmpMasked(), convertOmpMaster(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskloopWrapperOp(), convertOmpTaskOp(), convertOmpTeams(), convertOmpWsloop(), createReductionsAndCleanup(), emitPrivatizationBarrier(), fillIteratorLoop(), handleError(), and inlineConvertOmpRegions().
|
static |
Definition at line 806 of file OpenMPToLLVMIRTranslation.cpp.
References handleError(), result, and success().
|
static |
The mapper body (and any iterator regions in it) is emitted inside the mapper's per-element loop, so temporaries Flang allocates in the mapper region (e.g. the storage for an iterator variable) would be allocated once per element and grow the stack with every iteration. Move constant-size allocas to the function's entry block, where a frontend would place them.
Definition at line 8809 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by emitUserDefinedMapper().
|
static |
Initialize a single (first)private variable. You probably want to use allocateAndInitPrivateVars instead of this. This returns the private variable which has been initialized. This variable should be mapped before constructing the body of the Op.
Definition at line 2110 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Region::empty(), mlir::LLVM::ModuleTranslation::forgetMapping(), inlineConvertOmpRegions(), and mlir::LLVM::ModuleTranslation::mapValue().
Referenced by convertOmpTaskloopContextOp(), convertOmpTaskOp(), initPrivateVar(), and initPrivateVars().
|
static |
Version of initPrivateVar which looks up the nonPrivateVar from mlirPrivVar.
Definition at line 2145 of file OpenMPToLLVMIRTranslation.cpp.
References findAssociatedValue(), and initPrivateVar().
|
static |
Definition at line 2158 of file OpenMPToLLVMIRTranslation.cpp.
References initPrivateVar(), mlir::LLVM::ModuleTranslation::mapValue(), and setInsertPointForPossiblyEmptyBlock().
Referenced by convertOmpDistribute(), convertOmpParallel(), convertOmpScope(), convertOmpSimd(), convertOmpTarget(), and convertOmpWsloop().
|
static |
Populate default MinTeams, MaxTeams and MaxThreads to their default values as stated by the corresponding clauses, if constant.
These default values must be set before the creation of the outlined LLVM function for the target region, so that they can be used to initialize the corresponding global ConfigurationEnvironmentTy structure.
Definition at line 9937 of file OpenMPToLLVMIRTranslation.cpp.
References castOrGetParentOfType(), extractConstInteger(), extractHostEvalClauses(), getReductionDataSize(), and result.
Referenced by convertOmpTarget().
|
static |
Gather LLVM runtime values for all clauses evaluated in the host that are passed to the kernel invocation.
This function must be called only when compiling for the host. Also, it will only provide correct results if it's called after the body of targetOp has been fully generated.
Definition at line 10064 of file OpenMPToLLVMIRTranslation.cpp.
References castOrGetParentOfType(), extractHostEvalClauses(), getOpenMPBuilder(), and mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertOmpTarget().
|
static |
Translates the blocks contained in the given region and appends them to at the current insertion point of builder.
The operations of the entry block are appended to the current insertion block. If set, continuationBlockArgs is populated with translated values that correspond to the values omp.yield'ed from the region.
Definition at line 1324 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Block::back(), mlir::LLVM::ModuleTranslation::convertBlock(), convertOmpOpRegions(), mlir::Region::empty(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::Region::front(), mlir::Operation::getOperands(), mlir::Region::getParentOp(), handleError(), mlir::Region::hasOneBlock(), mlir::LLVM::ModuleTranslation::lookupValues(), mlir::LLVM::ModuleTranslation::mapBlock(), nullptr, and success().
Referenced by allocReductionVars(), convertOmpTargetData(), emitTaskReductionCombFn(), emitTaskReductionInitFn(), getPrivateDataAddress(), initPrivateVar(), inlineOmpRegionCleanup(), makeAtomicReductionGen(), makeReductionGen(), and makeRefDataPtrGen().
|
static |
handling of DeclareReductionOp's cleanup region
Definition at line 1901 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::Block::front(), mlir::Block::getArgument(), mlir::Value::getType(), inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::mapValue(), nullptr, and success().
Referenced by cleanupPrivateVars(), convertOmpParallel(), convertOmpSimd(), and createReductionsAndCleanup().
Mark an OpenMP loop as having been consumed.
Definition at line 185 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPState().
Referenced by applyFuse(), applyTile(), applyUnrollFull(), applyUnrollHeuristic(), and applyUnrollPartial().
Definition at line 7299 of file OpenMPToLLVMIRTranslation.cpp.
References getGlobalOpFromValue().
Referenced by checkIfPointerMap(), and getRefPtrIfDeclareTarget().
Definition at line 7312 of file OpenMPToLLVMIRTranslation.cpp.
References getGlobalOpFromValue().
Referenced by getRefPtrIfDeclareTarget().
Definition at line 10980 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::getParentOfType().
|
static |
Definition at line 7454 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by processIndividualMap(), and processMapWithMembersOf().
|
static |
Find the LLVM-IR loop that represents an MLIR loop.
Definition at line 176 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPState(), and result.
Referenced by applyFuse(), applyTile(), applyUnrollFull(), applyUnrollHeuristic(), and applyUnrollPartial().
|
static |
Look up the given value in the mapping, and if it's not there, translate its defining operation at the current builder insertion point. Only pure, regionless operations are supported because the same operation will later be translated again when the taskloop body itself is lowered.
Definition at line 3912 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertOperation(), mlir::LLVM::ModuleTranslation::forgetMapping(), mlir::Value::getDefiningOp(), mlir::Operation::getNumOperands(), mlir::Operation::getNumRegions(), mlir::Operation::getNumResults(), mlir::Operation::getOperands(), mlir::Operation::getResults(), mlir::isPure(), lookupOrTranslatePureValue(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::mapValue(), and result.
Referenced by computeTaskloopBounds(), and lookupOrTranslatePureValue().
|
static |
Create an OpenMPIRBuilder-compatible atomic reduction generator for the given reduction declaration.
The generator uses builder but ignores its insertion point. Returns null if there is no atomic region available in the reduction declaration.
Definition at line 1445 of file OpenMPToLLVMIRTranslation.cpp.
References atomicGen, inlineConvertOmpRegions(), and mlir::LLVM::ModuleTranslation::mapValue().
|
static |
Create an OpenMPIRBuilder-compatible reduction generator for the given reduction declaration.
The generator uses builder but ignores its insertion point.
Definition at line 1415 of file OpenMPToLLVMIRTranslation.cpp.
References inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::mapValue(), and result.
Referenced by convertOmpSimd().
|
static |
Create an OpenMPIRBuilder-compatible data_ptr_ptr reduction generator for the given reduction declaration.
The generator uses builder but ignores its insertion point. Returns null if there is no data_ptr_ptr region available in the reduction declaration.
Definition at line 1478 of file OpenMPToLLVMIRTranslation.cpp.
References inlineConvertOmpRegions(), mlir::LLVM::ModuleTranslation::mapValue(), and result.
|
static |
Map input arguments to reduction initialization region.
Definition at line 1709 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::Region::front(), mlir::Block::getNumArguments(), mlir::Value::getType(), mlir::LLVM::ModuleTranslation::lookupValue(), and mlir::LLVM::ModuleTranslation::mapValue().
|
static |
Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo.
Definition at line 193 of file OpenMPToLLVMIRTranslation.cpp.
References getOpenMPState().
Referenced by applyFuse(), applyTile(), and convertOmpCanonicalLoopOp().
|
static |
Definition at line 8318 of file OpenMPToLLVMIRTranslation.cpp.
References checkIfPointerMap(), mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::createMappingInformation(), getFirstOrLastMappedMemberPtr(), getMapClauseName(), getMapDataMemberIdx(), getOverlappedMembers(), and sortMapIndices().
Referenced by processMapWithMembersOf().
|
static |
Definition at line 2071 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), and mlir::Value::getType().
Referenced by convertOmpTaskloopContextOp(), and getPrivateDataAddress().
|
static |
A compiler-generated barrier is unsafe when only part of the current team can reach it. This cannot always be determined statically (e.g. across a function call), but the enclosing OpenMP constructs can rule it out.
Definition at line 2360 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::Operation::getParentOp().
Referenced by emitPrivatizationBarrier().
|
static |
If we cancelled the construct, we should branch to the finalization block of that construct. OMPIRBuilder structures the CFG such that the cleanup block is immediately before the continuation block. Now this finalization has been created we can fix the branch.
Definition at line 3011 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpTaskloopContextOp(), convertOmpTaskOp(), and convertOmpWsloop().
|
static |
This function handles the insertion of a single item of map data from MapInfoData into the OMPIRBuilder's MapInfo list. Utilising this function means the map being inserted can be treated as a non-parent map entity, if the memberOfFlag is set then the map being inserted is treated as a member map of a larger entity. The insertion into the MapInfo list of the OMPIRBuilder can vary based on a number of factors, such as if it's a ref_ptr or ref_ptee map, if it's a member of a record, what construct the map belongs to and the various map type bit flags that are set for the map.
Definition at line 8199 of file OpenMPToLLVMIRTranslation.cpp.
References addNonContiguousUpdate(), checkIfPointerMap(), convertClauseMapFlags(), and isPrivatizeableAttachMap().
Referenced by genMapInfos(), and processMapWithMembersOf().
|
static |
Definition at line 8560 of file OpenMPToLLVMIRTranslation.cpp.
References getMapDataMemberIdx(), isPrivatizeableAttachMap(), mapParentWithMembers(), and processIndividualMap().
Referenced by genMapInfos().
|
static |
Shared implementation of a callback which adds a termiator for the new block created for the branch taken when an openmp construct is cancelled. The terminator is saved in cancelTerminators. This callback is invoked only if there is cancellation inside of the taskgroup body. The terminator will need to be fixed to branch to the correct block to cleanup the construct.
Definition at line 2981 of file OpenMPToLLVMIRTranslation.cpp.
References constructIsCancellable().
Referenced by convertOmpTaskloopContextOp(), convertOmpTaskOp(), and convertOmpWsloop().
|
static |
Select Virtual only for two host worksharing loops.
Definition at line 5587 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by convertOmpLoopNest().
|
static |
Definition at line 1737 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by cleanupPrivateVars(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), getPrivateDataAddress(), and initPrivateVars().
|
static |
Definition at line 7863 of file OpenMPToLLVMIRTranslation.cpp.
References ArrayAttr(), b, if(), and indices.
Referenced by getFirstOrLastMappedMemberPtr(), and mapParentWithMembers().
|
static |
Definition at line 3225 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by buildAffinityData(), and fillAffinityLocators().
| atomicGen |
Definition at line 1891 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by makeAtomicReductionGen().
| dataPtrPtrRedGen |
Definition at line 1891 of file OpenMPToLLVMIRTranslation.cpp.
| nullptr |
Definition at line 1891 of file OpenMPToLLVMIRTranslation.cpp.
Referenced by mlir::detail::AttrOpBinder< AttrT >::AttrOpBinder(), mlir::spirv::BlockMergeInfo::BlockMergeInfo(), mlir::BlockRange::BlockRange(), mlir::CallGraph::CallGraph(), mlir::sparse_tensor::CodegenEnv::CodegenEnv(), mlir::detail::constant_op_binder< AttrT >::constant_op_binder(), mlir::AsmParser::CyclicParseReset::CyclicParseReset(), mlir::AsmPrinter::CyclicPrintReset::CyclicPrintReset(), DynamicMemRefType< T >::DynamicMemRefType(), DynamicMemRefType< T >::DynamicMemRefType(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::ErrorCapture::ErrorCapture(), executeGetOperandsResults(), mlir::ExecutionEngine::ExecutionEngine(), mlir::acc::findCorrespondingDataExit(), findPayloadRoot(), mlir::AsmParserState::getAttributeAliasDef(), mlir::AsmParserState::getBlockDef(), mlir::detail::DialectInterfaceCollectionBase::getInterfaceFor(), mlir::Liveness::getLiveness(), mlir::PassExecutionAction::getOp(), mlir::AsmParserState::getOpDef(), mlir::AsmParserState::getTypeAliasDef(), inlineConvertOmpRegions(), inlineOmpRegionCleanup(), mlir::detail::Interface< ConcreteType, Attribute, Traits, Attribute, AttributeTrait::TraitBase >::Interface(), mlir::detail::Interface< ConcreteType, Attribute, Traits, Attribute, AttributeTrait::TraitBase >::Interface(), mlir::detail::Interface< ConcreteType, Attribute, Traits, Attribute, AttributeTrait::TraitBase >::Interface(), mlir::detail::Interface< ConcreteType, Attribute, Traits, Attribute, AttributeTrait::TraitBase >::Interface(), mlir::Lexer::Lexer(), mlir::pdll::Lexer::Lexer(), mlir::sparse_tensor::LoopEmitter::locateLvlAtAffineAddress(), mlir::PassInfo::lookup(), mlir::PassPipelineInfo::lookup(), mlir::pdll::ods::Context::lookupDialect(), mlir::CallGraph::lookupNode(), makeArrayAttr(), makeDenseBoolArrayAttr(), makeDenseI64ArrayAttr(), mlir::affine::NestedPattern::NestedPattern(), mlir::Op< ConcreteType, Traits >::Op(), mlir::Op< ConcreteType, Traits >::Op(), mlir::OwningOpRef< OpTy >::OwningOpRef(), mlir::Pattern::Pattern(), performActions(), mlir::ReductionNode::ReductionNode(), mlir::ShapedTypeComponents::ShapedTypeComponents(), mlir::ShapedTypeComponents::ShapedTypeComponents(), mlir::ShapedTypeComponents::ShapedTypeComponents(), mlir::ShapedTypeComponents::ShapedTypeComponents(), mlir::sparse_tensor::SparseIterator::SparseIterator(), mlir::detail::StringAttrStorage::StringAttrStorage(), mlir::spirv::detail::StructTypeStorage::StructTypeStorage(), mlir::pdl_to_pdl_interp::SuccessNode::SuccessNode(), and mlir::SuccessorRange::SuccessorRange().
| redGen |
Definition at line 1890 of file OpenMPToLLVMIRTranslation.cpp.