14 #ifndef MLIR_LIB_TARGET_LLVMIR_DATALAYOUTIMPORTER_H_
15 #define MLIR_LIB_TARGET_LLVMIR_DATALAYOUTIMPORTER_H_
38 FloatType
getFloatType(MLIRContext *context,
unsigned width);
49 const llvm::DataLayout &llvmDataLayout)
51 translateDataLayout(llvmDataLayout);
68 void translateDataLayout(
const llvm::DataLayout &llvmDataLayout);
72 FailureOr<StringRef> tryToParseAlphaPrefix(StringRef &token)
const;
76 FailureOr<uint64_t> tryToParseInt(StringRef &token)
const;
79 FailureOr<SmallVector<uint64_t>> tryToParseIntList(StringRef token)
const;
82 FailureOr<DenseIntElementsAttr> tryToParseAlignment(StringRef token)
const;
85 FailureOr<DenseIntElementsAttr>
86 tryToParsePointerAlignment(StringRef token)
const;
89 LogicalResult tryToEmplaceAlignmentEntry(
Type type, StringRef token);
92 LogicalResult tryToEmplacePointerAlignmentEntry(LLVMPointerType type,
96 LogicalResult tryToEmplaceEndiannessEntry(StringRef endianness,
100 LogicalResult tryToEmplaceAddrSpaceEntry(StringRef token,
101 llvm::StringLiteral spaceKey);
104 LogicalResult tryToEmplaceStackAlignmentEntry(StringRef token);
106 std::string layoutStr = {};
107 StringRef lastToken = {};
112 DataLayoutSpecInterface dataLayout;
Helper class that translates an LLVM data layout to an MLIR data layout specification.
StringRef getLastToken() const
Returns the last data layout token that has been processed before the data layout translation failed.
DataLayoutSpecInterface getDataLayout() const
Returns the MLIR data layout specification translated from the LLVM data layout.
DataLayoutImporter(MLIRContext *context, const llvm::DataLayout &llvmDataLayout)
ArrayRef< StringRef > getUnhandledTokens() const
Returns the data layout tokens that have not been handled during the data layout translation.
MLIRContext is the top-level object for a collection of MLIR operations.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
The OpAsmOpInterface, see OpAsmInterface.td for more details.
FloatType getFloatType(MLIRContext *context, unsigned width)
Returns a supported MLIR floating point type of the given bit width or null if the bit width is not s...
Include the generated interface declarations.