[mlir][arith] Change dialect name from Arithmetic to Arith
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22. Tested with: `ninja check-mlir check-mlir-integration check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner check-mlir-examples` and `bazel build --config=generic_clang @llvm-project//mlir:all`. Reviewed By: lattner, Mogball, rriddle, jpienaar, mehdi_amini Differential Revision: https://reviews.llvm.org/D134762
This commit is contained in:
parent
ffb2a1534d
commit
abc362a107
|
@ -14,8 +14,8 @@ from the [MLIR LangRef](LangRef.md).
|
|||
|
||||
Attributes are the mechanism for specifying constant data on operations in
|
||||
places where a variable is never allowed - e.g. the comparison predicate of a
|
||||
[`arith.cmpi` operation](Dialects/ArithmeticOps.md#arithcmpi-mlirarithcmpiop), or
|
||||
the underlying value of a [`arith.constant` operation](Dialects/ArithmeticOps.md#arithconstant-mlirarithconstantop).
|
||||
[`arith.cmpi` operation](Dialects/ArithOps.md#arithcmpi-mlirarithcmpiop), or
|
||||
the underlying value of a [`arith.constant` operation](Dialects/ArithOps.md#arithconstant-mlirarithconstantop).
|
||||
Each operation has an attribute dictionary, which associates a set of attribute
|
||||
names to attribute values.
|
||||
|
||||
|
@ -24,7 +24,7 @@ names to attribute values.
|
|||
Every SSA value, such as operation results or block arguments, in MLIR has a type
|
||||
defined by the type system. MLIR has an open type system with no fixed list of types,
|
||||
and there are no restrictions on the abstractions they represent. For example, take
|
||||
the following [Arithmetic AddI operation](Dialects/ArithmeticOps.md#arithaddi-mlirarithaddiop):
|
||||
the following [Arithmetic AddI operation](Dialects/ArithOps.md#arithaddi-mlirarithaddiop):
|
||||
|
||||
```mlir
|
||||
%result = arith.addi %lhs, %rhs : i64
|
||||
|
|
|
@ -13,7 +13,7 @@ Dialects are the mechanism by which to engage with and extend the MLIR
|
|||
ecosystem. They allow for defining new [attributes](LangRef.md#attributes),
|
||||
[operations](LangRef.md#operations), and [types](LangRef.md#type-system).
|
||||
Dialects are used to model a variety of different abstractions; from traditional
|
||||
[arithmetic](Dialects/ArithmeticOps.md) to
|
||||
[arithmetic](Dialects/ArithOps.md) to
|
||||
[pattern rewrites](Dialects/PDLOps.md); and is one of the most fundamental
|
||||
aspects of MLIR.
|
||||
|
||||
|
@ -122,7 +122,7 @@ dialect. Dialect dependencies can be recorded using the `dependentDialects` dial
|
|||
def MyDialect : Dialect {
|
||||
// Here we register the Arithmetic and Func dialect as dependencies of our `MyDialect`.
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"func::FuncDialect"
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1079,7 +1079,7 @@ returns an SSA value generated from an `spirv.mlir.addressof` operation.
|
|||
|
||||
Using the above infrastructure, conversions are implemented from
|
||||
|
||||
* [Arithmetic Dialect][MlirArithmeticDialect]
|
||||
* [Arith Dialect][MlirArithDialect]
|
||||
* [GPU Dialect][MlirGpuDialect] : A gpu.module is converted to a `spirv.module`.
|
||||
A gpu.function within this module is lowered as an entry function.
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ Vectors) are welcome future extensions.
|
|||
|
||||
### Virtual Vector Ops
|
||||
|
||||
Some existing Arithmetic and Vector Dialect on `n-D` `vector` types comprise:
|
||||
Some existing Arith and Vector Dialect on `n-D` `vector` types comprise:
|
||||
|
||||
```mlir
|
||||
// Produces a vector<3x7x8xf32>
|
||||
|
|
|
@ -744,7 +744,7 @@ attribute-value ::= attribute-alias | dialect-attribute | builtin-attribute
|
|||
|
||||
Attributes are the mechanism for specifying constant data on operations in
|
||||
places where a variable is never allowed - e.g. the comparison predicate of a
|
||||
[`cmpi` operation](Dialects/ArithmeticOps.md#arithcmpi-mlirarithcmpiop). Each operation has an
|
||||
[`cmpi` operation](Dialects/ArithOps.md#arithcmpi-mlirarithcmpiop). Each operation has an
|
||||
attribute dictionary, which associates a set of attribute names to attribute
|
||||
values. MLIR's builtin dialect provides a rich set of
|
||||
[builtin attribute values](#builtin-attribute-values) out of the box (such as
|
||||
|
|
|
@ -26,7 +26,7 @@ This document describes the available MLIR passes and their contracts.
|
|||
|
||||
## `arith` Dialect Passes
|
||||
|
||||
[include "ArithmeticPasses.md"]
|
||||
[include "ArithPasses.md"]
|
||||
|
||||
## `func` Dialect Passes
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ an external system, and should aim to reflect its design as closely as possible.
|
|||
|
||||
### Splitting floating point vs integer operations
|
||||
|
||||
The MLIR "Arithmetic" dialect splits many integer and floating point operations
|
||||
The MLIR "Arith" dialect splits many integer and floating point operations
|
||||
into different categories, for example `arith.addf` vs `arith.addi` and
|
||||
`arith.cmpf` vs `arith.cmpi`
|
||||
([following the design of LLVM](http://llvm.org/docs/LangRef.html#binary-operations)).
|
||||
|
|
|
@ -158,8 +158,8 @@ Example:
|
|||
|
||||
```yaml
|
||||
--- !FileInfo:
|
||||
filepath: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR/ArithmeticCanonicalization.pdll"
|
||||
includes: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR;/home/user/llvm/mlir/include"
|
||||
filepath: "/home/user/llvm/mlir/lib/Dialect/Arith/IR/ArithCanonicalization.pdll"
|
||||
includes: "/home/user/llvm/mlir/lib/Dialect/Arith/IR;/home/user/llvm/mlir/include"
|
||||
```
|
||||
|
||||
- filepath: <string> - Absolute file path of the file.
|
||||
|
@ -284,8 +284,8 @@ Example:
|
|||
|
||||
```yaml
|
||||
--- !FileInfo:
|
||||
filepath: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR/ArithmeticCanonicalization.td"
|
||||
includes: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR;/home/user/llvm/mlir/include"
|
||||
filepath: "/home/user/llvm/mlir/lib/Dialect/Arith/IR/ArithCanonicalization.td"
|
||||
includes: "/home/user/llvm/mlir/lib/Dialect/Arith/IR;/home/user/llvm/mlir/include"
|
||||
```
|
||||
|
||||
- filepath: <string> - Absolute file path of the file.
|
||||
|
|
|
@ -51,7 +51,7 @@ To use this framework, we need to provide two things (and an optional third):
|
|||
## Conversion Target
|
||||
|
||||
For our purposes, we want to convert the compute-intensive `Toy` operations into
|
||||
a combination of operations from the `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects
|
||||
a combination of operations from the `Affine`, `Arith`, `Func`, and `MemRef` dialects
|
||||
for further optimization. To start off the lowering, we first define our
|
||||
conversion target:
|
||||
|
||||
|
@ -63,8 +63,8 @@ void ToyToAffineLoweringPass::runOnOperation() {
|
|||
|
||||
// We define the specific operations, or dialects, that are legal targets for
|
||||
// this lowering. In our case, we are lowering to a combination of the
|
||||
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects.
|
||||
target.addLegalDialect<AffineDialect, arith::ArithmeticDialect,
|
||||
// `Affine`, `Arith`, `Func`, and `MemRef` dialects.
|
||||
target.addLegalDialect<AffineDialect, arith::ArithDialect,
|
||||
func::FuncDialect, memref::MemRefDialect>();
|
||||
|
||||
// We also define the Toy dialect as Illegal so that the conversion will fail
|
||||
|
|
|
@ -95,7 +95,7 @@ multiple stages by relying on
|
|||
mlir::RewritePatternSet patterns(&getContext());
|
||||
mlir::populateAffineToStdConversionPatterns(patterns, &getContext());
|
||||
mlir::cf::populateSCFToControlFlowConversionPatterns(patterns, &getContext());
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter,
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(typeConverter,
|
||||
patterns);
|
||||
mlir::populateFuncToLLVMConversionPatterns(typeConverter, patterns);
|
||||
mlir::cf::populateControlFlowToLLVMConversionPatterns(patterns, &getContext());
|
||||
|
|
|
@ -3,7 +3,7 @@ get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
|
|||
set(LIBS
|
||||
${dialect_libs}
|
||||
${conversion_libs}
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIROptLib
|
||||
MLIRStandalone
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/IR/Dialect.h"
|
||||
#include "mlir/IR/MLIRContext.h"
|
||||
#include "mlir/InitAllDialects.h"
|
||||
|
@ -28,7 +28,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
mlir::DialectRegistry registry;
|
||||
registry.insert<mlir::standalone::StandaloneDialect,
|
||||
mlir::arith::ArithmeticDialect, mlir::func::FuncDialect>();
|
||||
mlir::arith::ArithDialect, mlir::func::FuncDialect>();
|
||||
// Add the following to include *all* MLIR Core dialects, or selectively
|
||||
// include what you need like above. You only need to register dialects that
|
||||
// will be *parsed* by the tool, not the one generated
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "toy/Passes.h"
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
@ -327,9 +327,8 @@ void ToyToAffineLoweringPass::runOnOperation() {
|
|||
|
||||
// We define the specific operations, or dialects, that are legal targets for
|
||||
// this lowering. In our case, we are lowering to a combination of the
|
||||
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects.
|
||||
target
|
||||
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
|
||||
// `Affine`, `Arith`, `Func`, and `MemRef` dialects.
|
||||
target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
|
||||
func::FuncDialect, memref::MemRefDialect>();
|
||||
|
||||
// We also define the Toy dialect as Illegal so that the conversion will fail
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "toy/Passes.h"
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
@ -327,9 +327,8 @@ void ToyToAffineLoweringPass::runOnOperation() {
|
|||
|
||||
// We define the specific operations, or dialects, that are legal targets for
|
||||
// this lowering. In our case, we are lowering to a combination of the
|
||||
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects.
|
||||
target
|
||||
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
|
||||
// `Affine`, `Arith`, `Func`, and `MemRef` dialects.
|
||||
target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
|
||||
func::FuncDialect, memref::MemRefDialect>();
|
||||
|
||||
// We also define the Toy dialect as Illegal so that the conversion will fail
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "toy/Passes.h"
|
||||
|
||||
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
|
||||
|
@ -35,7 +35,7 @@
|
|||
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
|
||||
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
@ -205,8 +205,7 @@ void ToyToLLVMLoweringPass::runOnOperation() {
|
|||
RewritePatternSet patterns(&getContext());
|
||||
populateAffineToStdConversionPatterns(patterns);
|
||||
populateSCFToControlFlowConversionPatterns(patterns);
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter,
|
||||
patterns);
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
|
||||
populateMemRefToLLVMConversionPatterns(typeConverter, patterns);
|
||||
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
|
||||
populateFuncToLLVMConversionPatterns(typeConverter, patterns);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "toy/Passes.h"
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
@ -327,9 +327,8 @@ void ToyToAffineLoweringPass::runOnOperation() {
|
|||
|
||||
// We define the specific operations, or dialects, that are legal targets for
|
||||
// this lowering. In our case, we are lowering to a combination of the
|
||||
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects.
|
||||
target
|
||||
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
|
||||
// `Affine`, `Arith`, `Func`, and `MemRef` dialects.
|
||||
target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
|
||||
func::FuncDialect, memref::MemRefDialect>();
|
||||
|
||||
// We also define the Toy dialect as Illegal so that the conversion will fail
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "toy/Passes.h"
|
||||
|
||||
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
|
||||
|
@ -35,7 +35,7 @@
|
|||
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
|
||||
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
@ -205,8 +205,7 @@ void ToyToLLVMLoweringPass::runOnOperation() {
|
|||
RewritePatternSet patterns(&getContext());
|
||||
populateAffineToStdConversionPatterns(patterns);
|
||||
populateSCFToControlFlowConversionPatterns(patterns);
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter,
|
||||
patterns);
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
|
||||
populateMemRefToLLVMConversionPatterns(typeConverter, patterns);
|
||||
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
|
||||
populateFuncToLLVMConversionPatterns(typeConverter, patterns);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===- ArithmeticToLLVM.h - Arith to LLVM dialect conversion ----*- C++ -*-===//
|
||||
//===- ArithToLLVM.h - Arith to LLVM dialect conversion ----*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H
|
||||
#define MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H
|
||||
#ifndef MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H
|
||||
#define MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -17,13 +17,13 @@ class LLVMTypeConverter;
|
|||
class RewritePatternSet;
|
||||
class Pass;
|
||||
|
||||
#define GEN_PASS_DECL_ARITHMETICTOLLVMCONVERSIONPASS
|
||||
#define GEN_PASS_DECL_ARITHTOLLVMCONVERSIONPASS
|
||||
#include "mlir/Conversion/Passes.h.inc"
|
||||
|
||||
namespace arith {
|
||||
void populateArithmeticToLLVMConversionPatterns(LLVMTypeConverter &converter,
|
||||
void populateArithToLLVMConversionPatterns(LLVMTypeConverter &converter,
|
||||
RewritePatternSet &patterns);
|
||||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H
|
||||
#endif // MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H
|
|
@ -0,0 +1,32 @@
|
|||
//===- ArithToSPIRV.h - Convert Arith to SPIRV dialect -----*- 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_CONVERSION_ARITHTOSPIRV_ARITHTOSPIRV_H
|
||||
#define MLIR_CONVERSION_ARITHTOSPIRV_ARITHTOSPIRV_H
|
||||
|
||||
#include "mlir/Pass/Pass.h"
|
||||
#include <memory>
|
||||
|
||||
namespace mlir {
|
||||
|
||||
class SPIRVTypeConverter;
|
||||
class RewritePatternSet;
|
||||
class Pass;
|
||||
|
||||
#define GEN_PASS_DECL_CONVERTARITHTOSPIRV
|
||||
#include "mlir/Conversion/Passes.h.inc"
|
||||
|
||||
namespace arith {
|
||||
void populateArithToSPIRVPatterns(SPIRVTypeConverter &typeConverter,
|
||||
RewritePatternSet &patterns);
|
||||
|
||||
std::unique_ptr<OperationPass<>> createConvertArithToSPIRVPass();
|
||||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_CONVERSION_ARITHTOSPIRV_ARITHTOSPIRV_H
|
|
@ -1,32 +0,0 @@
|
|||
//===- ArithmeticToSPIRV.h - Convert Arith to SPIRV dialect -----*- 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_CONVERSION_ARITHMETICTOSPIRV_ARITHMETICTOSPIRV_H
|
||||
#define MLIR_CONVERSION_ARITHMETICTOSPIRV_ARITHMETICTOSPIRV_H
|
||||
|
||||
#include "mlir/Pass/Pass.h"
|
||||
#include <memory>
|
||||
|
||||
namespace mlir {
|
||||
|
||||
class SPIRVTypeConverter;
|
||||
class RewritePatternSet;
|
||||
class Pass;
|
||||
|
||||
#define GEN_PASS_DECL_CONVERTARITHMETICTOSPIRV
|
||||
#include "mlir/Conversion/Passes.h.inc"
|
||||
|
||||
namespace arith {
|
||||
void populateArithmeticToSPIRVPatterns(SPIRVTypeConverter &typeConverter,
|
||||
RewritePatternSet &patterns);
|
||||
|
||||
std::unique_ptr<OperationPass<>> createConvertArithmeticToSPIRVPass();
|
||||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_CONVERSION_ARITHMETICTOSPIRV_ARITHMETICTOSPIRV_H
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
|
||||
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h"
|
||||
#include "mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h"
|
||||
#include "mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h"
|
||||
#include "mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h"
|
||||
|
|
|
@ -93,13 +93,13 @@ def ConvertAMDGPUToROCDL : Pass<"convert-amdgpu-to-rocdl"> {
|
|||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ArithmeticToLLVM
|
||||
// ArithToLLVM
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def ArithmeticToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
|
||||
let summary = "Convert Arithmetic dialect to LLVM dialect";
|
||||
def ArithToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
|
||||
let summary = "Convert Arith dialect to LLVM dialect";
|
||||
let description = [{
|
||||
This pass converts supported Arithmetic ops to LLVM dialect instructions.
|
||||
This pass converts supported Arith ops to LLVM dialect instructions.
|
||||
}];
|
||||
let dependentDialects = ["LLVM::LLVMDialect"];
|
||||
let options = [
|
||||
|
@ -110,12 +110,12 @@ def ArithmeticToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
|
|||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ArithmeticToSPIRV
|
||||
// ArithToSPIRV
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def ConvertArithmeticToSPIRV : Pass<"convert-arith-to-spirv"> {
|
||||
let summary = "Convert Arithmetic dialect to SPIR-V dialect";
|
||||
let constructor = "mlir::arith::createConvertArithmeticToSPIRVPass()";
|
||||
def ConvertArithToSPIRV : Pass<"convert-arith-to-spirv"> {
|
||||
let summary = "Convert Arith dialect to SPIR-V dialect";
|
||||
let constructor = "mlir::arith::createConvertArithToSPIRVPass()";
|
||||
let dependentDialects = ["spirv::SPIRVDialect"];
|
||||
let options = [
|
||||
Option<"emulateNon32BitScalarTypes", "emulate-non-32-bit-scalar-types",
|
||||
|
@ -152,7 +152,7 @@ def ConvertAsyncToLLVM : Pass<"convert-async-to-llvm", "ModuleOp"> {
|
|||
}];
|
||||
let constructor = "mlir::createConvertAsyncToLLVMPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"async::AsyncDialect",
|
||||
"LLVM::LLVMDialect",
|
||||
];
|
||||
|
@ -190,7 +190,7 @@ def ConvertBufferizationToMemRef : Pass<"convert-bufferization-to-memref"> {
|
|||
|
||||
}];
|
||||
let constructor = "mlir::createBufferizationToMemRefPass()";
|
||||
let dependentDialects = ["arith::ArithmeticDialect", "memref::MemRefDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect", "memref::MemRefDialect"];
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -486,7 +486,7 @@ def ConvertMathToLibm : Pass<"convert-math-to-libm", "ModuleOp"> {
|
|||
}];
|
||||
let constructor = "mlir::createConvertMathToLibmPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"func::FuncDialect",
|
||||
"vector::VectorDialect",
|
||||
];
|
||||
|
@ -528,7 +528,7 @@ def ConvertMathToFuncs : Pass<"convert-math-to-funcs", "ModuleOp"> {
|
|||
}];
|
||||
let constructor = "mlir::createConvertMathToFuncsPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"cf::ControlFlowDialect",
|
||||
"func::FuncDialect",
|
||||
"vector::VectorDialect",
|
||||
|
@ -778,7 +778,7 @@ def ConvertTensorToLinalg : Pass<"convert-tensor-to-linalg", "ModuleOp"> {
|
|||
let summary = "Convert some Tensor dialect ops to Linalg dialect";
|
||||
let constructor = "mlir::createConvertTensorToLinalgPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"linalg::LinalgDialect",
|
||||
];
|
||||
}
|
||||
|
@ -806,7 +806,7 @@ def ConvertTensorToSPIRV : Pass<"convert-tensor-to-spirv"> {
|
|||
def TosaToArith : Pass<"tosa-to-arith"> {
|
||||
let summary = "Lower TOSA to the Arith dialect";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
];
|
||||
let description = [{
|
||||
Pass that converts TOSA operations to the equivalent operations using the
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#ifndef MLIR_DIALECT_AFFINE_ANALYSIS_AFFINEANALYSIS_H
|
||||
#define MLIR_DIALECT_AFFINE_ANALYSIS_AFFINEANALYSIS_H
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/IR/Value.h"
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define MLIR_DIALECT_AFFINE_IR_AFFINEOPS_H
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/IR/AffineMap.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "mlir/Interfaces/ControlFlowInterfaces.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef AFFINE_OPS
|
||||
#define AFFINE_OPS
|
||||
|
||||
include "mlir/Dialect/Arithmetic/IR/ArithmeticBase.td"
|
||||
include "mlir/Dialect/Arith/IR/ArithBase.td"
|
||||
include "mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
include "mlir/Interfaces/LoopLikeInterface.td"
|
||||
|
@ -23,7 +23,7 @@ def Affine_Dialect : Dialect {
|
|||
let name = "affine";
|
||||
let cppNamespace = "mlir";
|
||||
let hasConstantMaterializer = 1;
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
}
|
||||
|
||||
// Base class for Affine dialect ops.
|
||||
|
|
|
@ -388,7 +388,7 @@ def LoopCoalescing : Pass<"affine-loop-coalescing", "func::FuncOp"> {
|
|||
let summary = "Coalesce nested loops with independent bounds into a single "
|
||||
"loop";
|
||||
let constructor = "mlir::createLoopCoalescingPass()";
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
}
|
||||
|
||||
def SimplifyAffineStructures : Pass<"affine-simplify-structures", "func::FuncOp"> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
//===- Arithmetic.h - Arithmetic dialect --------------------------*- C++-*-==//
|
||||
//===- Arith.h - Arith dialect ----0000000000----------------------*- 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_
|
||||
#define MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_
|
||||
#ifndef MLIR_DIALECT_ARITH_IR_ARITH_H_
|
||||
#define MLIR_DIALECT_ARITH_IR_ARITH_H_
|
||||
|
||||
#include "mlir/IR/Dialect.h"
|
||||
#include "mlir/IR/OpDefinition.h"
|
||||
|
@ -18,23 +18,23 @@
|
|||
#include "mlir/Interfaces/VectorInterfaces.h"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ArithmeticDialect
|
||||
// ArithDialect
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/ArithmeticOpsDialect.h.inc"
|
||||
#include "mlir/Dialect/Arith/IR/ArithOpsDialect.h.inc"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Arithmetic Dialect Enum Attributes
|
||||
// Arith Dialect Enum Attributes
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/ArithmeticOpsEnums.h.inc"
|
||||
#include "mlir/Dialect/Arith/IR/ArithOpsEnums.h.inc"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Arithmetic Dialect Operations
|
||||
// Arith Dialect Operations
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "mlir/Dialect/Arithmetic/IR/ArithmeticOps.h.inc"
|
||||
#include "mlir/Dialect/Arith/IR/ArithOps.h.inc"
|
||||
|
||||
namespace mlir {
|
||||
namespace arith {
|
||||
|
@ -128,4 +128,4 @@ arith::CmpIPredicate invertPredicate(arith::CmpIPredicate pred);
|
|||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_
|
||||
#endif // MLIR_DIALECT_ARITH_IR_ARITH_H_
|
|
@ -1,4 +1,4 @@
|
|||
//===- ArithmeticBase.td - Base defs for arith dialect ------*- tablegen -*-==//
|
||||
//===- ArithBase.td - Base defs for arith dialect -----------*- tablegen -*-==//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,17 +6,17 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef ARITHMETIC_BASE
|
||||
#define ARITHMETIC_BASE
|
||||
#ifndef ARITH_BASE
|
||||
#define ARITH_BASE
|
||||
|
||||
include "mlir/IR/EnumAttr.td"
|
||||
include "mlir/IR/OpBase.td"
|
||||
|
||||
def Arithmetic_Dialect : Dialect {
|
||||
def Arith_Dialect : Dialect {
|
||||
let name = "arith";
|
||||
let cppNamespace = "::mlir::arith";
|
||||
let description = [{
|
||||
The arithmetic dialect is intended to hold basic integer and floating point
|
||||
The arith dialect is intended to hold basic integer and floating point
|
||||
mathematical operations. This includes unary, binary, and ternary arithmetic
|
||||
ops, bitwise and shift ops, cast ops, and compare ops. Operations in this
|
||||
dialect also accept vectors and tensors of integers or floats.
|
||||
|
@ -92,4 +92,4 @@ def AtomicRMWKindAttr : I64EnumAttr<
|
|||
let cppNamespace = "::mlir::arith";
|
||||
}
|
||||
|
||||
#endif // ARITHMETIC_BASE
|
||||
#endif // ARITH_BASE
|
|
@ -1,4 +1,4 @@
|
|||
//===- ArithmeticOps.td - Arithmetic op definitions --------*- tablegen -*-===//
|
||||
//===- ArithOps.td - Arith op definitions -------------*- tablegen -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,10 +6,10 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef ARITHMETIC_OPS
|
||||
#define ARITHMETIC_OPS
|
||||
#ifndef ARITH_OPS
|
||||
#define ARITH_OPS
|
||||
|
||||
include "mlir/Dialect/Arithmetic/IR/ArithmeticBase.td"
|
||||
include "mlir/Dialect/Arith/IR/ArithBase.td"
|
||||
include "mlir/Interfaces/CastInterfaces.td"
|
||||
include "mlir/Interfaces/InferIntRangeInterface.td"
|
||||
include "mlir/Interfaces/InferTypeOpInterface.td"
|
||||
|
@ -18,34 +18,34 @@ include "mlir/Interfaces/VectorInterfaces.td"
|
|||
include "mlir/IR/BuiltinAttributeInterfaces.td"
|
||||
include "mlir/IR/OpAsmInterface.td"
|
||||
|
||||
// Base class for Arithmetic dialect ops. Ops in this dialect have no side
|
||||
// Base class for Arith dialect ops. Ops in this dialect have no side
|
||||
// effects and can be applied element-wise to vectors and tensors.
|
||||
class Arith_Op<string mnemonic, list<Trait> traits = []> :
|
||||
Op<Arithmetic_Dialect, mnemonic, traits # [NoSideEffect,
|
||||
Op<Arith_Dialect, mnemonic, traits # [NoSideEffect,
|
||||
DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
|
||||
ElementwiseMappable.traits>;
|
||||
|
||||
// Base class for integer and floating point arithmetic ops. All ops have one
|
||||
// result, require operands and results to be of the same type, and can accept
|
||||
// tensors or vectors of integers or floats.
|
||||
class Arith_ArithmeticOp<string mnemonic, list<Trait> traits = []> :
|
||||
class Arith_ArithOp<string mnemonic, list<Trait> traits = []> :
|
||||
Arith_Op<mnemonic, traits # [SameOperandsAndResultType]>;
|
||||
|
||||
// Base class for unary arithmetic operations.
|
||||
class Arith_UnaryOp<string mnemonic, list<Trait> traits = []> :
|
||||
Arith_ArithmeticOp<mnemonic, traits> {
|
||||
Arith_ArithOp<mnemonic, traits> {
|
||||
let assemblyFormat = "$operand attr-dict `:` type($result)";
|
||||
}
|
||||
|
||||
// Base class for binary arithmetic operations.
|
||||
class Arith_BinaryOp<string mnemonic, list<Trait> traits = []> :
|
||||
Arith_ArithmeticOp<mnemonic, traits> {
|
||||
Arith_ArithOp<mnemonic, traits> {
|
||||
let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($result)";
|
||||
}
|
||||
|
||||
// Base class for ternary arithmetic operations.
|
||||
class Arith_TernaryOp<string mnemonic, list<Trait> traits = []> :
|
||||
Arith_ArithmeticOp<mnemonic, traits> {
|
||||
Arith_ArithOp<mnemonic, traits> {
|
||||
let assemblyFormat = "$a `,` $b `,` $c attr-dict `:` type($result)";
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ class Arith_CompareOpOfAnyRank<string mnemonic, list<Trait> traits = []> :
|
|||
// ConstantOp
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def Arith_ConstantOp : Op<Arithmetic_Dialect, "constant",
|
||||
def Arith_ConstantOp : Op<Arith_Dialect, "constant",
|
||||
[ConstantLike, NoSideEffect,
|
||||
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
|
||||
AllTypesMatch<["value", "result"]>,
|
||||
|
@ -150,7 +150,7 @@ def Arith_ConstantOp : Op<Arithmetic_Dialect, "constant",
|
|||
|
||||
let arguments = (ins TypedAttrInterface:$value);
|
||||
// TODO: Disallow arith.constant to return anything other than a signless
|
||||
// integer or float like. Downstream users of Arithmetic should only be
|
||||
// integer or float like. Downstream users of Arith should only be
|
||||
// working with signless integers, floats, or vectors/tensors thereof.
|
||||
// However, it is necessary to allow arith.constant to return vectors/tensors
|
||||
// of strings and signed/unsigned integers (for now) as an artefact of
|
||||
|
@ -1264,4 +1264,4 @@ def SelectOp : Arith_Op<"select", [
|
|||
let hasCustomAssemblyFormat = 1;
|
||||
}
|
||||
|
||||
#endif // ARITHMETIC_OPS
|
||||
#endif // ARITH_OPS
|
|
@ -0,0 +1,5 @@
|
|||
set(LLVM_TARGET_DEFINITIONS ArithOps.td)
|
||||
mlir_tablegen(ArithOpsEnums.h.inc -gen-enum-decls)
|
||||
mlir_tablegen(ArithOpsEnums.cpp.inc -gen-enum-defs)
|
||||
add_mlir_dialect(ArithOps arith)
|
||||
add_mlir_doc(ArithOps ArithOps Dialects/ -gen-dialect-doc)
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H
|
||||
#define MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H
|
||||
#ifndef MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H
|
||||
#define MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H
|
||||
|
||||
namespace mlir {
|
||||
|
||||
|
@ -18,4 +18,4 @@ void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry);
|
|||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H
|
||||
#endif // MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H
|
|
@ -0,0 +1,5 @@
|
|||
set(LLVM_TARGET_DEFINITIONS Passes.td)
|
||||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name Arith)
|
||||
add_public_tablegen_target(MLIRArithTransformsIncGen)
|
||||
|
||||
add_mlir_doc(Passes ArithPasses ./ -gen-pass-doc)
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_
|
||||
#define MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_
|
||||
#ifndef MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
|
||||
#define MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
|
||||
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
|
@ -15,31 +15,31 @@ namespace mlir {
|
|||
namespace arith {
|
||||
|
||||
#define GEN_PASS_DECL
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc"
|
||||
#include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
|
||||
|
||||
class WideIntEmulationConverter;
|
||||
|
||||
/// Create a pass to bufferize Arithmetic ops.
|
||||
std::unique_ptr<Pass> createArithmeticBufferizePass();
|
||||
/// Create a pass to bufferize Arith ops.
|
||||
std::unique_ptr<Pass> createArithBufferizePass();
|
||||
|
||||
/// Create a pass to bufferize arith.constant ops.
|
||||
std::unique_ptr<Pass> createConstantBufferizePass(uint64_t alignment = 0);
|
||||
|
||||
/// Adds patterns to emulate wide Arithmetic and Function ops over integer
|
||||
/// Adds patterns to emulate wide Arith and Function ops over integer
|
||||
/// types into supported ones. This is done by splitting original power-of-two
|
||||
/// i2N integer types into two iN halves.
|
||||
void populateWideIntEmulationPatterns(WideIntEmulationConverter &typeConverter,
|
||||
RewritePatternSet &patterns);
|
||||
|
||||
/// Add patterns to expand Arithmetic ops for LLVM lowering.
|
||||
void populateArithmeticExpandOpsPatterns(RewritePatternSet &patterns);
|
||||
/// Add patterns to expand Arith ops for LLVM lowering.
|
||||
void populateArithExpandOpsPatterns(RewritePatternSet &patterns);
|
||||
|
||||
/// Create a pass to legalize Arithmetic ops for LLVM lowering.
|
||||
std::unique_ptr<Pass> createArithmeticExpandOpsPass();
|
||||
/// Create a pass to legalize Arith ops for LLVM lowering.
|
||||
std::unique_ptr<Pass> createArithExpandOpsPass();
|
||||
|
||||
/// Create a pass to replace signed ops with unsigned ones where they are proven
|
||||
/// equivalent.
|
||||
std::unique_ptr<Pass> createArithmeticUnsignedWhenEquivalentPass();
|
||||
std::unique_ptr<Pass> createArithUnsignedWhenEquivalentPass();
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Registration
|
||||
|
@ -47,9 +47,9 @@ std::unique_ptr<Pass> createArithmeticUnsignedWhenEquivalentPass();
|
|||
|
||||
/// Generate the code for registering passes.
|
||||
#define GEN_PASS_REGISTRATION
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc"
|
||||
#include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
|
||||
|
||||
} // namespace arith
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_
|
||||
#endif // MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
|
|
@ -1,4 +1,4 @@
|
|||
//===-- Passes.td - Arithmetic pass definition file --------*- tablegen -*-===//
|
||||
//===-- Passes.td - Arith pass definition file --------*- tablegen -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,13 +6,13 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES
|
||||
#define MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES
|
||||
#ifndef MLIR_DIALECT_ARITH_TRANSFORMS_PASSES
|
||||
#define MLIR_DIALECT_ARITH_TRANSFORMS_PASSES
|
||||
|
||||
include "mlir/Pass/PassBase.td"
|
||||
|
||||
def ArithmeticBufferize : Pass<"arith-bufferize", "ModuleOp"> {
|
||||
let summary = "Bufferize Arithmetic dialect ops.";
|
||||
def ArithBufferize : Pass<"arith-bufferize", "ModuleOp"> {
|
||||
let summary = "Bufferize Arith dialect ops.";
|
||||
let description = [{
|
||||
This pass bufferizes arith dialect ops.
|
||||
|
||||
|
@ -21,19 +21,19 @@ def ArithmeticBufferize : Pass<"arith-bufferize", "ModuleOp"> {
|
|||
multi-threading. Most other bufferization passes can run in parallel at
|
||||
function granularity.
|
||||
}];
|
||||
let constructor = "mlir::arith::createArithmeticBufferizePass()";
|
||||
let constructor = "mlir::arith::createArithBufferizePass()";
|
||||
let options = [
|
||||
Option<"alignment", "alignment", "unsigned", /*default=*/"0",
|
||||
"Create global memrefs with a specified alignment">,
|
||||
];
|
||||
}
|
||||
|
||||
def ArithmeticExpandOps : Pass<"arith-expand"> {
|
||||
let summary = "Legalize Arithmetic ops to be convertible to LLVM.";
|
||||
let constructor = "mlir::arith::createArithmeticExpandOpsPass()";
|
||||
def ArithExpandOps : Pass<"arith-expand"> {
|
||||
let summary = "Legalize Arith ops to be convertible to LLVM.";
|
||||
let constructor = "mlir::arith::createArithExpandOpsPass()";
|
||||
}
|
||||
|
||||
def ArithmeticUnsignedWhenEquivalent : Pass<"arith-unsigned-when-equivalent"> {
|
||||
def ArithUnsignedWhenEquivalent : Pass<"arith-unsigned-when-equivalent"> {
|
||||
let summary = "Replace signed ops with unsigned ones where they are proven equivalent";
|
||||
let description = [{
|
||||
Replace signed ops with their unsigned equivalents when integer range analysis
|
||||
|
@ -46,10 +46,10 @@ def ArithmeticUnsignedWhenEquivalent : Pass<"arith-unsigned-when-equivalent"> {
|
|||
The affect ops include division, remainder, shifts, min, max, and integer
|
||||
comparisons.
|
||||
}];
|
||||
let constructor = "mlir::arith::createArithmeticUnsignedWhenEquivalentPass()";
|
||||
let constructor = "mlir::arith::createArithUnsignedWhenEquivalentPass()";
|
||||
}
|
||||
|
||||
def ArithmeticEmulateWideInt : Pass<"arith-emulate-wide-int"> {
|
||||
def ArithEmulateWideInt : Pass<"arith-emulate-wide-int"> {
|
||||
let summary = "Emulate 2*N-bit integer operations using N-bit operations";
|
||||
let description = [{
|
||||
Emulate integer operations that use too wide integer types with equivalent
|
||||
|
@ -69,4 +69,4 @@ def ArithmeticEmulateWideInt : Pass<"arith-emulate-wide-int"> {
|
|||
let dependentDialects = ["vector::VectorDialect"];
|
||||
}
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES
|
||||
#endif // MLIR_DIALECT_ARITH_TRANSFORMS_PASSES
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_
|
||||
#define MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_
|
||||
#ifndef MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
|
||||
#define MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
|
||||
|
||||
#include "mlir/Transforms/DialectConversion.h"
|
||||
|
||||
|
@ -31,4 +31,4 @@ private:
|
|||
};
|
||||
} // namespace mlir::arith
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_
|
||||
#endif // MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
|
|
@ -1,4 +1,4 @@
|
|||
//===- Utils.h - General Arithmetic transformation utilities ----*- C++ -*-===//
|
||||
//===- Utils.h - General Arith transformation utilities ----*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -7,16 +7,16 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This header file defines prototypes for various transformation utilities for
|
||||
// the Arithmetic dialect. These are not passes by themselves but are used
|
||||
// the Arith dialect. These are not passes by themselves but are used
|
||||
// either by passes, optimization sequences, or in turn by other transformation
|
||||
// utilities.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef MLIR_DIALECT_ARITHMETIC_UTILS_UTILS_H
|
||||
#define MLIR_DIALECT_ARITHMETIC_UTILS_UTILS_H
|
||||
#ifndef MLIR_DIALECT_ARITH_UTILS_UTILS_H
|
||||
#define MLIR_DIALECT_ARITH_UTILS_UTILS_H
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/IR/Matchers.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
#include "mlir/IR/Value.h"
|
||||
|
@ -111,4 +111,4 @@ private:
|
|||
};
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_UTILS_UTILS_H
|
||||
#endif // MLIR_DIALECT_ARITH_UTILS_UTILS_H
|
|
@ -1,5 +0,0 @@
|
|||
set(LLVM_TARGET_DEFINITIONS ArithmeticOps.td)
|
||||
mlir_tablegen(ArithmeticOpsEnums.h.inc -gen-enum-decls)
|
||||
mlir_tablegen(ArithmeticOpsEnums.cpp.inc -gen-enum-defs)
|
||||
add_mlir_dialect(ArithmeticOps arith)
|
||||
add_mlir_doc(ArithmeticOps ArithmeticOps Dialects/ -gen-dialect-doc)
|
|
@ -1,5 +0,0 @@
|
|||
set(LLVM_TARGET_DEFINITIONS Passes.td)
|
||||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name Arithmetic)
|
||||
add_public_tablegen_target(MLIRArithmeticTransformsIncGen)
|
||||
|
||||
add_mlir_doc(Passes ArithmeticPasses ./ -gen-pass-doc)
|
|
@ -34,7 +34,7 @@ def AsyncParallelFor : Pass<"async-parallel-for", "ModuleOp"> {
|
|||
];
|
||||
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"async::AsyncDialect",
|
||||
"scf::SCFDialect"
|
||||
];
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERUTILS_H
|
||||
|
||||
#include "mlir/Analysis/Liveness.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
add_subdirectory(AMDGPU)
|
||||
add_subdirectory(AMX)
|
||||
add_subdirectory(Affine)
|
||||
add_subdirectory(Arithmetic)
|
||||
add_subdirectory(Arith)
|
||||
add_subdirectory(ArmNeon)
|
||||
add_subdirectory(ArmSVE)
|
||||
add_subdirectory(Async)
|
||||
|
|
|
@ -19,7 +19,7 @@ def Complex_Dialect : Dialect {
|
|||
arithmetic ops.
|
||||
}];
|
||||
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let hasConstantMaterializer = 1;
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
|
|||
def ControlFlow_Dialect : Dialect {
|
||||
let name = "cf";
|
||||
let cppNamespace = "::mlir::cf";
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let description = [{
|
||||
This dialect contains low-level, i.e. non-region based, control flow
|
||||
constructs. These constructs generally represent control flow directly
|
||||
|
|
|
@ -53,7 +53,7 @@ def GPU_Dialect : Dialect {
|
|||
static unsigned getPrivateAddressSpace() { return 5; }
|
||||
}];
|
||||
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ def Linalg_Dialect : Dialect {
|
|||
}];
|
||||
let cppNamespace = "::mlir::linalg";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"AffineDialect",
|
||||
"math::MathDialect",
|
||||
"memref::MemRefDialect",
|
||||
|
|
|
@ -19,7 +19,7 @@ def MemRef_Dialect : Dialect {
|
|||
manipulation ops, which are not strongly associated with any particular
|
||||
other dialect or domain abstraction.
|
||||
}];
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let hasConstantMaterializer = 1;
|
||||
|
||||
let emitAccessorPrefix = kEmitAccessorPrefix_Both;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef MEMREF_OPS
|
||||
#define MEMREF_OPS
|
||||
|
||||
include "mlir/Dialect/Arithmetic/IR/ArithmeticBase.td"
|
||||
include "mlir/Dialect/Arith/IR/ArithBase.td"
|
||||
include "mlir/Dialect/MemRef/IR/MemRefBase.td"
|
||||
include "mlir/Interfaces/CastInterfaces.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
|
|
|
@ -23,7 +23,7 @@ include "mlir/Interfaces/ViewLikeInterface.td"
|
|||
def SCF_Dialect : Dialect {
|
||||
let name = "scf";
|
||||
let cppNamespace = "::mlir::scf";
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
}
|
||||
|
||||
// Base class for SCF dialect ops.
|
||||
|
|
|
@ -36,7 +36,7 @@ def ShapeDialect : Dialect {
|
|||
}];
|
||||
|
||||
let cppNamespace = "::mlir::shape";
|
||||
let dependentDialects = ["arith::ArithmeticDialect", "tensor::TensorDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect", "tensor::TensorDialect"];
|
||||
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let hasConstantMaterializer = 1;
|
||||
|
|
|
@ -30,9 +30,8 @@ namespace mlir {
|
|||
#include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
|
||||
|
||||
/// Creates an instance of the ShapeToShapeLowering pass that legalizes Shape
|
||||
/// dialect to be convertible to Arithmetic. For example, `shape.num_elements`
|
||||
/// get transformed to `shape.reduce`, which can be lowered to SCF and
|
||||
/// Arithmetic.
|
||||
/// dialect to be convertible to Arith. For example, `shape.num_elements` get
|
||||
/// transformed to `shape.reduce`, which can be lowered to SCF and Arith.
|
||||
std::unique_ptr<Pass> createShapeToShapeLowering();
|
||||
|
||||
/// Collects a set of patterns to rewrite ops within the Shape dialect.
|
||||
|
|
|
@ -17,7 +17,7 @@ def RemoveShapeConstraints : Pass<"remove-shape-constraints", "func::FuncOp"> {
|
|||
}
|
||||
|
||||
def ShapeToShapeLowering : Pass<"shape-to-shape-lowering", "func::FuncOp"> {
|
||||
let summary = "Legalize Shape dialect to be convertible to Arithmetic";
|
||||
let summary = "Legalize Shape dialect to be convertible to Arith";
|
||||
let constructor = "mlir::createShapeToShapeLowering()";
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ def SparsificationPass : Pass<"sparsification", "ModuleOp"> {
|
|||
let constructor = "mlir::createSparsificationPass()";
|
||||
let dependentDialects = [
|
||||
"AffineDialect",
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"bufferization::BufferizationDialect",
|
||||
"LLVM::LLVMDialect",
|
||||
"memref::MemRefDialect",
|
||||
|
@ -134,7 +134,7 @@ def SparseTensorConversionPass : Pass<"sparse-tensor-conversion", "ModuleOp"> {
|
|||
}];
|
||||
let constructor = "mlir::createSparseTensorConversionPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"bufferization::BufferizationDialect",
|
||||
"LLVM::LLVMDialect",
|
||||
"linalg::LinalgDialect",
|
||||
|
@ -169,7 +169,7 @@ def SparseTensorCodegen : Pass<"sparse-tensor-codegen", "ModuleOp"> {
|
|||
}];
|
||||
let constructor = "mlir::createSparseTensorCodegenPass()";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"bufferization::BufferizationDialect",
|
||||
"linalg::LinalgDialect",
|
||||
"memref::MemRefDialect",
|
||||
|
|
|
@ -47,7 +47,7 @@ def Tensor_Dialect : Dialect {
|
|||
|
||||
let hasConstantMaterializer = 1;
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"arith::ArithDialect",
|
||||
"complex::ComplexDialect",
|
||||
];
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef DIALECT_TOSA_UTILS_COVERSION_UTILS_H_
|
||||
#define DIALECT_TOSA_UTILS_COVERSION_UTILS_H_
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -26,7 +26,7 @@ def Vector_Dialect : Dialect {
|
|||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let hasConstantMaterializer = 1;
|
||||
let dependentDialects = ["arith::ArithmeticDialect"];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
}
|
||||
|
||||
// Base class for Vector dialect ops.
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include "mlir/Dialect/AMDGPU/AMDGPUDialect.h"
|
||||
#include "mlir/Dialect/AMX/AMXDialect.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/BufferizableOpInterfaceImpl.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.h"
|
||||
#include "mlir/Dialect/ArmNeon/ArmNeonDialect.h"
|
||||
#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h"
|
||||
#include "mlir/Dialect/Async/IR/Async.h"
|
||||
|
@ -74,7 +74,7 @@ inline void registerAllDialects(DialectRegistry ®istry) {
|
|||
// clang-format off
|
||||
registry.insert<acc::OpenACCDialect,
|
||||
AffineDialect,
|
||||
arith::ArithmeticDialect,
|
||||
arith::ArithDialect,
|
||||
amdgpu::AMDGPUDialect,
|
||||
amx::AMXDialect,
|
||||
arm_neon::ArmNeonDialect,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "mlir/Conversion/Passes.h"
|
||||
#include "mlir/Dialect/Affine/Passes.h"
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Arith/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Async/Passes.h"
|
||||
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Func/Transforms/Passes.h"
|
||||
|
@ -57,7 +57,7 @@ inline void registerAllPasses() {
|
|||
// Dialect passes
|
||||
registerAffinePasses();
|
||||
registerAsyncPasses();
|
||||
arith::registerArithmeticPasses();
|
||||
arith::registerArithPasses();
|
||||
bufferization::registerBufferizationPasses();
|
||||
func::registerFuncPasses();
|
||||
registerGPUPasses();
|
||||
|
|
|
@ -49,4 +49,4 @@ def InferIntRangeInterface : OpInterface<"InferIntRangeInterface"> {
|
|||
"::mlir::SetIntRangeFn":$setResultRanges)
|
||||
>];
|
||||
}
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_IR_INFERINTRANGEINTERFACE
|
||||
#endif // MLIR_INTERFACES_INFERINTRANGEINTERFACE
|
||||
|
|
|
@ -554,7 +554,7 @@ class LowerAffinePass
|
|||
populateAffineToStdConversionPatterns(patterns);
|
||||
populateAffineToVectorConversionPatterns(patterns);
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, memref::MemRefDialect,
|
||||
target.addLegalDialect<arith::ArithDialect, memref::MemRefDialect,
|
||||
scf::SCFDialect, VectorDialect>();
|
||||
if (failed(applyPartialConversion(getOperation(), target,
|
||||
std::move(patterns))))
|
||||
|
|
|
@ -13,7 +13,7 @@ add_mlir_conversion_library(MLIRAffineToStandard
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRAffineDialect
|
||||
MLIRAffineUtils
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRIR
|
||||
MLIRMemRefDialect
|
||||
MLIRSCFDialect
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===- ArithmeticToLLVM.cpp - Arithmetic to LLVM dialect conversion -------===//
|
||||
//===- ArithToLLVM.cpp - Arithmetic to LLVM dialect conversion -------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,17 +6,17 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/VectorPattern.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/IR/TypeUtilities.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
namespace mlir {
|
||||
#define GEN_PASS_DEF_ARITHMETICTOLLVMCONVERSIONPASS
|
||||
#define GEN_PASS_DEF_ARITHTOLLVMCONVERSIONPASS
|
||||
#include "mlir/Conversion/Passes.h.inc"
|
||||
} // namespace mlir
|
||||
|
||||
|
@ -320,9 +320,8 @@ CmpFOpLowering::matchAndRewrite(arith::CmpFOp op, OpAdaptor adaptor,
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
namespace {
|
||||
struct ArithmeticToLLVMConversionPass
|
||||
: public impl::ArithmeticToLLVMConversionPassBase<
|
||||
ArithmeticToLLVMConversionPass> {
|
||||
struct ArithToLLVMConversionPass
|
||||
: public impl::ArithToLLVMConversionPassBase<ArithToLLVMConversionPass> {
|
||||
using Base::Base;
|
||||
|
||||
void runOnOperation() override {
|
||||
|
@ -334,8 +333,7 @@ struct ArithmeticToLLVMConversionPass
|
|||
options.overrideIndexBitwidth(indexBitwidth);
|
||||
|
||||
LLVMTypeConverter converter(&getContext(), options);
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter,
|
||||
patterns);
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(converter, patterns);
|
||||
|
||||
if (failed(applyPartialConversion(getOperation(), target,
|
||||
std::move(patterns))))
|
||||
|
@ -348,7 +346,7 @@ struct ArithmeticToLLVMConversionPass
|
|||
// Pattern Population
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void mlir::arith::populateArithmeticToLLVMConversionPatterns(
|
||||
void mlir::arith::populateArithToLLVMConversionPatterns(
|
||||
LLVMTypeConverter &converter, RewritePatternSet &patterns) {
|
||||
// clang-format off
|
||||
patterns.add<
|
|
@ -1,8 +1,8 @@
|
|||
add_mlir_conversion_library(MLIRArithmeticToLLVM
|
||||
ArithmeticToLLVM.cpp
|
||||
add_mlir_conversion_library(MLIRArithToLLVM
|
||||
ArithToLLVM.cpp
|
||||
|
||||
ADDITIONAL_HEADER_DIRS
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithmeticToLLVM
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithToLLVM
|
||||
|
||||
DEPENDS
|
||||
MLIRConversionPassIncGen
|
||||
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArithmeticToLLVM
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRLLVMCommonConversion
|
||||
MLIRLLVMDialect
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
//===- ArithmeticToSPIRV.cpp - Arithmetic to SPIRV dialect conversion -----===//
|
||||
//===- ArithToSPIRV.cpp - Arithmetic to SPIRV dialect conversion -----===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -6,11 +6,11 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.h"
|
||||
#include "mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h"
|
||||
|
||||
#include "../SPIRVCommon/Pattern.h"
|
||||
#include "mlir/Conversion/FuncToSPIRV/FuncToSPIRV.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
|
||||
|
@ -21,7 +21,7 @@
|
|||
#include "llvm/Support/Debug.h"
|
||||
|
||||
namespace mlir {
|
||||
#define GEN_PASS_DEF_CONVERTARITHMETICTOSPIRV
|
||||
#define GEN_PASS_DEF_CONVERTARITHTOSPIRV
|
||||
#include "mlir/Conversion/Passes.h.inc"
|
||||
} // namespace mlir
|
||||
|
||||
|
@ -956,7 +956,7 @@ LogicalResult MinMaxFOpPattern<Op, SPIRVOp>::matchAndRewrite(
|
|||
// Pattern Population
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void mlir::arith::populateArithmeticToSPIRVPatterns(
|
||||
void mlir::arith::populateArithToSPIRVPatterns(
|
||||
SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) {
|
||||
// clang-format off
|
||||
patterns.add<
|
||||
|
@ -1022,8 +1022,8 @@ void mlir::arith::populateArithmeticToSPIRVPatterns(
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
namespace {
|
||||
struct ConvertArithmeticToSPIRVPass
|
||||
: public impl::ConvertArithmeticToSPIRVBase<ConvertArithmeticToSPIRVPass> {
|
||||
struct ConvertArithToSPIRVPass
|
||||
: public impl::ConvertArithToSPIRVBase<ConvertArithToSPIRVPass> {
|
||||
void runOnOperation() override {
|
||||
Operation *op = getOperation();
|
||||
auto targetAttr = spirv::lookupTargetEnvOrDefault(op);
|
||||
|
@ -1046,7 +1046,7 @@ struct ConvertArithmeticToSPIRVPass
|
|||
target->addLegalOp<UnrealizedConversionCastOp>();
|
||||
|
||||
RewritePatternSet patterns(&getContext());
|
||||
arith::populateArithmeticToSPIRVPatterns(typeConverter, patterns);
|
||||
arith::populateArithToSPIRVPatterns(typeConverter, patterns);
|
||||
|
||||
if (failed(applyPartialConversion(op, *target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
|
@ -1054,7 +1054,6 @@ struct ConvertArithmeticToSPIRVPass
|
|||
};
|
||||
} // namespace
|
||||
|
||||
std::unique_ptr<OperationPass<>>
|
||||
mlir::arith::createConvertArithmeticToSPIRVPass() {
|
||||
return std::make_unique<ConvertArithmeticToSPIRVPass>();
|
||||
std::unique_ptr<OperationPass<>> mlir::arith::createConvertArithToSPIRVPass() {
|
||||
return std::make_unique<ConvertArithToSPIRVPass>();
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
add_mlir_conversion_library(MLIRArithmeticToSPIRV
|
||||
ArithmeticToSPIRV.cpp
|
||||
add_mlir_conversion_library(MLIRArithToSPIRV
|
||||
ArithToSPIRV.cpp
|
||||
|
||||
ADDITIONAL_HEADER_DIRS
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithmeticToSPIRV
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithToSPIRV
|
||||
|
||||
DEPENDS
|
||||
MLIRConversionPassIncGen
|
||||
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArithmeticToSPIRV
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRFuncToSPIRV
|
||||
MLIRSPIRVConversion
|
||||
MLIRSPIRVDialect
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArmNeon2dToIntr
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRArmNeonDialect
|
||||
MLIRPass
|
||||
MLIRTransforms
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Async/IR/Async.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRAsyncToLLVM
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRAsyncDialect
|
||||
MLIRFuncToLLVM
|
||||
MLIRFuncTransforms
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/IR/BuiltinTypes.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
add_subdirectory(AffineToStandard)
|
||||
add_subdirectory(AMDGPUToROCDL)
|
||||
add_subdirectory(ArithmeticToLLVM)
|
||||
add_subdirectory(ArithmeticToSPIRV)
|
||||
add_subdirectory(ArithToLLVM)
|
||||
add_subdirectory(ArithToSPIRV)
|
||||
add_subdirectory(ArmNeon2dToIntr)
|
||||
add_subdirectory(AsyncToLLVM)
|
||||
add_subdirectory(BufferizationToMemRef)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
|
|
@ -8,7 +8,7 @@ add_mlir_conversion_library(MLIRComplexToStandard
|
|||
MLIRConversionPassIncGen
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRComplexDialect
|
||||
MLIRIR
|
||||
MLIRMathDialect
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "mlir/Conversion/ComplexToStandard/ComplexToStandard.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/IR/ImplicitLocOpBuilder.h"
|
||||
|
@ -1095,7 +1095,7 @@ void ConvertComplexToStandardPass::runOnOperation() {
|
|||
populateComplexToStandardConversionPatterns(patterns);
|
||||
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, math::MathDialect>();
|
||||
target.addLegalDialect<arith::ArithDialect, math::MathDialect>();
|
||||
target.addLegalOp<complex::CreateOp, complex::ImOp, complex::ReOp>();
|
||||
if (failed(
|
||||
applyPartialConversion(getOperation(), target, std::move(patterns))))
|
||||
|
|
|
@ -13,7 +13,7 @@ add_mlir_conversion_library(MLIRFuncToLLVM
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRAnalysis
|
||||
MLIRArithmeticToLLVM
|
||||
MLIRArithToLLVM
|
||||
MLIRControlFlowToLLVM
|
||||
MLIRDataLayoutInterfaces
|
||||
MLIRFuncDialect
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
|
||||
|
||||
#include "mlir/Analysis/DataLayoutAnalysis.h"
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
|
@ -741,7 +741,7 @@ struct ConvertFuncToLLVMPass
|
|||
populateFuncToLLVMConversionPatterns(typeConverter, patterns);
|
||||
|
||||
// TODO: Remove these in favor of their dedicated conversion passes.
|
||||
arith::populateArithmeticToLLVMConversionPatterns(typeConverter, patterns);
|
||||
arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
|
||||
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
|
||||
|
||||
LLVMConversionTarget target(getContext());
|
||||
|
|
|
@ -29,7 +29,7 @@ add_mlir_conversion_library(MLIRGPUToGPURuntimeTransforms
|
|||
${NVPTX_LIBS}
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticToLLVM
|
||||
MLIRArithToLLVM
|
||||
MLIRAsyncToLLVM
|
||||
MLIRControlFlowToLLVM
|
||||
MLIRFuncToLLVM
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h"
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
|
@ -388,7 +388,7 @@ void GpuToLLVMConversionPass::runOnOperation() {
|
|||
|
||||
target.addIllegalDialect<gpu::GPUDialect>();
|
||||
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter, patterns);
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(converter, patterns);
|
||||
mlir::cf::populateControlFlowToLLVMConversionPatterns(converter, patterns);
|
||||
populateVectorToLLVMConversionPatterns(converter, patterns);
|
||||
populateMemRefToLLVMConversionPatterns(converter, patterns);
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRGPUToNVVMTransforms
|
|||
MLIRGPUToNVVMIncGen
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticToLLVM
|
||||
MLIRArithToLLVM
|
||||
MLIRFuncToLLVM
|
||||
MLIRGPUOps
|
||||
MLIRGPUToGPURuntimeTransforms
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
|
||||
#include "mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h"
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
|
||||
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
|
||||
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
|
||||
|
@ -203,7 +203,7 @@ struct LowerGpuOpsToNVVMOpsPass
|
|||
populateGpuRewritePatterns(patterns);
|
||||
(void)applyPatternsAndFoldGreedily(m, std::move(patterns));
|
||||
|
||||
arith::populateArithmeticToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
arith::populateArithToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
cf::populateControlFlowToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
populateFuncToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
populateMemRefToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
|
|
|
@ -10,7 +10,7 @@ add_mlir_conversion_library(MLIRGPUToROCDLTransforms
|
|||
MLIRGPUToROCDLIncGen
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticToLLVM
|
||||
MLIRArithToLLVM
|
||||
MLIRAMDGPUToROCDL
|
||||
MLIRFuncToLLVM
|
||||
MLIRGPUOps
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"
|
||||
|
||||
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
|
||||
|
@ -127,8 +127,7 @@ struct LowerGpuOpsToROCDLOpsPass
|
|||
populateGpuRewritePatterns(patterns);
|
||||
(void)applyPatternsAndFoldGreedily(m, std::move(patterns));
|
||||
|
||||
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter,
|
||||
llvmPatterns);
|
||||
mlir::arith::populateArithToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
populateAMDGPUToROCDLConversionPatterns(converter, llvmPatterns,
|
||||
*maybeChipset);
|
||||
populateVectorToLLVMConversionPatterns(converter, llvmPatterns);
|
||||
|
|
|
@ -6,7 +6,7 @@ add_mlir_conversion_library(MLIRGPUToSPIRV
|
|||
MLIRConversionPassIncGen
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticToSPIRV
|
||||
MLIRArithToSPIRV
|
||||
MLIRGPUOps
|
||||
MLIRFuncToSPIRV
|
||||
MLIRIR
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.h"
|
||||
#include "mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h"
|
||||
#include "mlir/Conversion/FuncToSPIRV/FuncToSPIRV.h"
|
||||
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
|
||||
#include "mlir/Conversion/MemRefToSPIRV/MemRefToSPIRV.h"
|
||||
|
@ -88,7 +88,7 @@ void GPUToSPIRVPass::runOnOperation() {
|
|||
|
||||
// TODO: Change SPIR-V conversion to be progressive and remove the following
|
||||
// patterns.
|
||||
mlir::arith::populateArithmeticToSPIRVPatterns(typeConverter, patterns);
|
||||
mlir::arith::populateArithToSPIRVPatterns(typeConverter, patterns);
|
||||
populateMemRefToSPIRVPatterns(typeConverter, patterns);
|
||||
populateFuncToSPIRVPatterns(typeConverter, patterns);
|
||||
|
||||
|
|
|
@ -141,9 +141,8 @@ struct ConvertLinalgToStandardPass
|
|||
void ConvertLinalgToStandardPass::runOnOperation() {
|
||||
auto module = getOperation();
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<AffineDialect, arith::ArithmeticDialect,
|
||||
func::FuncDialect, memref::MemRefDialect,
|
||||
scf::SCFDialect>();
|
||||
target.addLegalDialect<AffineDialect, arith::ArithDialect, func::FuncDialect,
|
||||
memref::MemRefDialect, scf::SCFDialect>();
|
||||
target.addLegalOp<ModuleOp, func::FuncOp, func::ReturnOp>();
|
||||
RewritePatternSet patterns(&getContext());
|
||||
populateLinalgToStandardConversionPatterns(patterns);
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRMathToFuncs
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRControlFlowDialect
|
||||
MLIRFuncDialect
|
||||
MLIRLLVMDialect
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "mlir/Conversion/MathToFuncs/MathToFuncs.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
|
@ -377,7 +377,7 @@ void ConvertMathToFuncsPass::runOnOperation() {
|
|||
patterns.add<IPowIOpLowering>(patterns.getContext(), getPowerFuncOpByType);
|
||||
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, cf::ControlFlowDialect,
|
||||
target.addLegalDialect<arith::ArithDialect, cf::ControlFlowDialect,
|
||||
func::FuncDialect, vector::VectorDialect>();
|
||||
target.addIllegalOp<math::IPowIOp>();
|
||||
if (failed(applyPartialConversion(module, target, std::move(patterns))))
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRMathToLibm
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRDialectUtils
|
||||
MLIRFuncDialect
|
||||
MLIRMathDialect
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "mlir/Conversion/MathToLibm/MathToLibm.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
|
@ -212,8 +212,8 @@ void ConvertMathToLibmPass::runOnOperation() {
|
|||
populateMathToLibmConversionPatterns(patterns, /*benefit=*/1);
|
||||
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, BuiltinDialect,
|
||||
func::FuncDialect, vector::VectorDialect>();
|
||||
target.addLegalDialect<arith::ArithDialect, BuiltinDialect, func::FuncDialect,
|
||||
vector::VectorDialect>();
|
||||
target.addIllegalDialect<math::MathDialect>();
|
||||
if (failed(applyPartialConversion(module, target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
|
||||
#include "mlir/Conversion/MemRefToLLVM/AllocLikeConversion.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
|
|
|
@ -8,7 +8,7 @@ add_mlir_conversion_library(MLIROpenACCToSCF
|
|||
MLIRConversionPassIncGen
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRIR
|
||||
MLIROpenACCDialect
|
||||
MLIRSCFDialect
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/OpenACC/OpenACC.h"
|
||||
#include "mlir/Dialect/SCF/IR/SCF.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
|
|
@ -12,7 +12,7 @@ add_mlir_conversion_library(MLIROpenMPToLLVM
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticToLLVM
|
||||
MLIRArithToLLVM
|
||||
MLIRFuncToLLVM
|
||||
MLIRIR
|
||||
MLIRLLVMCommonConversion
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h"
|
||||
|
||||
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
|
||||
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
|
||||
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
|
||||
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
|
||||
|
@ -148,7 +148,7 @@ void ConvertOpenMPToLLVMPass::runOnOperation() {
|
|||
// Convert to OpenMP operations with LLVM IR dialect
|
||||
RewritePatternSet patterns(&getContext());
|
||||
LLVMTypeConverter converter(&getContext());
|
||||
arith::populateArithmeticToLLVMConversionPatterns(converter, patterns);
|
||||
arith::populateArithToLLVMConversionPatterns(converter, patterns);
|
||||
cf::populateControlFlowToLLVMConversionPatterns(converter, patterns);
|
||||
populateMemRefToLLVMConversionPatterns(converter, patterns);
|
||||
populateFuncToLLVMConversionPatterns(converter, patterns);
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRSCFToControlFlow
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRControlFlowDialect
|
||||
MLIRSCFDialect
|
||||
MLIRTransforms
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
#include "mlir/Dialect/SCF/IR/SCF.h"
|
||||
#include "mlir/IR/BlockAndValueMapping.h"
|
||||
|
|
|
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRSCFToGPU
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRAffineDialect
|
||||
MLIRAffineToStandard
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRComplexDialect
|
||||
MLIRGPUTransforms
|
||||
MLIRIR
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
|
||||
#include "mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "mlir/Conversion/SCFToGPU/SCFToGPU.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
|
||||
#include "mlir/Dialect/SCF/IR/SCF.h"
|
||||
|
|
|
@ -12,7 +12,7 @@ add_mlir_conversion_library(MLIRSCFToOpenMP
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRAnalysis
|
||||
MLIRArithmeticDialect
|
||||
MLIRArithDialect
|
||||
MLIRLLVMDialect
|
||||
MLIROpenMPDialect
|
||||
MLIRSCFDialect
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "mlir/Analysis/SliceAnalysis.h"
|
||||
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue