12#ifndef CLANG_CIR_LOWERTOLLVM_H
13#define CLANG_CIR_LOWERTOLLVM_H
15#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
16#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
17#include "mlir/Transforms/DialectConversion.h"
31 mlir::ConversionPatternRewriter &rewriter,
32 const mlir::TypeConverter *converter,
38 cir::SideEffect sideEffect,
39 mlir::LLVM::MemoryEffectsAttr &memoryEffect,
40 bool &noUnwind,
bool &willReturn,
bool &noReturn);
46 void mapBlockTag(cir::BlockAddrInfoAttr info, mlir::LLVM::BlockTagOp tagOp) {
47 [[maybe_unused]]
auto result = blockInfoToTagOp.try_emplace(info, tagOp);
48 assert(result.second &&
49 "attempting to map a BlockTag operation that is already mapped");
54 return blockInfoToTagOp.lookup(info);
59 cir::BlockAddrInfoAttr info) {
60 unresolvedBlockAddressOp.try_emplace(op, info);
65 llvm::DenseMap<mlir::LLVM::BlockAddressOp, cir::BlockAddrInfoAttr> &
67 return unresolvedBlockAddressOp;
73 llvm::DenseMap<cir::BlockAddrInfoAttr, mlir::LLVM::BlockTagOp>
79 llvm::DenseMap<mlir::LLVM::BlockAddressOp, cir::BlockAddrInfoAttr>
80 unresolvedBlockAddressOp;
84#define GET_LLVM_LOWERING_PATTERNS
85#include "clang/CIR/Dialect/IR/CIRLowering.inc"
86#undef GET_LLVM_LOWERING_PATTERNS
void convertSideEffectForCall(mlir::Operation *callOp, bool isNothrow, cir::SideEffect sideEffect, mlir::LLVM::MemoryEffectsAttr &memoryEffect, bool &noUnwind, bool &willReturn, bool &noReturn)
mlir::LLVM::Linkage convertLinkage(cir::GlobalLinkageKind linkage)
mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, const mlir::Attribute attr, mlir::ConversionPatternRewriter &rewriter, const mlir::TypeConverter *converter, LLVMBlockAddressInfo *blockInfoAddr)
Switches on the type of attribute and calls the appropriate conversion.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 int32_t
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 uint32_t
mlir::LLVM::BlockTagOp lookupBlockTag(cir::BlockAddrInfoAttr info) const
void clearUnresolvedMap()
llvm::DenseMap< mlir::LLVM::BlockAddressOp, cir::BlockAddrInfoAttr > & getUnresolvedBlockAddress()
void mapBlockTag(cir::BlockAddrInfoAttr info, mlir::LLVM::BlockTagOp tagOp)
void addUnresolvedBlockAddress(mlir::LLVM::BlockAddressOp op, cir::BlockAddrInfoAttr info)