"Standard-to-LLVM" conversion is one of the oldest passes in existence. It has become quite large due to the size of the Standard dialect itself, which is being split into multiple smaller dialects. Furthermore, several conversion features are useful for any dialect that is being converted to the LLVM dialect, which, without this refactoring, creates a dependency from those conversions to the "standard-to-llvm" one. Put several of the reusable utilities from this conversion to a separate library, namely: - type converter from builtin to LLVM dialect types; - utility for building and accessing values of LLVM structure type; - utility for building and accessing values that represent memref in the LLVM dialect; - lowering options applicable everywhere. Additionally, remove the type wrapping/unwrapping notion from the type converter that is no longer relevant since LLVM types has been reimplemented as first-class MLIR types. Reviewed By: pifon2a Differential Revision: https://reviews.llvm.org/D105534
26 lines
1.1 KiB
C++
26 lines
1.1 KiB
C++
//===- MemRefDescriptor.h - MemRef descriptor constants ---------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Defines constants that are used in LLVM dialect equivalents of MemRef type.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_LIB_CONVERSION_LLVMCOMMON_MEMREFDESCRIPTOR_H
|
|
#define MLIR_LIB_CONVERSION_LLVMCOMMON_MEMREFDESCRIPTOR_H
|
|
|
|
static constexpr unsigned kAllocatedPtrPosInMemRefDescriptor = 0;
|
|
static constexpr unsigned kAlignedPtrPosInMemRefDescriptor = 1;
|
|
static constexpr unsigned kOffsetPosInMemRefDescriptor = 2;
|
|
static constexpr unsigned kSizePosInMemRefDescriptor = 3;
|
|
static constexpr unsigned kStridePosInMemRefDescriptor = 4;
|
|
|
|
static constexpr unsigned kRankInUnrankedMemRefDescriptor = 0;
|
|
static constexpr unsigned kPtrInUnrankedMemRefDescriptor = 1;
|
|
|
|
#endif // MLIR_LIB_CONVERSION_LLVMCOMMON_MEMREFDESCRIPTOR_H
|