MLIR 24.0.0git
OpenACCUtils.cpp File Reference
#include "mlir/Dialect/OpenACC/OpenACCUtils.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/Casting.h"

Go to the source code of this file.

Functions

template<typename OpTy>
static bool isOnlyUsedByOpClauses (mlir::Value val, mlir::Region &region)
static mlir::Operation * lookupSymbolInGPUModules (mlir::Operation *user, mlir::SymbolRefAttr symbol)
 Look up symbol in the gpu.modules of the enclosing module.
static mlir::acc::GlobalVariableOpInterface lookupGlobalVariable (mlir::Operation *addrOf, mlir::SymbolRefAttr symbol, mlir::SymbolTableCollection *symbolTables)
 Finds the global variable that addrOf refers to, through symbolTables when provided (cached lookup) and by scanning the nearest symbol table otherwise.
static mlir::Value getIfCondition (mlir::Operation *op)

Function Documentation

◆ getIfCondition()

◆ isOnlyUsedByOpClauses()

template<typename OpTy>
bool isOnlyUsedByOpClauses ( mlir::Value val,
mlir::Region & region )
static

◆ lookupGlobalVariable()

mlir::acc::GlobalVariableOpInterface lookupGlobalVariable ( mlir::Operation * addrOf,
mlir::SymbolRefAttr symbol,
mlir::SymbolTableCollection * symbolTables )
static

Finds the global variable that addrOf refers to, through symbolTables when provided (cached lookup) and by scanning the nearest symbol table otherwise.

Definition at line 299 of file OpenACCUtils.cpp.

References mlir::SymbolTable::lookupNearestSymbolFrom(), and mlir::SymbolTableCollection::lookupNearestSymbolFrom().

Referenced by mlir::acc::isDeviceAccessibleValue(), and mlir::acc::isInDeviceMemoryValue().

◆ lookupSymbolInGPUModules()

mlir::Operation * lookupSymbolInGPUModules ( mlir::Operation * user,
mlir::SymbolRefAttr symbol )
static

Look up symbol in the gpu.modules of the enclosing module.

A gpu.module is its own symbol table, so lookupNearestSymbolFrom from a user outside of it does not find definitions placed inside.

Definition at line 218 of file OpenACCUtils.cpp.

References mlir::Operation::getParentOfType(), and mlir::SymbolTable::lookupSymbolIn().

Referenced by mlir::acc::isValidSymbolUse().