|
clang 24.0.0git
|
Classes | |
| class | CIRAttrToValue |
| class | CIRDialectLLVMIRTranslationInterface |
| Implementation of the dialect interface that converts CIR attributes to LLVM IR metadata. More... | |
| struct | ConvertCIRToLLVMPass |
| class | GlobalInitAttrRewriter |
| struct | LLVMBlockAddressInfo |
| struct | LoweredCallAttributes |
| class | OpenCLFunctionMetadataLowering |
Functions | |
| std::unique_ptr< llvm::Module > | lowerDirectlyFromCIRToLLVMIR (mlir::ModuleOp mlirModule, llvm::LLVMContext &llvmCtx, bool enableOpenMP, llvm::StringRef mlirSaveTempsOutFile={}, llvm::vfs::FileSystem *fs=nullptr) |
Lowers mlirModule, a CIR module, to an LLVM module in llvmCtx. | |
| std::unique_ptr< mlir::Pass > | createConvertCIRToLLVMPass () |
| Create a pass that fully lowers CIR to the LLVMIR dialect. | |
| void | populateCIRToLLVMPasses (mlir::OpPassManager &pm, bool enableOpenMP) |
| Adds passes that fully lower CIR to the LLVMIR dialect. | |
| static mlir::InFlightDiagnostic | emitTypeConversionError (mlir::Operation *op, mlir::Type type) |
| static mlir::InFlightDiagnostic | emitTypeConversionError (mlir::Location loc, mlir::Type type) |
| static uint64_t | getMemoryFallbackAlignment (mlir::Type cirType, mlir::Type llvmMemType, const mlir::DataLayout &dataLayout) |
| Alignment to use for a memory access whose op carries no explicit alignment. | |
| static mlir::Value | createIntCast (mlir::OpBuilder &bld, mlir::Value src, mlir::IntegerType dstTy, bool isSigned=false) |
| static mlir::Value | castBitIntMemoryStorage (mlir::ConversionPatternRewriter &rewriter, const mlir::DataLayout &dataLayout, cir::IntType intTy, mlir::Value value, bool toMemory) |
| Cast a _BitInt(N) value between its literal width iN and its padded in-memory storage iM (sign/zero-extend to memory per signedness so the padding bits are well-defined, truncate back on load; matches classic CodeGen). | |
| static mlir::LLVM::Visibility | lowerCIRVisibilityToLLVMVisibility (cir::VisibilityKind visibilityKind) |
| static mlir::Value | emitBoolVecConversion (mlir::ConversionPatternRewriter &rewriter, mlir::Value srcVec, unsigned numElementsDst) |
| static mlir::Value | emitFromMemory (mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter &converter, mlir::DataLayout const &dataLayout, cir::LoadOp op, mlir::Value value) |
| Emits the value from memory as expected by its users. | |
| static mlir::Value | emitToMemory (mlir::ConversionPatternRewriter &rewriter, mlir::DataLayout const &dataLayout, mlir::Type origType, mlir::Value value) |
| Emits a value to memory with the expected scalar type. | |
| mlir::LLVM::Linkage | convertLinkage (cir::GlobalLinkageKind linkage) |
| static mlir::LLVM::CConv | convertCallingConv (cir::CallingConv callingConv) |
| static mlir::LLVM::uwtable::UWTableKind | convertUWTableKind (cir::UnwindTableKind kind) |
| static mlir::LLVM::framePointerKind::FramePointerKind | convertFramePointerKind (cir::FramePointerKind kind) |
| static llvm::FramePointerKind | convertFramePointerKindToLLVMIR (cir::FramePointerKind kind) |
| The "frame-pointer" module flag holds an llvm::FramePointerKind value, as written by llvm::Module::setFramePointer. | |
| template<typename CIROp, typename LLVMOp> | |
| static mlir::LogicalResult | lowerMemTransferOp (CIROp op, typename CIROp::Adaptor adaptor, mlir::ConversionPatternRewriter &rewriter) |
| static mlir::Value | getLLVMIntCast (mlir::ConversionPatternRewriter &rewriter, mlir::Value llvmSrc, mlir::Type llvmDstIntTy, bool isUnsigned, uint64_t cirSrcWidth, uint64_t cirDstIntWidth) |
| mlir::Value | lowerCirAttrAsValue (mlir::Location parentLoc, mlir::ModuleOp parentModule, const mlir::Attribute attr, mlir::ConversionPatternRewriter &rewriter, mlir::SymbolTableCollection &symbolTables, const mlir::TypeConverter *converter, const CIRPreConversionTypeMap &preConversionTypes, LLVMBlockAddressInfo *blockInfoAddr) |
| Switches on the type of attribute and calls the appropriate conversion. | |
| static mlir::LLVM::ModRefInfo | convertModRefInfo (cir::ModRefInfo info) |
| static mlir::LLVM::MemoryEffectsAttr | convertMemoryEffects (mlir::MLIRContext *ctx, cir::MemoryEffectsAttr effects) |
| A null input stays null, which is how both dialects spell unknown effects. | |
| static void | convertCallEffects (mlir::Operation *callOp, bool isNothrow, cir::MemoryEffectsAttr effects, mlir::LLVM::MemoryEffectsAttr &memoryEffect, bool &noUnwind, bool &willReturn, bool &noReturn) |
| static mlir::LLVM::CallIntrinsicOp | createCallLLVMIntrinsicOp (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, const llvm::Twine &intrinsicName, mlir::Type resultTy, mlir::ValueRange operands, mlir::LLVM::FastmathFlags fastmathFlags={}) |
| static mlir::LLVM::CallIntrinsicOp | replaceOpWithCallLLVMIntrinsicOp (mlir::ConversionPatternRewriter &rewriter, mlir::Operation *op, const llvm::Twine &intrinsicName, mlir::Type resultTy, mlir::ValueRange operands, mlir::LLVM::FastmathFlags fastmathFlags={}) |
| static llvm::StringRef | getConstrainedRoundingMetadata (cir::FenvAttr fenv) |
| static llvm::StringRef | getConstrainedExceptMetadata (cir::FenvAttr fenv) |
| static mlir::Value | createFenvMetadataValue (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, llvm::StringRef str) |
| mlir::LogicalResult | lowerToConstrainedFPIntrinsic (mlir::Operation *op, mlir::ValueRange operands, cir::FenvAttr fenv, mlir::Type llvmResTy, mlir::ConversionPatternRewriter &rewriter, llvm::StringRef constrainedMnemonic, bool hasRoundingMode, mlir::LLVM::FastmathFlags fastmathFlags) |
| static mlir::LLVM::FastmathFlags | convertFastMathFlags (cir::FastMathFlags cirFlags) |
| static mlir::Value | createConstrainedFPIntrinsicCall (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, mlir::ValueRange operands, mlir::Type llvmResTy, cir::FenvAttr fenv, llvm::StringRef constrainedMnemonic, bool hasRoundingMode, mlir::LLVM::FastmathFlags fastmathFlags={}) |
| template<typename LLVMOp> | |
| mlir::LogicalResult | lowerConstrainableFPOp (mlir::Operation *op, mlir::ValueRange operands, cir::FenvAttr fenv, cir::FastMathFlagsAttr fastmath, const mlir::TypeConverter &typeConverter, mlir::ConversionPatternRewriter &rewriter, llvm::StringRef constrainedMnemonic, bool hasRoundingMode) |
| mlir::LLVM::FastmathFlagsAttr | convertToLLVMProperty (mlir::MLIRContext *ctx, std::optional< cir::FastMathFlags > flags) |
| mlir::IntegerAttr | convertToLLVMProperty (mlir::MLIRContext *ctx, cir::FPClassTest flags) |
| mlir::IntegerAttr | convertToLLVMProperty (mlir::MLIRContext *ctx, bool flag) |
| static mlir::LLVM::AtomicOrdering | getLLVMMemOrder (std::optional< cir::MemOrder > memorder) |
| static llvm::AtomicScope | getAtomicScope (cir::SyncScopeKind syncScope) |
| static llvm::StringRef | getLLVMSyncScope (cir::SyncScopeKind syncScope, mlir::ModuleOp moduleOp) |
| static std::optional< llvm::StringRef > | getLLVMSyncScope (std::optional< cir::SyncScopeKind > syncScope, mlir::ModuleOp moduleOp) |
| static void | forwardAMDGPUNoPrivateAddrSpace (mlir::Operation *op, mlir::Operation *llvmOp, mlir::Value llvmPtr) |
| static void | forwardAMDGPUAtomicOptionMarkers (mlir::Operation *op, mlir::Operation *llvmOp) |
| static mlir::LLVM::AtomicBinOp | getLLVMAtomicBinOp (cir::AtomicFetchKind k, bool isInt, bool isSignedInt) |
| static llvm::StringLiteral | getLLVMBinopForPostAtomic (cir::AtomicFetchKind k, bool isInt) |
| static mlir::Value | convertToIndexTy (mlir::ConversionPatternRewriter &rewriter, mlir::ModuleOp mod, mlir::Value index, mlir::Type baseTy, cir::IntType strideTy) |
| static std::optional< mlir::ArrayAttr > | convertTypedArgAttrs (mlir::ArrayAttr argAttrs, const mlir::TypeConverter &converter, const mlir::DataLayout &dataLayout, mlir::MLIRContext *ctx) |
| The llvm.byval, llvm.sret, and llvm.byref argument attributes carry the pointee type as a TypeAttr. | |
| static mlir::LogicalResult | lowerCallAttributes (cir::CIRCallOpInterface op, const mlir::TypeConverter &converter, const mlir::DataLayout &dataLayout, LoweredCallAttributes &result) |
| template<typename CallLikeOp> | |
| static void | setLoweredCallAttributes (CallLikeOp op, const LoweredCallAttributes &attributes) |
| static mlir::LogicalResult | rewriteCallOrInvoke (mlir::Operation *op, mlir::ValueRange callOperands, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter, const mlir::DataLayout &dataLayout, mlir::SymbolTableCollection &symbolTables, mlir::FlatSymbolRefAttr calleeAttr, mlir::Block *continueBlock=nullptr, mlir::Block *landingPadBlock=nullptr) |
| static mlir::Type | getConstArrayBaseElementType (mlir::Type ty) |
| static bool | isBulkLowerableConstArrayBaseElement (mlir::Type baseElemTy) |
| static uint64_t | getTypeAllocSize (mlir::Type type, mlir::Operation &op) |
| static bool | isHandledDiscardableFuncAttr (mlir::NamedAttribute attr) |
| Return true for discardable CIR markers handled explicitly below. | |
| static mlir::LLVM::ThreadLocalMode | convertTlsModelAttrToLLVM (TLSModelAttr attr) |
| static mlir::LLVM::GlobalOp | replaceCirGlobal (mlir::SymbolTableCollection &symbolTables, cir::GlobalOp op, mlir::Type llvmType, bool isConst, mlir::LLVM::Linkage linkage, llvm::StringRef symbol, mlir::Attribute init, uint64_t alignment, unsigned addrSpace, bool isDsoLocal, mlir::LLVM::ThreadLocalMode threadLocalMode, mlir::SymbolRefAttr comdatAttr, llvm::ArrayRef< mlir::NamedAttribute > attributes, mlir::ConversionPatternRewriter &rewriter) |
| static mlir::SymbolRefAttr | getComdatAttrHelper (mlir::ModuleOp modOp, mlir::OpBuilder &builder, StringRef symName, mlir::LLVM::ComdatOp &comdatOp, mlir::SymbolTableCollection &symbolTables) |
| static mlir::LLVM::IntegerOverflowFlags | nswFlag (bool nsw) |
| template<typename CIROp, typename LLVMIntOp> | |
| static mlir::LogicalResult | lowerIncDecOp (CIROp op, typename CIROp::Adaptor adaptor, mlir::ConversionPatternRewriter &rewriter) |
| static bool | isIntTypeUnsigned (mlir::Type type) |
| mlir::LLVM::IntegerOverflowFlags | convertToLLVMProperty (mlir::MLIRContext *, cir::OverflowFlags flags) |
| template<typename UIntOp, typename SIntOp, typename CIROp> | |
| static mlir::LogicalResult | lowerIntBinaryOp (CIROp op, mlir::Value lhs, mlir::Value rhs, mlir::ConversionPatternRewriter &rewriter) |
| Lower an integer op to its signed or unsigned LLVM counterpart. | |
| template<typename CIROp, typename UIntOp, typename SIntOp> | |
| static mlir::LogicalResult | lowerMinMaxOp (CIROp op, typename CIROp::Adaptor adaptor, mlir::ConversionPatternRewriter &rewriter) |
| static mlir::LLVM::ICmpPredicate | convertCmpKindToICmpPredicate (cir::CmpOpKind kind, bool isSigned) |
| Convert from a CIR comparison kind to an LLVM IR integral comparison kind. | |
| static mlir::LLVM::FCmpPredicate | convertCmpKindToFCmpPredicate (cir::CmpOpKind kind) |
| Convert from a CIR comparison kind to an LLVM IR floating-point comparison kind. | |
| static mlir::LLVM::FCmpPredicate | convertCmpKindToFCmpPredicate (cir::FCmpOpKind kind) |
| Convert from a CIR fp comparison kind to an LLVM IR floating-point comparison kind. | |
| static llvm::StringRef | convertCmpKindToConstrainedFCmpPredicate (cir::CmpOpKind kind) |
| static bool | isSignalingConstrainedFCmp (cir::CmpOpKind kind) |
| static llvm::StringRef | convertCmpKindToConstrainedFCmpPredicate (cir::FCmpOpKind kind) |
| template<typename OpKindTy> | |
| static mlir::LLVM::CallIntrinsicOp | createConstrainedFCmpCall (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, mlir::Value lhs, mlir::Value rhs, OpKindTy kind, bool isSignaling, cir::FenvAttr fenv, mlir::Type llvmResTy) |
| template<typename OpTy> | |
| static mlir::LogicalResult | lowerBinOpOverflow (OpTy op, typename OpTy::Adaptor adaptor, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *typeConverter, llvm::StringRef opStr) |
| Shared lowering logic for checked binary arithmetic overflow operations. | |
| static void | prepareTypeConverter (mlir::LLVMTypeConverter &converter, mlir::DataLayout &dataLayout) |
| static void | buildCtorDtorList (mlir::ModuleOp module, StringRef globalXtorName, StringRef llvmXtorName, llvm::function_ref< cir::GlobalCtorDtorEntry(mlir::Attribute)> createXtor) |
| void | createLLVMFuncOpIfNotExist (mlir::ConversionPatternRewriter &rewriter, mlir::SymbolTableCollection &symbolTables, mlir::Operation *srcOp, llvm::StringRef fnName, mlir::Type fnTy, mlir::ArrayAttr argAttrs=nullptr, mlir::ArrayAttr resAttrs=nullptr) |
| Declare fnName with type fnTy before the function enclosing srcOp, unless the module already has a symbol of that name. | |
| static mlir::LLVM::LLVMStructType | getLLVMLandingPadStructTy (mlir::ConversionPatternRewriter &rewriter) |
| static mlir::Value | getValueForVTableSymbol (mlir::Operation *op, mlir::ConversionPatternRewriter &rewriter, mlir::SymbolTableCollection &symbolTables, const mlir::TypeConverter *converter, const CIRPreConversionTypeMap &preConversionTypes, mlir::FlatSymbolRefAttr nameAttr, mlir::Type &eltType) |
| static mlir::Value | computeMatrixFlatIndex (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, cir::MatrixType matrixTy, mlir::Value rowIdx, mlir::Value columnIdx) |
| Computes the column-major flat index (columnIdx * numRows) + rowIdx. | |
| mlir::IntegerType | computeBitfieldIntType (mlir::Type storageType, mlir::MLIRContext *context, unsigned &storageSize) |
| static void | clearPadding (mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, mlir::Value inputPtr, uint64_t baseAlignment, cir::OffsetPairAttr paddingAttr) |
| std::unique_ptr< llvm::Module > | lowerDirectlyFromCIRToLLVMIR (mlir::ModuleOp mlirModule, LLVMContext &llvmCtx, bool enableOpenMP, StringRef mlirSaveTempsOutFile, llvm::vfs::FileSystem *fs) |
| void | registerCIRDialectTranslation (mlir::DialectRegistry ®istry) |
| mlir::LogicalResult | lowerNVPTXPrintf (cir::OffloadPrintfOp op, mlir::Value format, mlir::ValueRange args, mlir::ConversionPatternRewriter &rewriter, const mlir::DataLayout &dataLayout, mlir::SymbolTableCollection &symbolTables) |
Lowers op, whose lowered format and arguments are format and args, to a call to vprintf. | |
| mlir::LogicalResult | lowerAMDGPUPrintf (cir::OffloadPrintfOp op, mlir::ValueRange operands, mlir::ConversionPatternRewriter &rewriter, const mlir::DataLayout &dataLayout, mlir::SymbolTableCollection &symbolTables, unsigned genericAddrSpace, bool isBuffered) |
Lowers op, whose lowered operands are operands, to the buffered printf runtime interface if isBuffered and to hostcall printf otherwise. | |
| static void | convertOpenCLKernelArgMetadata (cir::OpenCLKernelArgMetadataAttr clArgMetadata, llvm::SmallVectorImpl< mlir::Attribute > &entries) |
| static void | createOpenCLVersionNamedMetadata (mlir::ModuleOp module, llvm::StringRef name, mlir::LLVM::MDNodeAttr node) |
| static void | emitOpenCLVersionMetadata (mlir::ModuleOp module, llvm::StringRef metadataName, mlir::Attribute versionAttr) |
| void | lowerOpenCLModuleMetadataAttrs (mlir::ModuleOp module) |
Variables | |
| static constexpr char | kTypeConversionErrorMsg [] |
|
static |
Definition at line 4666 of file LowerToLLVM.cpp.
References cir::CIRDataLayout::getProgramAddressSpace().
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
|
static |
Cast a _BitInt(N) value between its literal width iN and its padded in-memory storage iM (sign/zero-extend to memory per signedness so the padding bits are well-defined, truncate back on load; matches classic CodeGen).
Callers must first rule out the unsupported byte-array storage form (isSplitStorageBitInt / a null convertTypeForMemory result).
Definition at line 136 of file LowerToLLVM.cpp.
References createIntCast().
Referenced by emitFromMemory(), and emitToMemory().
|
static |
Definition at line 6710 of file LowerToLLVM.cpp.
References clearPadding().
Referenced by clearPadding().
| mlir::IntegerType cir::direct::computeBitfieldIntType | ( | mlir::Type | storageType, |
| mlir::MLIRContext * | context, | ||
| unsigned & | storageSize ) |
Definition at line 6241 of file LowerToLLVM.cpp.
References computeBitfieldIntType().
Referenced by computeBitfieldIntType().
|
static |
Computes the column-major flat index (columnIdx * numRows) + rowIdx.
Definition at line 5870 of file LowerToLLVM.cpp.
References computeMatrixFlatIndex(), and createIntCast().
Referenced by computeMatrixFlatIndex().
|
static |
Definition at line 576 of file LowerToLLVM.cpp.
References convertMemoryEffects().
Referenced by rewriteCallOrInvoke().
|
static |
Definition at line 295 of file LowerToLLVM.cpp.
Referenced by rewriteCallOrInvoke().
|
static |
Definition at line 4075 of file LowerToLLVM.cpp.
References kind.
Referenced by createConstrainedFCmpCall().
|
static |
Definition at line 4116 of file LowerToLLVM.cpp.
References kind.
|
static |
Convert from a CIR comparison kind to an LLVM IR floating-point comparison kind.
Definition at line 4007 of file LowerToLLVM.cpp.
References kind.
|
static |
Convert from a CIR fp comparison kind to an LLVM IR floating-point comparison kind.
Definition at line 4034 of file LowerToLLVM.cpp.
References kind.
|
static |
Convert from a CIR comparison kind to an LLVM IR integral comparison kind.
Definition at line 3981 of file LowerToLLVM.cpp.
References kind.
|
static |
Definition at line 748 of file LowerToLLVM.cpp.
Referenced by convertToLLVMProperty(), and lowerConstrainableFPOp().
|
static |
Definition at line 331 of file LowerToLLVM.cpp.
References kind.
|
static |
The "frame-pointer" module flag holds an llvm::FramePointerKind value, as written by llvm::Module::setFramePointer.
Definition at line 353 of file LowerToLLVM.cpp.
References kind.
Referenced by cir::direct::ConvertCIRToLLVMPass::processCIRAttrs().
| mlir::LLVM::Linkage cir::direct::convertLinkage | ( | cir::GlobalLinkageKind | linkage | ) |
Definition at line 264 of file LowerToLLVM.cpp.
|
static |
A null input stays null, which is how both dialects spell unknown effects.
Definition at line 563 of file LowerToLLVM.cpp.
References convertModRefInfo().
Referenced by convertCallEffects().
|
static |
Definition at line 547 of file LowerToLLVM.cpp.
Referenced by convertMemoryEffects().
|
static |
Definition at line 109 of file LowerToLLVMOpenCLMetadata.cpp.
|
static |
Definition at line 3403 of file LowerToLLVM.cpp.
References CHECK_ENUM.
|
static |
Definition at line 2184 of file LowerToLLVM.cpp.
References getLLVMIntCast(), and isUnsigned().
| mlir::LLVM::IntegerOverflowFlags cir::direct::convertToLLVMProperty | ( | mlir::MLIRContext * | , |
| cir::OverflowFlags | flags ) |
Definition at line 3899 of file LowerToLLVM.cpp.
| mlir::IntegerAttr cir::direct::convertToLLVMProperty | ( | mlir::MLIRContext * | ctx, |
| bool | flag ) |
Definition at line 743 of file LowerToLLVM.cpp.
| mlir::IntegerAttr cir::direct::convertToLLVMProperty | ( | mlir::MLIRContext * | ctx, |
| cir::FPClassTest | flags ) |
Definition at line 737 of file LowerToLLVM.cpp.
| mlir::LLVM::FastmathFlagsAttr cir::direct::convertToLLVMProperty | ( | mlir::MLIRContext * | ctx, |
| std::optional< cir::FastMathFlags > | flags ) |
Definition at line 731 of file LowerToLLVM.cpp.
References convertFastMathFlags().
|
static |
The llvm.byval, llvm.sret, and llvm.byref argument attributes carry the pointee type as a TypeAttr.
After the CallConvLowering pass that type is still a CIR type; remap it to the lowered LLVM type so translation to LLVM IR does not encounter a CIR type in an attribute. The pointee must name the in-memory storage type, not the value type, since it sizes the byval copy and the sret slot: a _BitInt narrower than its padded storage integer would otherwise understate both. Returns std::nullopt when a pointee has no memory representation, leaving the caller to emit the NYI error, and the input unchanged when there is nothing to convert.
Definition at line 2465 of file LowerToLLVM.cpp.
References convertTypeForMemory().
Referenced by lowerCallAttributes().
|
static |
Definition at line 315 of file LowerToLLVM.cpp.
References kind.
|
static |
Definition at line 591 of file LowerToLLVM.cpp.
Referenced by createConstrainedFCmpCall().
|
static |
Definition at line 4157 of file LowerToLLVM.cpp.
References convertCmpKindToConstrainedFCmpPredicate(), createCallLLVMIntrinsicOp(), createFenvMetadataValue(), getConstrainedExceptMetadata(), and kind.
|
static |
Definition at line 681 of file LowerToLLVM.cpp.
| std::unique_ptr< mlir::Pass > cir::direct::createConvertCIRToLLVMPass | ( | ) |
Create a pass that fully lowers CIR to the LLVMIR dialect.
Definition at line 6823 of file LowerToLLVM.cpp.
References createConvertCIRToLLVMPass().
Referenced by createConvertCIRToLLVMPass(), and populateCIRToLLVMPasses().
|
static |
Definition at line 652 of file LowerToLLVM.cpp.
Referenced by createConstrainedFCmpCall(), and lowerToConstrainedFPIntrinsic().
|
static |
Definition at line 111 of file LowerToLLVM.cpp.
Referenced by castBitIntMemoryStorage(), computeMatrixFlatIndex(), emitFromMemory(), and emitToMemory().
| void cir::direct::createLLVMFuncOpIfNotExist | ( | mlir::ConversionPatternRewriter & | rewriter, |
| mlir::SymbolTableCollection & | symbolTables, | ||
| mlir::Operation * | srcOp, | ||
| llvm::StringRef | fnName, | ||
| mlir::Type | fnTy, | ||
| mlir::ArrayAttr | argAttrs, | ||
| mlir::ArrayAttr | resAttrs ) |
Declare fnName with type fnTy before the function enclosing srcOp, unless the module already has a symbol of that name.
Definition at line 5235 of file LowerToLLVM.cpp.
References createLLVMFuncOpIfNotExist().
Referenced by createLLVMFuncOpIfNotExist(), and lowerNVPTXPrintf().
|
static |
Definition at line 182 of file LowerToLLVMOpenCLMetadata.cpp.
Referenced by emitOpenCLVersionMetadata().
|
static |
Definition at line 161 of file LowerToLLVM.cpp.
Referenced by emitFromMemory(), and emitToMemory().
|
static |
Emits the value from memory as expected by its users.
Should be called when the memory represetnation of a CIR type is not equal to its scalar representation.
Definition at line 181 of file LowerToLLVM.cpp.
References castBitIntMemoryStorage(), createIntCast(), and emitBoolVecConversion().
|
static |
Definition at line 192 of file LowerToLLVMOpenCLMetadata.cpp.
References createOpenCLVersionNamedMetadata().
Referenced by lowerOpenCLModuleMetadataAttrs().
|
static |
Emits a value to memory with the expected scalar type.
Should be called when the memory represetnation of a CIR type is not equal to its scalar representation.
Definition at line 221 of file LowerToLLVM.cpp.
References castBitIntMemoryStorage(), createIntCast(), and emitBoolVecConversion().
|
static |
Definition at line 94 of file LowerToLLVM.cpp.
References kTypeConversionErrorMsg.
|
static |
Definition at line 89 of file LowerToLLVM.cpp.
References kTypeConversionErrorMsg.
Referenced by getValueForVTableSymbol().
|
static |
Definition at line 1536 of file LowerToLLVM.cpp.
|
static |
Definition at line 1524 of file LowerToLLVM.cpp.
|
static |
Definition at line 1477 of file LowerToLLVM.cpp.
Referenced by getLLVMSyncScope().
|
static |
Definition at line 3699 of file LowerToLLVM.cpp.
|
static |
Definition at line 2834 of file LowerToLLVM.cpp.
|
static |
Definition at line 641 of file LowerToLLVM.cpp.
Referenced by createConstrainedFCmpCall(), and lowerToConstrainedFPIntrinsic().
|
static |
Definition at line 619 of file LowerToLLVM.cpp.
Referenced by lowerToConstrainedFPIntrinsic().
|
static |
Definition at line 1651 of file LowerToLLVM.cpp.
|
static |
Definition at line 1693 of file LowerToLLVM.cpp.
|
static |
Definition at line 476 of file LowerToLLVM.cpp.
References isUnsigned().
Referenced by convertToIndexTy().
|
static |
Definition at line 5332 of file LowerToLLVM.cpp.
References getLLVMLandingPadStructTy().
Referenced by getLLVMLandingPadStructTy().
|
static |
Definition at line 1458 of file LowerToLLVM.cpp.
|
static |
Definition at line 1505 of file LowerToLLVM.cpp.
References getAtomicScope().
Referenced by getLLVMSyncScope().
|
static |
Definition at line 1517 of file LowerToLLVM.cpp.
References getLLVMSyncScope().
|
static |
Alignment to use for a memory access whose op carries no explicit alignment.
For _BitInt the storage integer iM's ABI alignment (e.g. i128's 16) over-aligns the value, so use the CIR _BitInt ABI alignment (e.g. 8).
Definition at line 102 of file LowerToLLVM.cpp.
|
static |
Definition at line 3014 of file LowerToLLVM.cpp.
|
static |
Definition at line 5501 of file LowerToLLVM.cpp.
References emitTypeConversionError(), and getValueForVTableSymbol().
Referenced by getValueForVTableSymbol().
|
static |
Definition at line 2840 of file LowerToLLVM.cpp.
|
static |
Return true for discardable CIR markers handled explicitly below.
Definition at line 3091 of file LowerToLLVM.cpp.
|
static |
Definition at line 3887 of file LowerToLLVM.cpp.
Referenced by lowerIntBinaryOp(), and lowerMinMaxOp().
|
static |
Definition at line 4098 of file LowerToLLVM.cpp.
References kind.
| mlir::LogicalResult cir::direct::lowerAMDGPUPrintf | ( | cir::OffloadPrintfOp | op, |
| mlir::ValueRange | operands, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| const mlir::DataLayout & | dataLayout, | ||
| mlir::SymbolTableCollection & | symbolTables, | ||
| unsigned | genericAddrSpace, | ||
| bool | isBuffered ) |
Lowers op, whose lowered operands are operands, to the buffered printf runtime interface if isBuffered and to hostcall printf otherwise.
Strings are passed to the runtime in genericAddrSpace.
Definition at line 704 of file LowerToLLVMOffloadPrintfAMDGPU.cpp.
|
static |
Shared lowering logic for checked binary arithmetic overflow operations.
The opStr parameter specifies the arithmetic operation name used in the LLVM intrinsic (e.g., "add", "sub", "mul").
Definition at line 4281 of file LowerToLLVM.cpp.
References sign().
|
static |
Definition at line 2505 of file LowerToLLVM.cpp.
References cir::direct::LoweredCallAttributes::argAttrs, convertTypedArgAttrs(), cir::direct::LoweredCallAttributes::discardableAttrs, cir::MissingFeatures::opFuncExtraAttrs(), and cir::direct::LoweredCallAttributes::resAttrs.
Referenced by rewriteCallOrInvoke().
| mlir::Value cir::direct::lowerCirAttrAsValue | ( | mlir::Location | parentLoc, |
| mlir::ModuleOp | parentModule, | ||
| mlir::Attribute | attr, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| mlir::SymbolTableCollection & | symbolTables, | ||
| const mlir::TypeConverter * | converter, | ||
| const CIRPreConversionTypeMap & | preConversionTypes, | ||
| LLVMBlockAddressInfo * | blockInfoAddr = nullptr ) |
Switches on the type of attribute and calls the appropriate conversion.
Convert a CIR attribute to an LLVM value, or return null on failure.
May use the datalayout for lowering attributes to-be-stored in memory. When the attribute may contain block address attributes, blockInfoAddr is used to resolve them.
Definition at line 535 of file LowerToLLVM.cpp.
|
static |
Definition at line 148 of file LowerToLLVM.cpp.
| mlir::LogicalResult cir::direct::lowerConstrainableFPOp | ( | mlir::Operation * | op, |
| mlir::ValueRange | operands, | ||
| cir::FenvAttr | fenv, | ||
| cir::FastMathFlagsAttr | fastmath, | ||
| const mlir::TypeConverter & | typeConverter, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| llvm::StringRef | constrainedMnemonic, | ||
| bool | hasRoundingMode ) |
Definition at line 701 of file LowerToLLVM.cpp.
References convertFastMathFlags(), cir::getDefaultProperties(), and lowerToConstrainedFPIntrinsic().
| std::unique_ptr< llvm::Module > cir::direct::lowerDirectlyFromCIRToLLVMIR | ( | mlir::ModuleOp | mlirModule, |
| llvm::LLVMContext & | llvmCtx, | ||
| bool | enableOpenMP, | ||
| llvm::StringRef | mlirSaveTempsOutFile = {}, | ||
| llvm::vfs::FileSystem * | fs = nullptr ) |
Lowers mlirModule, a CIR module, to an LLVM module in llvmCtx.
Returns null if lowering fails; the error has then been reported through the MLIR diagnostic engine of mlirModule's context.
Referenced by lowerDirectlyFromCIRToLLVMIR().
| std::unique_ptr< llvm::Module > cir::direct::lowerDirectlyFromCIRToLLVMIR | ( | mlir::ModuleOp | mlirModule, |
| LLVMContext & | llvmCtx, | ||
| bool | enableOpenMP, | ||
| StringRef | mlirSaveTempsOutFile, | ||
| llvm::vfs::FileSystem * | fs ) |
Definition at line 6840 of file LowerToLLVM.cpp.
References lowerDirectlyFromCIRToLLVMIR(), populateCIRToLLVMPasses(), and mlir::registerCIRDialectTranslation().
|
static |
Definition at line 3794 of file LowerToLLVM.cpp.
References nswFlag().
|
static |
Lower an integer op to its signed or unsigned LLVM counterpart.
Definition at line 3912 of file LowerToLLVM.cpp.
References isIntTypeUnsigned().
|
static |
Definition at line 412 of file LowerToLLVM.cpp.
|
static |
Definition at line 3954 of file LowerToLLVM.cpp.
References isIntTypeUnsigned().
| mlir::LogicalResult cir::direct::lowerNVPTXPrintf | ( | cir::OffloadPrintfOp | op, |
| mlir::Value | format, | ||
| mlir::ValueRange | args, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| const mlir::DataLayout & | dataLayout, | ||
| mlir::SymbolTableCollection & | symbolTables ) |
Lowers op, whose lowered format and arguments are format and args, to a call to vprintf.
Definition at line 101 of file LowerToLLVMOffloadPrintfNVPTX.cpp.
References createLLVMFuncOpIfNotExist().
| void cir::direct::lowerOpenCLModuleMetadataAttrs | ( | mlir::ModuleOp | module | ) |
Definition at line 206 of file LowerToLLVMOpenCLMetadata.cpp.
References emitOpenCLVersionMetadata().
Referenced by cir::direct::ConvertCIRToLLVMPass::processCIRAttrs().
| mlir::LogicalResult cir::direct::lowerToConstrainedFPIntrinsic | ( | mlir::Operation * | op, |
| mlir::ValueRange | operands, | ||
| cir::FenvAttr | fenv, | ||
| mlir::Type | llvmResTy, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| llvm::StringRef | constrainedMnemonic, | ||
| bool | hasRoundingMode, | ||
| mlir::LLVM::FastmathFlags | fastmathFlags ) |
Definition at line 659 of file LowerToLLVM.cpp.
References createFenvMetadataValue(), getConstrainedExceptMetadata(), getConstrainedRoundingMetadata(), and replaceOpWithCallLLVMIntrinsicOp().
Referenced by lowerConstrainableFPOp().
|
static |
Definition at line 3787 of file LowerToLLVM.cpp.
Referenced by lowerIncDecOp().
| void cir::direct::populateCIRToLLVMPasses | ( | mlir::OpPassManager & | pm, |
| bool | enableOpenMP ) |
Adds passes that fully lower CIR to the LLVMIR dialect.
When enableOpenMP is set (-fopenmp), the OpenMP lowering passes are also added.
Definition at line 6827 of file LowerToLLVM.cpp.
References createConvertCIRToLLVMPass(), mlir::populateCIRPreLoweringPasses(), and populateCIRToLLVMPasses().
Referenced by lowerDirectlyFromCIRToLLVMIR(), and populateCIRToLLVMPasses().
|
static |
Definition at line 4500 of file LowerToLLVM.cpp.
References cir::MissingFeatures::addressSpace(), convertTypeForMemory(), cir::memberOwnsBytes(), and cir::memberStorageType().
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
| void cir::direct::registerCIRDialectTranslation | ( | mlir::DialectRegistry & | registry | ) |
Definition at line 226 of file LowerToLLVMIR.cpp.
Referenced by mlir::registerCIRDialectTranslation().
|
static |
Definition at line 3526 of file LowerToLLVM.cpp.
|
static |
Definition at line 609 of file LowerToLLVM.cpp.
Referenced by lowerToConstrainedFPIntrinsic().
|
static |
Definition at line 2548 of file LowerToLLVM.cpp.
References convertCallEffects(), convertCallingConv(), lowerCallAttributes(), cir::MissingFeatures::opCallInvokeAttrs(), and setLoweredCallAttributes().
|
static |
Definition at line 2534 of file LowerToLLVM.cpp.
References cir::direct::LoweredCallAttributes::argAttrs, cir::direct::LoweredCallAttributes::discardableAttrs, and cir::direct::LoweredCallAttributes::resAttrs.
Referenced by rewriteCallOrInvoke().
|
staticconstexpr |
Definition at line 86 of file LowerToLLVM.cpp.
Referenced by emitTypeConversionError(), and emitTypeConversionError().