MLIR 23.0.0git
LowerFunctionDiscardablesToLLVM.h
Go to the documentation of this file.
1//===- LowerFunctionDiscardablesToLLVM.h - Func discardables to llvm - C++ -*-//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Shared helpers for lowering discardable attributes on any FunctionOpInterface
10// (e.g. func.func, gpu.func) into llvm.func properties and discardables.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_CONVERSION_LLVMCOMMON_LOWERFUNCTIONDISCARDABLESTOLLVM_H
15#define MLIR_CONVERSION_LLVMCOMMON_LOWERFUNCTIONDISCARDABLESTOLLVM_H
16
20
21namespace mlir {
22
23/// Result of lowering discardable attributes from a `FunctionOpInterface` to
24/// what `llvm.func` expects: typed inherent properties plus remaining
25/// discardable attributes.
27 LLVM::LLVMFuncOp::Properties properties;
29};
30
31/// Partition `funcOp`'s discardables for `llvm.func`: `sym_name`,
32/// `function_type`, and typed `properties` from `llvm.*` ODS attrs; other
33/// discardables unchanged. Fails if that property set is invalid; drops
34/// ODS-named attrs without `llvm.`.
35FailureOr<LoweredLLVMFuncAttrs>
36lowerDiscardableAttrsForLLVMFunc(FunctionOpInterface funcOp, Type llvmFuncType);
37
38} // namespace mlir
39
40#endif // MLIR_CONVERSION_LLVMCOMMON_LOWERFUNCTIONDISCARDABLESTOLLVM_H
NamedAttrList is array of NamedAttributes that tracks whether it is sorted and does some basic work t...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition Types.h:74
Include the generated interface declarations.
FailureOr< LoweredLLVMFuncAttrs > lowerDiscardableAttrsForLLVMFunc(FunctionOpInterface funcOp, Type llvmFuncType)
Partition funcOp's discardables for llvm.func: sym_name, function_type, and typed properties from llv...
Result of lowering discardable attributes from a FunctionOpInterface to what llvm....
LLVM::LLVMFuncOp::Properties properties