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);
86 tryToParsePointerAlignment(StringRef token)
const;
92 LogicalResult tryToEmplacePointerAlignmentEntry(LLVMPointerType type,
96 LogicalResult tryToEmplaceEndiannessEntry(StringRef endianness,
100 LogicalResult tryToEmplaceAllocaAddrSpaceEntry(StringRef token);
103 LogicalResult tryToEmplaceStackAlignmentEntry(StringRef token);
105 std::string layoutStr = {};
106 StringRef lastToken = {};
111 DataLayoutSpecInterface dataLayout;
This class provides support for representing a failure result, or a valid value of type T.
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...
Include the generated interface declarations.
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.
This class represents an efficient way to signal success or failure.