|
clang 23.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 |
Functions | |
| std::unique_ptr< llvm::Module > | lowerDirectlyFromCIRToLLVMIR (mlir::ModuleOp mlirModule, llvm::LLVMContext &llvmCtx) |
| std::unique_ptr< mlir::Pass > | createConvertCIRToLLVMPass () |
| Create a pass that fully lowers CIR to the LLVMIR dialect. | |
| void | populateCIRToLLVMPasses (mlir::OpPassManager &pm) |
| Adds passes that fully lower CIR to the LLVMIR dialect. | |
| static mlir::Type | convertTypeForMemory (const mlir::TypeConverter &converter, mlir::DataLayout const &dataLayout, mlir::Type type) |
| Given a type convertor and a data layout, convert the given type to a type that is suitable for memory operations. | |
| static mlir::Value | createIntCast (mlir::OpBuilder &bld, mlir::Value src, mlir::IntegerType dstTy, bool isSigned=false) |
| static mlir::LLVM::Visibility | lowerCIRVisibilityToLLVMVisibility (cir::VisibilityKind visibilityKind) |
| static mlir::Value | emitFromMemory (mlir::ConversionPatternRewriter &rewriter, 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::Value | getLLVMIntCast (mlir::ConversionPatternRewriter &rewriter, mlir::Value llvmSrc, mlir::Type llvmDstIntTy, bool isUnsigned, uint64_t cirSrcWidth, uint64_t cirDstIntWidth) |
| mlir::Value | lowerCirAttrAsValue (mlir::Operation *parentOp, const mlir::Attribute attr, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter, cir::LowerModule *lowerMod) |
| Switches on the type of attribute and calls the appropriate conversion. | |
| void | convertSideEffectForCall (mlir::Operation *callOp, bool isNothrow, cir::SideEffect sideEffect, 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) |
| static mlir::LLVM::CallIntrinsicOp | replaceOpWithCallLLVMIntrinsicOp (mlir::ConversionPatternRewriter &rewriter, mlir::Operation *op, const llvm::Twine &intrinsicName, mlir::Type resultTy, mlir::ValueRange operands) |
| static mlir::LLVM::AtomicOrdering | getLLVMMemOrder (std::optional< cir::MemOrder > memorder) |
| static std::optional< llvm::StringRef > | getLLVMSyncScope (std::optional< cir::SyncScopeKind > syncScope) |
| static mlir::LLVM::AtomicBinOp | getLLVMAtomicBinOp (cir::AtomicFetchKind k, bool isInt, bool isSignedInt) |
| static llvm::StringLiteral | getLLVMBinop (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 void | lowerCallAttributes (cir::CIRCallOpInterface op, SmallVectorImpl< mlir::NamedAttribute > &result) |
| static mlir::LogicalResult | rewriteCallOrInvoke (mlir::Operation *op, mlir::ValueRange callOperands, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter, mlir::FlatSymbolRefAttr calleeAttr) |
| bool | hasTrailingZeros (cir::ConstArrayAttr attr) |
| static uint64_t | getTypeSize (mlir::Type type, mlir::Operation &op) |
| static bool | isIntTypeUnsigned (mlir::Type type) |
| 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. | |
| std::unique_ptr< cir::LowerModule > | prepareLowerModule (mlir::ModuleOp module) |
| static void | prepareTypeConverter (mlir::LLVMTypeConverter &converter, mlir::DataLayout &dataLayout, cir::LowerModule *lowerModule) |
| static void | buildCtorDtorList (mlir::ModuleOp module, StringRef globalXtorName, StringRef llvmXtorName, llvm::function_ref< std::pair< StringRef, int >(mlir::Attribute)> createXtor) |
| static void | collectUnreachable (mlir::Operation *parent, llvm::SmallVector< mlir::Operation * > &ops) |
| void | createLLVMFuncOpIfNotExist (mlir::ConversionPatternRewriter &rewriter, mlir::Operation *srcOp, llvm::StringRef fnName, mlir::Type fnTy) |
| static mlir::LLVM::LLVMStructType | getLLVMLandingPadStructTy (mlir::ConversionPatternRewriter &rewriter) |
| static mlir::Value | getValueForVTableSymbol (mlir::Operation *op, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter, mlir::FlatSymbolRefAttr nameAttr, mlir::Type &eltType) |
| mlir::IntegerType | computeBitfieldIntType (mlir::Type storageType, mlir::MLIRContext *context, unsigned &storageSize) |
| std::unique_ptr< llvm::Module > | lowerDirectlyFromCIRToLLVMIR (mlir::ModuleOp mlirModule, LLVMContext &llvmCtx) |
| mlir::Value | lowerCirAttrAsValue (mlir::Operation *parentOp, mlir::Attribute attr, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter) |
| Convert a CIR attribute to an LLVM attribute. | |
| void | convertSideEffectForCall (mlir::Operation *callOp, bool isNothrow, cir::SideEffect sideEffect, mlir::LLVM::MemoryEffectsAttr &memoryEffect, bool &noUnwind, bool &willReturn) |
| void | registerCIRDialectTranslation (mlir::DialectRegistry ®istry) |
|
static |
Definition at line 3128 of file LowerToLLVM.cpp.
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
|
static |
Definition at line 3226 of file LowerToLLVM.cpp.
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
| mlir::IntegerType cir::direct::computeBitfieldIntType | ( | mlir::Type | storageType, |
| mlir::MLIRContext * | context, | ||
| unsigned & | storageSize ) |
Definition at line 4101 of file LowerToLLVM.cpp.
|
static |
Convert from a CIR comparison kind to an LLVM IR floating-point comparison kind.
Definition at line 2689 of file LowerToLLVM.cpp.
References kind.
|
static |
Convert from a CIR comparison kind to an LLVM IR integral comparison kind.
Definition at line 2666 of file LowerToLLVM.cpp.
References kind.
| mlir::LLVM::Linkage cir::direct::convertLinkage | ( | cir::GlobalLinkageKind | linkage | ) |
Definition at line 149 of file LowerToLLVM.cpp.
| void cir::direct::convertSideEffectForCall | ( | mlir::Operation * | callOp, |
| bool | isNothrow, | ||
| cir::SideEffect | sideEffect, | ||
| mlir::LLVM::MemoryEffectsAttr & | memoryEffect, | ||
| bool & | noUnwind, | ||
| bool & | willReturn ) |
| void cir::direct::convertSideEffectForCall | ( | mlir::Operation * | callOp, |
| bool | isNothrow, | ||
| cir::SideEffect | sideEffect, | ||
| mlir::LLVM::MemoryEffectsAttr & | memoryEffect, | ||
| bool & | noUnwind, | ||
| bool & | willReturn, | ||
| bool & | noReturn ) |
Definition at line 310 of file LowerToLLVM.cpp.
Referenced by rewriteCallOrInvoke().
|
static |
Definition at line 1368 of file LowerToLLVM.cpp.
References getLLVMIntCast(), and isUnsigned().
|
static |
Given a type convertor and a data layout, convert the given type to a type that is suitable for memory operations.
For example, this can be used to lower cir.bool accesses to i8.
Definition at line 70 of file LowerToLLVM.cpp.
Referenced by prepareTypeConverter(), and cir::direct::CIRAttrToValue::visitCirAttr().
|
static |
Definition at line 353 of file LowerToLLVM.cpp.
Referenced by replaceOpWithCallLLVMIntrinsicOp().
| std::unique_ptr< mlir::Pass > cir::direct::createConvertCIRToLLVMPass | ( | ) |
Create a pass that fully lowers CIR to the LLVMIR dialect.
Definition at line 4466 of file LowerToLLVM.cpp.
Referenced by populateCIRToLLVMPasses().
|
static |
Definition at line 83 of file LowerToLLVM.cpp.
Referenced by emitFromMemory(), and emitToMemory().
| void cir::direct::createLLVMFuncOpIfNotExist | ( | mlir::ConversionPatternRewriter & | rewriter, |
| mlir::Operation * | srcOp, | ||
| llvm::StringRef | fnName, | ||
| mlir::Type | fnTy ) |
Definition at line 3431 of file LowerToLLVM.cpp.
|
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 117 of file LowerToLLVM.cpp.
References createIntCast().
|
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 134 of file LowerToLLVM.cpp.
References createIntCast().
|
static |
Definition at line 906 of file LowerToLLVM.cpp.
|
static |
Definition at line 936 of file LowerToLLVM.cpp.
|
static |
Definition at line 240 of file LowerToLLVM.cpp.
References isUnsigned().
Referenced by convertToIndexTy().
|
static |
Definition at line 3515 of file LowerToLLVM.cpp.
|
static |
Definition at line 788 of file LowerToLLVM.cpp.
|
static |
Definition at line 808 of file LowerToLLVM.cpp.
|
static |
Definition at line 1965 of file LowerToLLVM.cpp.
|
static |
Definition at line 3633 of file LowerToLLVM.cpp.
| bool cir::direct::hasTrailingZeros | ( | cir::ConstArrayAttr | attr | ) |
Definition at line 1818 of file LowerToLLVM.cpp.
|
static |
Definition at line 2555 of file LowerToLLVM.cpp.
|
static |
Definition at line 1609 of file LowerToLLVM.cpp.
References cir::MissingFeatures::opFuncCallingConv(), and cir::MissingFeatures::opFuncExtraAttrs().
Referenced by rewriteCallOrInvoke().
| mlir::Value cir::direct::lowerCirAttrAsValue | ( | mlir::Operation * | parentOp, |
| const mlir::Attribute | attr, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| const mlir::TypeConverter * | converter, | ||
| cir::LowerModule * | lowerMod ) |
Switches on the type of attribute and calls the appropriate conversion.
Definition at line 298 of file LowerToLLVM.cpp.
References cir::direct::CIRAttrToValue::visit().
| mlir::Value cir::direct::lowerCirAttrAsValue | ( | mlir::Operation * | parentOp, |
| mlir::Attribute | attr, | ||
| mlir::ConversionPatternRewriter & | rewriter, | ||
| const mlir::TypeConverter * | converter ) |
Convert a CIR attribute to an LLVM attribute.
May use the datalayout for lowering attributes to-be-stored in memory.
|
static |
Definition at line 103 of file LowerToLLVM.cpp.
| std::unique_ptr< llvm::Module > cir::direct::lowerDirectlyFromCIRToLLVMIR | ( | mlir::ModuleOp | mlirModule, |
| llvm::LLVMContext & | llvmCtx ) |
Referenced by cir::lowerFromCIRToLLVMIR().
| std::unique_ptr< llvm::Module > cir::direct::lowerDirectlyFromCIRToLLVMIR | ( | mlir::ModuleOp | mlirModule, |
| LLVMContext & | llvmCtx ) |
Definition at line 4476 of file LowerToLLVM.cpp.
References populateCIRToLLVMPasses(), and mlir::registerCIRDialectTranslation().
| void cir::direct::populateCIRToLLVMPasses | ( | mlir::OpPassManager & | pm | ) |
Adds passes that fully lower CIR to the LLVMIR dialect.
Definition at line 4470 of file LowerToLLVM.cpp.
References createConvertCIRToLLVMPass(), and mlir::populateCIRPreLoweringPasses().
Referenced by lowerDirectlyFromCIRToLLVMIR().
| std::unique_ptr< cir::LowerModule > cir::direct::prepareLowerModule | ( | mlir::ModuleOp | module | ) |
Definition at line 3007 of file LowerToLLVM.cpp.
References cir::createLowerModule(), and cir::MissingFeatures::makeTripleAlwaysPresent().
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
|
static |
Definition at line 3018 of file LowerToLLVM.cpp.
References cir::MissingFeatures::addressSpace(), and convertTypeForMemory().
Referenced by cir::direct::ConvertCIRToLLVMPass::runOnOperation().
| void cir::direct::registerCIRDialectTranslation | ( | mlir::DialectRegistry & | registry | ) |
Definition at line 52 of file LowerToLLVMIR.cpp.
Referenced by mlir::registerCIRDialectTranslation().
|
static |
Definition at line 362 of file LowerToLLVM.cpp.
References createCallLLVMIntrinsicOp().
|
static |
Definition at line 1626 of file LowerToLLVM.cpp.
References convertSideEffectForCall(), lowerCallAttributes(), cir::MissingFeatures::opCallCallConv(), cir::MissingFeatures::opCallContinueBlock(), and cir::MissingFeatures::opCallLandingPad().