[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:
Jakub Kuderski 2022-09-29 11:14:47 -04:00
parent ffb2a1534d
commit abc362a107
328 changed files with 828 additions and 841 deletions

View File

@ -14,8 +14,8 @@ from the [MLIR LangRef](LangRef.md).
Attributes are the mechanism for specifying constant data on operations in 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 places where a variable is never allowed - e.g. the comparison predicate of a
[`arith.cmpi` operation](Dialects/ArithmeticOps.md#arithcmpi-mlirarithcmpiop), or [`arith.cmpi` operation](Dialects/ArithOps.md#arithcmpi-mlirarithcmpiop), or
the underlying value of a [`arith.constant` operation](Dialects/ArithmeticOps.md#arithconstant-mlirarithconstantop). 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 Each operation has an attribute dictionary, which associates a set of attribute
names to attribute values. 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 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, 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 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 ```mlir
%result = arith.addi %lhs, %rhs : i64 %result = arith.addi %lhs, %rhs : i64

View File

@ -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), ecosystem. They allow for defining new [attributes](LangRef.md#attributes),
[operations](LangRef.md#operations), and [types](LangRef.md#type-system). [operations](LangRef.md#operations), and [types](LangRef.md#type-system).
Dialects are used to model a variety of different abstractions; from traditional 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 [pattern rewrites](Dialects/PDLOps.md); and is one of the most fundamental
aspects of MLIR. aspects of MLIR.
@ -122,7 +122,7 @@ dialect. Dialect dependencies can be recorded using the `dependentDialects` dial
def MyDialect : Dialect { def MyDialect : Dialect {
// Here we register the Arithmetic and Func dialect as dependencies of our `MyDialect`. // Here we register the Arithmetic and Func dialect as dependencies of our `MyDialect`.
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"func::FuncDialect" "func::FuncDialect"
]; ];
} }

View File

@ -1079,7 +1079,7 @@ returns an SSA value generated from an `spirv.mlir.addressof` operation.
Using the above infrastructure, conversions are implemented from 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`. * [GPU Dialect][MlirGpuDialect] : A gpu.module is converted to a `spirv.module`.
A gpu.function within this module is lowered as an entry function. A gpu.function within this module is lowered as an entry function.

View File

@ -95,7 +95,7 @@ Vectors) are welcome future extensions.
### Virtual Vector Ops ### 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 ```mlir
// Produces a vector<3x7x8xf32> // Produces a vector<3x7x8xf32>

View File

@ -744,7 +744,7 @@ attribute-value ::= attribute-alias | dialect-attribute | builtin-attribute
Attributes are the mechanism for specifying constant data on operations in 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 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 attribute dictionary, which associates a set of attribute names to attribute
values. MLIR's builtin dialect provides a rich set of values. MLIR's builtin dialect provides a rich set of
[builtin attribute values](#builtin-attribute-values) out of the box (such as [builtin attribute values](#builtin-attribute-values) out of the box (such as

View File

@ -26,7 +26,7 @@ This document describes the available MLIR passes and their contracts.
## `arith` Dialect Passes ## `arith` Dialect Passes
[include "ArithmeticPasses.md"] [include "ArithPasses.md"]
## `func` Dialect Passes ## `func` Dialect Passes

View File

@ -282,7 +282,7 @@ an external system, and should aim to reflect its design as closely as possible.
### Splitting floating point vs integer operations ### 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 into different categories, for example `arith.addf` vs `arith.addi` and
`arith.cmpf` vs `arith.cmpi` `arith.cmpf` vs `arith.cmpi`
([following the design of LLVM](http://llvm.org/docs/LangRef.html#binary-operations)). ([following the design of LLVM](http://llvm.org/docs/LangRef.html#binary-operations)).

View File

@ -158,8 +158,8 @@ Example:
```yaml ```yaml
--- !FileInfo: --- !FileInfo:
filepath: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR/ArithmeticCanonicalization.pdll" filepath: "/home/user/llvm/mlir/lib/Dialect/Arith/IR/ArithCanonicalization.pdll"
includes: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR;/home/user/llvm/mlir/include" includes: "/home/user/llvm/mlir/lib/Dialect/Arith/IR;/home/user/llvm/mlir/include"
``` ```
- filepath: <string> - Absolute file path of the file. - filepath: <string> - Absolute file path of the file.
@ -284,8 +284,8 @@ Example:
```yaml ```yaml
--- !FileInfo: --- !FileInfo:
filepath: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR/ArithmeticCanonicalization.td" filepath: "/home/user/llvm/mlir/lib/Dialect/Arith/IR/ArithCanonicalization.td"
includes: "/home/user/llvm/mlir/lib/Dialect/Arithmetic/IR;/home/user/llvm/mlir/include" includes: "/home/user/llvm/mlir/lib/Dialect/Arith/IR;/home/user/llvm/mlir/include"
``` ```
- filepath: <string> - Absolute file path of the file. - filepath: <string> - Absolute file path of the file.

View File

@ -51,7 +51,7 @@ To use this framework, we need to provide two things (and an optional third):
## Conversion Target ## Conversion Target
For our purposes, we want to convert the compute-intensive `Toy` operations into 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 for further optimization. To start off the lowering, we first define our
conversion target: conversion target:
@ -63,8 +63,8 @@ void ToyToAffineLoweringPass::runOnOperation() {
// We define the specific operations, or dialects, that are legal targets for // 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 // this lowering. In our case, we are lowering to a combination of the
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects. // `Affine`, `Arith`, `Func`, and `MemRef` dialects.
target.addLegalDialect<AffineDialect, arith::ArithmeticDialect, target.addLegalDialect<AffineDialect, arith::ArithDialect,
func::FuncDialect, memref::MemRefDialect>(); func::FuncDialect, memref::MemRefDialect>();
// We also define the Toy dialect as Illegal so that the conversion will fail // We also define the Toy dialect as Illegal so that the conversion will fail

View File

@ -95,7 +95,7 @@ multiple stages by relying on
mlir::RewritePatternSet patterns(&getContext()); mlir::RewritePatternSet patterns(&getContext());
mlir::populateAffineToStdConversionPatterns(patterns, &getContext()); mlir::populateAffineToStdConversionPatterns(patterns, &getContext());
mlir::cf::populateSCFToControlFlowConversionPatterns(patterns, &getContext()); mlir::cf::populateSCFToControlFlowConversionPatterns(patterns, &getContext());
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter, mlir::arith::populateArithToLLVMConversionPatterns(typeConverter,
patterns); patterns);
mlir::populateFuncToLLVMConversionPatterns(typeConverter, patterns); mlir::populateFuncToLLVMConversionPatterns(typeConverter, patterns);
mlir::cf::populateControlFlowToLLVMConversionPatterns(patterns, &getContext()); mlir::cf::populateControlFlowToLLVMConversionPatterns(patterns, &getContext());

View File

@ -3,7 +3,7 @@ get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(LIBS set(LIBS
${dialect_libs} ${dialect_libs}
${conversion_libs} ${conversion_libs}
MLIRArithmeticDialect MLIRArithDialect
MLIROptLib MLIROptLib
MLIRStandalone MLIRStandalone
) )

View File

@ -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/Dialect.h"
#include "mlir/IR/MLIRContext.h" #include "mlir/IR/MLIRContext.h"
#include "mlir/InitAllDialects.h" #include "mlir/InitAllDialects.h"
@ -28,7 +28,7 @@ int main(int argc, char **argv) {
mlir::DialectRegistry registry; mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect, 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 // Add the following to include *all* MLIR Core dialects, or selectively
// include what you need like above. You only need to register dialects that // include what you need like above. You only need to register dialects that
// will be *parsed* by the tool, not the one generated // will be *parsed* by the tool, not the one generated

View File

@ -17,7 +17,7 @@
#include "toy/Passes.h" #include "toy/Passes.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Pass/Pass.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 // 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 // this lowering. In our case, we are lowering to a combination of the
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects. // `Affine`, `Arith`, `Func`, and `MemRef` dialects.
target target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
func::FuncDialect, memref::MemRefDialect>(); func::FuncDialect, memref::MemRefDialect>();
// We also define the Toy dialect as Illegal so that the conversion will fail // We also define the Toy dialect as Illegal so that the conversion will fail

View File

@ -17,7 +17,7 @@
#include "toy/Passes.h" #include "toy/Passes.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Pass/Pass.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 // 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 // this lowering. In our case, we are lowering to a combination of the
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects. // `Affine`, `Arith`, `Func`, and `MemRef` dialects.
target target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
func::FuncDialect, memref::MemRefDialect>(); func::FuncDialect, memref::MemRefDialect>();
// We also define the Toy dialect as Illegal so that the conversion will fail // We also define the Toy dialect as Illegal so that the conversion will fail

View File

@ -26,7 +26,7 @@
#include "toy/Passes.h" #include "toy/Passes.h"
#include "mlir/Conversion/AffineToStandard/AffineToStandard.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/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
@ -35,7 +35,7 @@
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h" #include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h" #include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
@ -205,8 +205,7 @@ void ToyToLLVMLoweringPass::runOnOperation() {
RewritePatternSet patterns(&getContext()); RewritePatternSet patterns(&getContext());
populateAffineToStdConversionPatterns(patterns); populateAffineToStdConversionPatterns(patterns);
populateSCFToControlFlowConversionPatterns(patterns); populateSCFToControlFlowConversionPatterns(patterns);
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter, mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
patterns);
populateMemRefToLLVMConversionPatterns(typeConverter, patterns); populateMemRefToLLVMConversionPatterns(typeConverter, patterns);
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns); cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
populateFuncToLLVMConversionPatterns(typeConverter, patterns); populateFuncToLLVMConversionPatterns(typeConverter, patterns);

View File

@ -17,7 +17,7 @@
#include "toy/Passes.h" #include "toy/Passes.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Pass/Pass.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 // 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 // this lowering. In our case, we are lowering to a combination of the
// `Affine`, `Arithmetic`, `Func`, and `MemRef` dialects. // `Affine`, `Arith`, `Func`, and `MemRef` dialects.
target target.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithDialect,
.addLegalDialect<AffineDialect, BuiltinDialect, arith::ArithmeticDialect,
func::FuncDialect, memref::MemRefDialect>(); func::FuncDialect, memref::MemRefDialect>();
// We also define the Toy dialect as Illegal so that the conversion will fail // We also define the Toy dialect as Illegal so that the conversion will fail

View File

@ -26,7 +26,7 @@
#include "toy/Passes.h" #include "toy/Passes.h"
#include "mlir/Conversion/AffineToStandard/AffineToStandard.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/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
@ -35,7 +35,7 @@
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h" #include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h" #include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
@ -205,8 +205,7 @@ void ToyToLLVMLoweringPass::runOnOperation() {
RewritePatternSet patterns(&getContext()); RewritePatternSet patterns(&getContext());
populateAffineToStdConversionPatterns(patterns); populateAffineToStdConversionPatterns(patterns);
populateSCFToControlFlowConversionPatterns(patterns); populateSCFToControlFlowConversionPatterns(patterns);
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter, mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
patterns);
populateMemRefToLLVMConversionPatterns(typeConverter, patterns); populateMemRefToLLVMConversionPatterns(typeConverter, patterns);
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns); cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
populateFuncToLLVMConversionPatterns(typeConverter, patterns); populateFuncToLLVMConversionPatterns(typeConverter, patterns);

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
@ -6,8 +6,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H #ifndef MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H
#define MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H #define MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H
#include <memory> #include <memory>
@ -17,13 +17,13 @@ class LLVMTypeConverter;
class RewritePatternSet; class RewritePatternSet;
class Pass; class Pass;
#define GEN_PASS_DECL_ARITHMETICTOLLVMCONVERSIONPASS #define GEN_PASS_DECL_ARITHTOLLVMCONVERSIONPASS
#include "mlir/Conversion/Passes.h.inc" #include "mlir/Conversion/Passes.h.inc"
namespace arith { namespace arith {
void populateArithmeticToLLVMConversionPatterns(LLVMTypeConverter &converter, void populateArithToLLVMConversionPatterns(LLVMTypeConverter &converter,
RewritePatternSet &patterns); RewritePatternSet &patterns);
} // namespace arith } // namespace arith
} // namespace mlir } // namespace mlir
#endif // MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H #endif // MLIR_CONVERSION_ARITHTOLLVM_ARITHTOLLVM_H

View File

@ -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

View File

@ -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

View File

@ -11,8 +11,8 @@
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h" #include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h" #include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h" #include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
#include "mlir/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.h" #include "mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h"
#include "mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h" #include "mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h"
#include "mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h" #include "mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h"
#include "mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h" #include "mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h"

View File

@ -93,13 +93,13 @@ def ConvertAMDGPUToROCDL : Pass<"convert-amdgpu-to-rocdl"> {
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// ArithmeticToLLVM // ArithToLLVM
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
def ArithmeticToLLVMConversionPass : Pass<"convert-arith-to-llvm"> { def ArithToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
let summary = "Convert Arithmetic dialect to LLVM dialect"; let summary = "Convert Arith dialect to LLVM dialect";
let description = [{ 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 dependentDialects = ["LLVM::LLVMDialect"];
let options = [ let options = [
@ -110,12 +110,12 @@ def ArithmeticToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// ArithmeticToSPIRV // ArithToSPIRV
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
def ConvertArithmeticToSPIRV : Pass<"convert-arith-to-spirv"> { def ConvertArithToSPIRV : Pass<"convert-arith-to-spirv"> {
let summary = "Convert Arithmetic dialect to SPIR-V dialect"; let summary = "Convert Arith dialect to SPIR-V dialect";
let constructor = "mlir::arith::createConvertArithmeticToSPIRVPass()"; let constructor = "mlir::arith::createConvertArithToSPIRVPass()";
let dependentDialects = ["spirv::SPIRVDialect"]; let dependentDialects = ["spirv::SPIRVDialect"];
let options = [ let options = [
Option<"emulateNon32BitScalarTypes", "emulate-non-32-bit-scalar-types", 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 constructor = "mlir::createConvertAsyncToLLVMPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"async::AsyncDialect", "async::AsyncDialect",
"LLVM::LLVMDialect", "LLVM::LLVMDialect",
]; ];
@ -190,7 +190,7 @@ def ConvertBufferizationToMemRef : Pass<"convert-bufferization-to-memref"> {
}]; }];
let constructor = "mlir::createBufferizationToMemRefPass()"; 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 constructor = "mlir::createConvertMathToLibmPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"func::FuncDialect", "func::FuncDialect",
"vector::VectorDialect", "vector::VectorDialect",
]; ];
@ -528,7 +528,7 @@ def ConvertMathToFuncs : Pass<"convert-math-to-funcs", "ModuleOp"> {
}]; }];
let constructor = "mlir::createConvertMathToFuncsPass()"; let constructor = "mlir::createConvertMathToFuncsPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"cf::ControlFlowDialect", "cf::ControlFlowDialect",
"func::FuncDialect", "func::FuncDialect",
"vector::VectorDialect", "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 summary = "Convert some Tensor dialect ops to Linalg dialect";
let constructor = "mlir::createConvertTensorToLinalgPass()"; let constructor = "mlir::createConvertTensorToLinalgPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"linalg::LinalgDialect", "linalg::LinalgDialect",
]; ];
} }
@ -806,7 +806,7 @@ def ConvertTensorToSPIRV : Pass<"convert-tensor-to-spirv"> {
def TosaToArith : Pass<"tosa-to-arith"> { def TosaToArith : Pass<"tosa-to-arith"> {
let summary = "Lower TOSA to the Arith dialect"; let summary = "Lower TOSA to the Arith dialect";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
]; ];
let description = [{ let description = [{
Pass that converts TOSA operations to the equivalent operations using the Pass that converts TOSA operations to the equivalent operations using the

View File

@ -15,7 +15,7 @@
#ifndef MLIR_DIALECT_AFFINE_ANALYSIS_AFFINEANALYSIS_H #ifndef MLIR_DIALECT_AFFINE_ANALYSIS_AFFINEANALYSIS_H
#define 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 "mlir/IR/Value.h"
#include "llvm/ADT/Optional.h" #include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"

View File

@ -15,7 +15,7 @@
#define MLIR_DIALECT_AFFINE_IR_AFFINEOPS_H #define MLIR_DIALECT_AFFINE_IR_AFFINEOPS_H
#include "mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.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/AffineMap.h"
#include "mlir/IR/Builders.h" #include "mlir/IR/Builders.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h" #include "mlir/Interfaces/ControlFlowInterfaces.h"

View File

@ -13,7 +13,7 @@
#ifndef AFFINE_OPS #ifndef AFFINE_OPS
#define 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/Dialect/Affine/IR/AffineMemoryOpInterfaces.td"
include "mlir/Interfaces/ControlFlowInterfaces.td" include "mlir/Interfaces/ControlFlowInterfaces.td"
include "mlir/Interfaces/LoopLikeInterface.td" include "mlir/Interfaces/LoopLikeInterface.td"
@ -23,7 +23,7 @@ def Affine_Dialect : Dialect {
let name = "affine"; let name = "affine";
let cppNamespace = "mlir"; let cppNamespace = "mlir";
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
} }
// Base class for Affine dialect ops. // Base class for Affine dialect ops.

View File

@ -388,7 +388,7 @@ def LoopCoalescing : Pass<"affine-loop-coalescing", "func::FuncOp"> {
let summary = "Coalesce nested loops with independent bounds into a single " let summary = "Coalesce nested loops with independent bounds into a single "
"loop"; "loop";
let constructor = "mlir::createLoopCoalescingPass()"; let constructor = "mlir::createLoopCoalescingPass()";
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
} }
def SimplifyAffineStructures : Pass<"affine-simplify-structures", "func::FuncOp"> { def SimplifyAffineStructures : Pass<"affine-simplify-structures", "func::FuncOp"> {

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_ #ifndef MLIR_DIALECT_ARITH_IR_ARITH_H_
#define MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_ #define MLIR_DIALECT_ARITH_IR_ARITH_H_
#include "mlir/IR/Dialect.h" #include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h" #include "mlir/IR/OpDefinition.h"
@ -18,23 +18,23 @@
#include "mlir/Interfaces/VectorInterfaces.h" #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 #define GET_OP_CLASSES
#include "mlir/Dialect/Arithmetic/IR/ArithmeticOps.h.inc" #include "mlir/Dialect/Arith/IR/ArithOps.h.inc"
namespace mlir { namespace mlir {
namespace arith { namespace arith {
@ -128,4 +128,4 @@ arith::CmpIPredicate invertPredicate(arith::CmpIPredicate pred);
} // namespace arith } // namespace arith
} // namespace mlir } // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_ #endif // MLIR_DIALECT_ARITH_IR_ARITH_H_

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
@ -6,17 +6,17 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef ARITHMETIC_BASE #ifndef ARITH_BASE
#define ARITHMETIC_BASE #define ARITH_BASE
include "mlir/IR/EnumAttr.td" include "mlir/IR/EnumAttr.td"
include "mlir/IR/OpBase.td" include "mlir/IR/OpBase.td"
def Arithmetic_Dialect : Dialect { def Arith_Dialect : Dialect {
let name = "arith"; let name = "arith";
let cppNamespace = "::mlir::arith"; let cppNamespace = "::mlir::arith";
let description = [{ 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 mathematical operations. This includes unary, binary, and ternary arithmetic
ops, bitwise and shift ops, cast ops, and compare ops. Operations in this ops, bitwise and shift ops, cast ops, and compare ops. Operations in this
dialect also accept vectors and tensors of integers or floats. dialect also accept vectors and tensors of integers or floats.
@ -92,4 +92,4 @@ def AtomicRMWKindAttr : I64EnumAttr<
let cppNamespace = "::mlir::arith"; let cppNamespace = "::mlir::arith";
} }
#endif // ARITHMETIC_BASE #endif // ARITH_BASE

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
@ -6,10 +6,10 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef ARITHMETIC_OPS #ifndef ARITH_OPS
#define ARITHMETIC_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/CastInterfaces.td"
include "mlir/Interfaces/InferIntRangeInterface.td" include "mlir/Interfaces/InferIntRangeInterface.td"
include "mlir/Interfaces/InferTypeOpInterface.td" include "mlir/Interfaces/InferTypeOpInterface.td"
@ -18,34 +18,34 @@ include "mlir/Interfaces/VectorInterfaces.td"
include "mlir/IR/BuiltinAttributeInterfaces.td" include "mlir/IR/BuiltinAttributeInterfaces.td"
include "mlir/IR/OpAsmInterface.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. // effects and can be applied element-wise to vectors and tensors.
class Arith_Op<string mnemonic, list<Trait> traits = []> : class Arith_Op<string mnemonic, list<Trait> traits = []> :
Op<Arithmetic_Dialect, mnemonic, traits # [NoSideEffect, Op<Arith_Dialect, mnemonic, traits # [NoSideEffect,
DeclareOpInterfaceMethods<VectorUnrollOpInterface>] # DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
ElementwiseMappable.traits>; ElementwiseMappable.traits>;
// Base class for integer and floating point arithmetic ops. All ops have one // 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 // result, require operands and results to be of the same type, and can accept
// tensors or vectors of integers or floats. // 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]>; Arith_Op<mnemonic, traits # [SameOperandsAndResultType]>;
// Base class for unary arithmetic operations. // Base class for unary arithmetic operations.
class Arith_UnaryOp<string mnemonic, list<Trait> traits = []> : class Arith_UnaryOp<string mnemonic, list<Trait> traits = []> :
Arith_ArithmeticOp<mnemonic, traits> { Arith_ArithOp<mnemonic, traits> {
let assemblyFormat = "$operand attr-dict `:` type($result)"; let assemblyFormat = "$operand attr-dict `:` type($result)";
} }
// Base class for binary arithmetic operations. // Base class for binary arithmetic operations.
class Arith_BinaryOp<string mnemonic, list<Trait> traits = []> : class Arith_BinaryOp<string mnemonic, list<Trait> traits = []> :
Arith_ArithmeticOp<mnemonic, traits> { Arith_ArithOp<mnemonic, traits> {
let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($result)"; let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($result)";
} }
// Base class for ternary arithmetic operations. // Base class for ternary arithmetic operations.
class Arith_TernaryOp<string mnemonic, list<Trait> traits = []> : 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)"; let assemblyFormat = "$a `,` $b `,` $c attr-dict `:` type($result)";
} }
@ -126,7 +126,7 @@ class Arith_CompareOpOfAnyRank<string mnemonic, list<Trait> traits = []> :
// ConstantOp // ConstantOp
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
def Arith_ConstantOp : Op<Arithmetic_Dialect, "constant", def Arith_ConstantOp : Op<Arith_Dialect, "constant",
[ConstantLike, NoSideEffect, [ConstantLike, NoSideEffect,
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>, DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
AllTypesMatch<["value", "result"]>, AllTypesMatch<["value", "result"]>,
@ -150,7 +150,7 @@ def Arith_ConstantOp : Op<Arithmetic_Dialect, "constant",
let arguments = (ins TypedAttrInterface:$value); let arguments = (ins TypedAttrInterface:$value);
// TODO: Disallow arith.constant to return anything other than a signless // 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. // working with signless integers, floats, or vectors/tensors thereof.
// However, it is necessary to allow arith.constant to return vectors/tensors // However, it is necessary to allow arith.constant to return vectors/tensors
// of strings and signed/unsigned integers (for now) as an artefact of // of strings and signed/unsigned integers (for now) as an artefact of
@ -1264,4 +1264,4 @@ def SelectOp : Arith_Op<"select", [
let hasCustomAssemblyFormat = 1; let hasCustomAssemblyFormat = 1;
} }
#endif // ARITHMETIC_OPS #endif // ARITH_OPS

View File

@ -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)

View File

@ -6,8 +6,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H #ifndef MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H
#define MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H #define MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H
namespace mlir { namespace mlir {
@ -18,4 +18,4 @@ void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry);
} // namespace arith } // namespace arith
} // namespace mlir } // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_BUFFERIZABLEOPINTERFACEIMPL_H #endif // MLIR_DIALECT_ARITH_BUFFERIZABLEOPINTERFACEIMPL_H

View File

@ -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)

View File

@ -6,8 +6,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_ #ifndef MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
#define MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_ #define MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
#include "mlir/Pass/Pass.h" #include "mlir/Pass/Pass.h"
@ -15,31 +15,31 @@ namespace mlir {
namespace arith { namespace arith {
#define GEN_PASS_DECL #define GEN_PASS_DECL
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc" #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
class WideIntEmulationConverter; class WideIntEmulationConverter;
/// Create a pass to bufferize Arithmetic ops. /// Create a pass to bufferize Arith ops.
std::unique_ptr<Pass> createArithmeticBufferizePass(); std::unique_ptr<Pass> createArithBufferizePass();
/// Create a pass to bufferize arith.constant ops. /// Create a pass to bufferize arith.constant ops.
std::unique_ptr<Pass> createConstantBufferizePass(uint64_t alignment = 0); 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 /// types into supported ones. This is done by splitting original power-of-two
/// i2N integer types into two iN halves. /// i2N integer types into two iN halves.
void populateWideIntEmulationPatterns(WideIntEmulationConverter &typeConverter, void populateWideIntEmulationPatterns(WideIntEmulationConverter &typeConverter,
RewritePatternSet &patterns); RewritePatternSet &patterns);
/// Add patterns to expand Arithmetic ops for LLVM lowering. /// Add patterns to expand Arith ops for LLVM lowering.
void populateArithmeticExpandOpsPatterns(RewritePatternSet &patterns); void populateArithExpandOpsPatterns(RewritePatternSet &patterns);
/// Create a pass to legalize Arithmetic ops for LLVM lowering. /// Create a pass to legalize Arith ops for LLVM lowering.
std::unique_ptr<Pass> createArithmeticExpandOpsPass(); std::unique_ptr<Pass> createArithExpandOpsPass();
/// Create a pass to replace signed ops with unsigned ones where they are proven /// Create a pass to replace signed ops with unsigned ones where they are proven
/// equivalent. /// equivalent.
std::unique_ptr<Pass> createArithmeticUnsignedWhenEquivalentPass(); std::unique_ptr<Pass> createArithUnsignedWhenEquivalentPass();
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Registration // Registration
@ -47,9 +47,9 @@ std::unique_ptr<Pass> createArithmeticUnsignedWhenEquivalentPass();
/// Generate the code for registering passes. /// Generate the code for registering passes.
#define GEN_PASS_REGISTRATION #define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc" #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
} // namespace arith } // namespace arith
} // namespace mlir } // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_ #endif // MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
@ -6,13 +6,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES #ifndef MLIR_DIALECT_ARITH_TRANSFORMS_PASSES
#define MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES #define MLIR_DIALECT_ARITH_TRANSFORMS_PASSES
include "mlir/Pass/PassBase.td" include "mlir/Pass/PassBase.td"
def ArithmeticBufferize : Pass<"arith-bufferize", "ModuleOp"> { def ArithBufferize : Pass<"arith-bufferize", "ModuleOp"> {
let summary = "Bufferize Arithmetic dialect ops."; let summary = "Bufferize Arith dialect ops.";
let description = [{ let description = [{
This pass bufferizes arith dialect ops. 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 multi-threading. Most other bufferization passes can run in parallel at
function granularity. function granularity.
}]; }];
let constructor = "mlir::arith::createArithmeticBufferizePass()"; let constructor = "mlir::arith::createArithBufferizePass()";
let options = [ let options = [
Option<"alignment", "alignment", "unsigned", /*default=*/"0", Option<"alignment", "alignment", "unsigned", /*default=*/"0",
"Create global memrefs with a specified alignment">, "Create global memrefs with a specified alignment">,
]; ];
} }
def ArithmeticExpandOps : Pass<"arith-expand"> { def ArithExpandOps : Pass<"arith-expand"> {
let summary = "Legalize Arithmetic ops to be convertible to LLVM."; let summary = "Legalize Arith ops to be convertible to LLVM.";
let constructor = "mlir::arith::createArithmeticExpandOpsPass()"; 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 summary = "Replace signed ops with unsigned ones where they are proven equivalent";
let description = [{ let description = [{
Replace signed ops with their unsigned equivalents when integer range analysis 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 The affect ops include division, remainder, shifts, min, max, and integer
comparisons. 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 summary = "Emulate 2*N-bit integer operations using N-bit operations";
let description = [{ let description = [{
Emulate integer operations that use too wide integer types with equivalent 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"]; let dependentDialects = ["vector::VectorDialect"];
} }
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES #endif // MLIR_DIALECT_ARITH_TRANSFORMS_PASSES

View File

@ -6,8 +6,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_ #ifndef MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
#define MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_ #define MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
#include "mlir/Transforms/DialectConversion.h" #include "mlir/Transforms/DialectConversion.h"
@ -31,4 +31,4 @@ private:
}; };
} // namespace mlir::arith } // namespace mlir::arith
#endif // MLIR_DIALECT_ARITHMETIC_WIDE_INT_EMULATION_CONVERTER_H_ #endif // MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // See https://llvm.org/LICENSE.txt for license information.
@ -7,16 +7,16 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This header file defines prototypes for various transformation utilities for // 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 // either by passes, optimization sequences, or in turn by other transformation
// utilities. // utilities.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MLIR_DIALECT_ARITHMETIC_UTILS_UTILS_H #ifndef MLIR_DIALECT_ARITH_UTILS_UTILS_H
#define MLIR_DIALECT_ARITHMETIC_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/Matchers.h"
#include "mlir/IR/PatternMatch.h" #include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h" #include "mlir/IR/Value.h"
@ -111,4 +111,4 @@ private:
}; };
} // namespace mlir } // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_UTILS_UTILS_H #endif // MLIR_DIALECT_ARITH_UTILS_UTILS_H

View File

@ -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)

View File

@ -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)

View File

@ -34,7 +34,7 @@ def AsyncParallelFor : Pass<"async-parallel-for", "ModuleOp"> {
]; ];
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"async::AsyncDialect", "async::AsyncDialect",
"scf::SCFDialect" "scf::SCFDialect"
]; ];

View File

@ -15,7 +15,7 @@
#define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERUTILS_H #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERUTILS_H
#include "mlir/Analysis/Liveness.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/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.h"
#include "mlir/IR/Builders.h" #include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h" #include "mlir/IR/BuiltinOps.h"

View File

@ -1,7 +1,7 @@
add_subdirectory(AMDGPU) add_subdirectory(AMDGPU)
add_subdirectory(AMX) add_subdirectory(AMX)
add_subdirectory(Affine) add_subdirectory(Affine)
add_subdirectory(Arithmetic) add_subdirectory(Arith)
add_subdirectory(ArmNeon) add_subdirectory(ArmNeon)
add_subdirectory(ArmSVE) add_subdirectory(ArmSVE)
add_subdirectory(Async) add_subdirectory(Async)

View File

@ -19,7 +19,7 @@ def Complex_Dialect : Dialect {
arithmetic ops. arithmetic ops.
}]; }];
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;
let useDefaultAttributePrinterParser = 1; let useDefaultAttributePrinterParser = 1;
} }

View File

@ -22,7 +22,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
def ControlFlow_Dialect : Dialect { def ControlFlow_Dialect : Dialect {
let name = "cf"; let name = "cf";
let cppNamespace = "::mlir::cf"; let cppNamespace = "::mlir::cf";
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
let description = [{ let description = [{
This dialect contains low-level, i.e. non-region based, control flow This dialect contains low-level, i.e. non-region based, control flow
constructs. These constructs generally represent control flow directly constructs. These constructs generally represent control flow directly

View File

@ -53,7 +53,7 @@ def GPU_Dialect : Dialect {
static unsigned getPrivateAddressSpace() { return 5; } static unsigned getPrivateAddressSpace() { return 5; }
}]; }];
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
let useDefaultAttributePrinterParser = 1; let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1; let useDefaultTypePrinterParser = 1;

View File

@ -35,7 +35,7 @@ def Linalg_Dialect : Dialect {
}]; }];
let cppNamespace = "::mlir::linalg"; let cppNamespace = "::mlir::linalg";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"AffineDialect", "AffineDialect",
"math::MathDialect", "math::MathDialect",
"memref::MemRefDialect", "memref::MemRefDialect",

View File

@ -19,7 +19,7 @@ def MemRef_Dialect : Dialect {
manipulation ops, which are not strongly associated with any particular manipulation ops, which are not strongly associated with any particular
other dialect or domain abstraction. other dialect or domain abstraction.
}]; }];
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;
let emitAccessorPrefix = kEmitAccessorPrefix_Both; let emitAccessorPrefix = kEmitAccessorPrefix_Both;

View File

@ -9,7 +9,7 @@
#ifndef MEMREF_OPS #ifndef MEMREF_OPS
#define 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/Dialect/MemRef/IR/MemRefBase.td"
include "mlir/Interfaces/CastInterfaces.td" include "mlir/Interfaces/CastInterfaces.td"
include "mlir/Interfaces/ControlFlowInterfaces.td" include "mlir/Interfaces/ControlFlowInterfaces.td"

View File

@ -23,7 +23,7 @@ include "mlir/Interfaces/ViewLikeInterface.td"
def SCF_Dialect : Dialect { def SCF_Dialect : Dialect {
let name = "scf"; let name = "scf";
let cppNamespace = "::mlir::scf"; let cppNamespace = "::mlir::scf";
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
} }
// Base class for SCF dialect ops. // Base class for SCF dialect ops.

View File

@ -36,7 +36,7 @@ def ShapeDialect : Dialect {
}]; }];
let cppNamespace = "::mlir::shape"; let cppNamespace = "::mlir::shape";
let dependentDialects = ["arith::ArithmeticDialect", "tensor::TensorDialect"]; let dependentDialects = ["arith::ArithDialect", "tensor::TensorDialect"];
let useDefaultTypePrinterParser = 1; let useDefaultTypePrinterParser = 1;
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;

View File

@ -30,9 +30,8 @@ namespace mlir {
#include "mlir/Dialect/Shape/Transforms/Passes.h.inc" #include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
/// Creates an instance of the ShapeToShapeLowering pass that legalizes Shape /// Creates an instance of the ShapeToShapeLowering pass that legalizes Shape
/// dialect to be convertible to Arithmetic. For example, `shape.num_elements` /// dialect to be convertible to Arith. For example, `shape.num_elements` get
/// get transformed to `shape.reduce`, which can be lowered to SCF and /// transformed to `shape.reduce`, which can be lowered to SCF and Arith.
/// Arithmetic.
std::unique_ptr<Pass> createShapeToShapeLowering(); std::unique_ptr<Pass> createShapeToShapeLowering();
/// Collects a set of patterns to rewrite ops within the Shape dialect. /// Collects a set of patterns to rewrite ops within the Shape dialect.

View File

@ -17,7 +17,7 @@ def RemoveShapeConstraints : Pass<"remove-shape-constraints", "func::FuncOp"> {
} }
def ShapeToShapeLowering : Pass<"shape-to-shape-lowering", "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()"; let constructor = "mlir::createShapeToShapeLowering()";
} }

View File

@ -54,7 +54,7 @@ def SparsificationPass : Pass<"sparsification", "ModuleOp"> {
let constructor = "mlir::createSparsificationPass()"; let constructor = "mlir::createSparsificationPass()";
let dependentDialects = [ let dependentDialects = [
"AffineDialect", "AffineDialect",
"arith::ArithmeticDialect", "arith::ArithDialect",
"bufferization::BufferizationDialect", "bufferization::BufferizationDialect",
"LLVM::LLVMDialect", "LLVM::LLVMDialect",
"memref::MemRefDialect", "memref::MemRefDialect",
@ -134,7 +134,7 @@ def SparseTensorConversionPass : Pass<"sparse-tensor-conversion", "ModuleOp"> {
}]; }];
let constructor = "mlir::createSparseTensorConversionPass()"; let constructor = "mlir::createSparseTensorConversionPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"bufferization::BufferizationDialect", "bufferization::BufferizationDialect",
"LLVM::LLVMDialect", "LLVM::LLVMDialect",
"linalg::LinalgDialect", "linalg::LinalgDialect",
@ -169,7 +169,7 @@ def SparseTensorCodegen : Pass<"sparse-tensor-codegen", "ModuleOp"> {
}]; }];
let constructor = "mlir::createSparseTensorCodegenPass()"; let constructor = "mlir::createSparseTensorCodegenPass()";
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"bufferization::BufferizationDialect", "bufferization::BufferizationDialect",
"linalg::LinalgDialect", "linalg::LinalgDialect",
"memref::MemRefDialect", "memref::MemRefDialect",

View File

@ -47,7 +47,7 @@ def Tensor_Dialect : Dialect {
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;
let dependentDialects = [ let dependentDialects = [
"arith::ArithmeticDialect", "arith::ArithDialect",
"complex::ComplexDialect", "complex::ComplexDialect",
]; ];
} }

View File

@ -13,7 +13,7 @@
#ifndef DIALECT_TOSA_UTILS_COVERSION_UTILS_H_ #ifndef DIALECT_TOSA_UTILS_COVERSION_UTILS_H_
#define 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/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/PatternMatch.h" #include "mlir/IR/PatternMatch.h"

View File

@ -26,7 +26,7 @@ def Vector_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1; let useDefaultAttributePrinterParser = 1;
let hasConstantMaterializer = 1; let hasConstantMaterializer = 1;
let dependentDialects = ["arith::ArithmeticDialect"]; let dependentDialects = ["arith::ArithDialect"];
} }
// Base class for Vector dialect ops. // Base class for Vector dialect ops.

View File

@ -17,8 +17,8 @@
#include "mlir/Dialect/AMDGPU/AMDGPUDialect.h" #include "mlir/Dialect/AMDGPU/AMDGPUDialect.h"
#include "mlir/Dialect/AMX/AMXDialect.h" #include "mlir/Dialect/AMX/AMXDialect.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Arithmetic/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.h"
#include "mlir/Dialect/ArmNeon/ArmNeonDialect.h" #include "mlir/Dialect/ArmNeon/ArmNeonDialect.h"
#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h" #include "mlir/Dialect/ArmSVE/ArmSVEDialect.h"
#include "mlir/Dialect/Async/IR/Async.h" #include "mlir/Dialect/Async/IR/Async.h"
@ -74,7 +74,7 @@ inline void registerAllDialects(DialectRegistry &registry) {
// clang-format off // clang-format off
registry.insert<acc::OpenACCDialect, registry.insert<acc::OpenACCDialect,
AffineDialect, AffineDialect,
arith::ArithmeticDialect, arith::ArithDialect,
amdgpu::AMDGPUDialect, amdgpu::AMDGPUDialect,
amx::AMXDialect, amx::AMXDialect,
arm_neon::ArmNeonDialect, arm_neon::ArmNeonDialect,

View File

@ -16,7 +16,7 @@
#include "mlir/Conversion/Passes.h" #include "mlir/Conversion/Passes.h"
#include "mlir/Dialect/Affine/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/Async/Passes.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h" #include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/Func/Transforms/Passes.h" #include "mlir/Dialect/Func/Transforms/Passes.h"
@ -57,7 +57,7 @@ inline void registerAllPasses() {
// Dialect passes // Dialect passes
registerAffinePasses(); registerAffinePasses();
registerAsyncPasses(); registerAsyncPasses();
arith::registerArithmeticPasses(); arith::registerArithPasses();
bufferization::registerBufferizationPasses(); bufferization::registerBufferizationPasses();
func::registerFuncPasses(); func::registerFuncPasses();
registerGPUPasses(); registerGPUPasses();

View File

@ -49,4 +49,4 @@ def InferIntRangeInterface : OpInterface<"InferIntRangeInterface"> {
"::mlir::SetIntRangeFn":$setResultRanges) "::mlir::SetIntRangeFn":$setResultRanges)
>]; >];
} }
#endif // MLIR_DIALECT_ARITHMETIC_IR_INFERINTRANGEINTERFACE #endif // MLIR_INTERFACES_INFERINTRANGEINTERFACE

View File

@ -554,7 +554,7 @@ class LowerAffinePass
populateAffineToStdConversionPatterns(patterns); populateAffineToStdConversionPatterns(patterns);
populateAffineToVectorConversionPatterns(patterns); populateAffineToVectorConversionPatterns(patterns);
ConversionTarget target(getContext()); ConversionTarget target(getContext());
target.addLegalDialect<arith::ArithmeticDialect, memref::MemRefDialect, target.addLegalDialect<arith::ArithDialect, memref::MemRefDialect,
scf::SCFDialect, VectorDialect>(); scf::SCFDialect, VectorDialect>();
if (failed(applyPartialConversion(getOperation(), target, if (failed(applyPartialConversion(getOperation(), target,
std::move(patterns)))) std::move(patterns))))

View File

@ -13,7 +13,7 @@ add_mlir_conversion_library(MLIRAffineToStandard
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRAffineDialect MLIRAffineDialect
MLIRAffineUtils MLIRAffineUtils
MLIRArithmeticDialect MLIRArithDialect
MLIRIR MLIRIR
MLIRMemRefDialect MLIRMemRefDialect
MLIRSCFDialect MLIRSCFDialect

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // 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/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/VectorPattern.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/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/TypeUtilities.h" #include "mlir/IR/TypeUtilities.h"
#include "mlir/Pass/Pass.h" #include "mlir/Pass/Pass.h"
namespace mlir { namespace mlir {
#define GEN_PASS_DEF_ARITHMETICTOLLVMCONVERSIONPASS #define GEN_PASS_DEF_ARITHTOLLVMCONVERSIONPASS
#include "mlir/Conversion/Passes.h.inc" #include "mlir/Conversion/Passes.h.inc"
} // namespace mlir } // namespace mlir
@ -320,9 +320,8 @@ CmpFOpLowering::matchAndRewrite(arith::CmpFOp op, OpAdaptor adaptor,
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
namespace { namespace {
struct ArithmeticToLLVMConversionPass struct ArithToLLVMConversionPass
: public impl::ArithmeticToLLVMConversionPassBase< : public impl::ArithToLLVMConversionPassBase<ArithToLLVMConversionPass> {
ArithmeticToLLVMConversionPass> {
using Base::Base; using Base::Base;
void runOnOperation() override { void runOnOperation() override {
@ -334,8 +333,7 @@ struct ArithmeticToLLVMConversionPass
options.overrideIndexBitwidth(indexBitwidth); options.overrideIndexBitwidth(indexBitwidth);
LLVMTypeConverter converter(&getContext(), options); LLVMTypeConverter converter(&getContext(), options);
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter, mlir::arith::populateArithToLLVMConversionPatterns(converter, patterns);
patterns);
if (failed(applyPartialConversion(getOperation(), target, if (failed(applyPartialConversion(getOperation(), target,
std::move(patterns)))) std::move(patterns))))
@ -348,7 +346,7 @@ struct ArithmeticToLLVMConversionPass
// Pattern Population // Pattern Population
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
void mlir::arith::populateArithmeticToLLVMConversionPatterns( void mlir::arith::populateArithToLLVMConversionPatterns(
LLVMTypeConverter &converter, RewritePatternSet &patterns) { LLVMTypeConverter &converter, RewritePatternSet &patterns) {
// clang-format off // clang-format off
patterns.add< patterns.add<

View File

@ -1,8 +1,8 @@
add_mlir_conversion_library(MLIRArithmeticToLLVM add_mlir_conversion_library(MLIRArithToLLVM
ArithmeticToLLVM.cpp ArithToLLVM.cpp
ADDITIONAL_HEADER_DIRS ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithmeticToLLVM ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithToLLVM
DEPENDS DEPENDS
MLIRConversionPassIncGen MLIRConversionPassIncGen
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArithmeticToLLVM
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRLLVMCommonConversion MLIRLLVMCommonConversion
MLIRLLVMDialect MLIRLLVMDialect
) )

View File

@ -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. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information. // 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 "../SPIRVCommon/Pattern.h"
#include "mlir/Conversion/FuncToSPIRV/FuncToSPIRV.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/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h" #include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
@ -21,7 +21,7 @@
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
namespace mlir { namespace mlir {
#define GEN_PASS_DEF_CONVERTARITHMETICTOSPIRV #define GEN_PASS_DEF_CONVERTARITHTOSPIRV
#include "mlir/Conversion/Passes.h.inc" #include "mlir/Conversion/Passes.h.inc"
} // namespace mlir } // namespace mlir
@ -956,7 +956,7 @@ LogicalResult MinMaxFOpPattern<Op, SPIRVOp>::matchAndRewrite(
// Pattern Population // Pattern Population
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
void mlir::arith::populateArithmeticToSPIRVPatterns( void mlir::arith::populateArithToSPIRVPatterns(
SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) { SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) {
// clang-format off // clang-format off
patterns.add< patterns.add<
@ -1022,8 +1022,8 @@ void mlir::arith::populateArithmeticToSPIRVPatterns(
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
namespace { namespace {
struct ConvertArithmeticToSPIRVPass struct ConvertArithToSPIRVPass
: public impl::ConvertArithmeticToSPIRVBase<ConvertArithmeticToSPIRVPass> { : public impl::ConvertArithToSPIRVBase<ConvertArithToSPIRVPass> {
void runOnOperation() override { void runOnOperation() override {
Operation *op = getOperation(); Operation *op = getOperation();
auto targetAttr = spirv::lookupTargetEnvOrDefault(op); auto targetAttr = spirv::lookupTargetEnvOrDefault(op);
@ -1046,7 +1046,7 @@ struct ConvertArithmeticToSPIRVPass
target->addLegalOp<UnrealizedConversionCastOp>(); target->addLegalOp<UnrealizedConversionCastOp>();
RewritePatternSet patterns(&getContext()); RewritePatternSet patterns(&getContext());
arith::populateArithmeticToSPIRVPatterns(typeConverter, patterns); arith::populateArithToSPIRVPatterns(typeConverter, patterns);
if (failed(applyPartialConversion(op, *target, std::move(patterns)))) if (failed(applyPartialConversion(op, *target, std::move(patterns))))
signalPassFailure(); signalPassFailure();
@ -1054,7 +1054,6 @@ struct ConvertArithmeticToSPIRVPass
}; };
} // namespace } // namespace
std::unique_ptr<OperationPass<>> std::unique_ptr<OperationPass<>> mlir::arith::createConvertArithToSPIRVPass() {
mlir::arith::createConvertArithmeticToSPIRVPass() { return std::make_unique<ConvertArithToSPIRVPass>();
return std::make_unique<ConvertArithmeticToSPIRVPass>();
} }

View File

@ -1,8 +1,8 @@
add_mlir_conversion_library(MLIRArithmeticToSPIRV add_mlir_conversion_library(MLIRArithToSPIRV
ArithmeticToSPIRV.cpp ArithToSPIRV.cpp
ADDITIONAL_HEADER_DIRS ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithmeticToSPIRV ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithToSPIRV
DEPENDS DEPENDS
MLIRConversionPassIncGen MLIRConversionPassIncGen
@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArithmeticToSPIRV
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRFuncToSPIRV MLIRFuncToSPIRV
MLIRSPIRVConversion MLIRSPIRVConversion
MLIRSPIRVDialect MLIRSPIRVDialect

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRArmNeon2dToIntr
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRArmNeonDialect MLIRArmNeonDialect
MLIRPass MLIRPass
MLIRTransforms MLIRTransforms

View File

@ -11,7 +11,7 @@
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.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/Async/IR/Async.h"
#include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h" #include "mlir/Dialect/Func/Transforms/FuncConversions.h"

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRAsyncToLLVM
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRAsyncDialect MLIRAsyncDialect
MLIRFuncToLLVM MLIRFuncToLLVM
MLIRFuncTransforms MLIRFuncTransforms

View File

@ -13,7 +13,7 @@
#include "mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h" #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/Bufferization/IR/Bufferization.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/BuiltinTypes.h"

View File

@ -1,7 +1,7 @@
add_subdirectory(AffineToStandard) add_subdirectory(AffineToStandard)
add_subdirectory(AMDGPUToROCDL) add_subdirectory(AMDGPUToROCDL)
add_subdirectory(ArithmeticToLLVM) add_subdirectory(ArithToLLVM)
add_subdirectory(ArithmeticToSPIRV) add_subdirectory(ArithToSPIRV)
add_subdirectory(ArmNeon2dToIntr) add_subdirectory(ArmNeon2dToIntr)
add_subdirectory(AsyncToLLVM) add_subdirectory(AsyncToLLVM)
add_subdirectory(BufferizationToMemRef) add_subdirectory(BufferizationToMemRef)

View File

@ -10,7 +10,7 @@
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.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/Complex/IR/Complex.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Pass/Pass.h" #include "mlir/Pass/Pass.h"

View File

@ -8,7 +8,7 @@ add_mlir_conversion_library(MLIRComplexToStandard
MLIRConversionPassIncGen MLIRConversionPassIncGen
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRComplexDialect MLIRComplexDialect
MLIRIR MLIRIR
MLIRMathDialect MLIRMathDialect

View File

@ -8,7 +8,7 @@
#include "mlir/Conversion/ComplexToStandard/ComplexToStandard.h" #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/Complex/IR/Complex.h"
#include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/ImplicitLocOpBuilder.h"
@ -1095,7 +1095,7 @@ void ConvertComplexToStandardPass::runOnOperation() {
populateComplexToStandardConversionPatterns(patterns); populateComplexToStandardConversionPatterns(patterns);
ConversionTarget target(getContext()); ConversionTarget target(getContext());
target.addLegalDialect<arith::ArithmeticDialect, math::MathDialect>(); target.addLegalDialect<arith::ArithDialect, math::MathDialect>();
target.addLegalOp<complex::CreateOp, complex::ImOp, complex::ReOp>(); target.addLegalOp<complex::CreateOp, complex::ImOp, complex::ReOp>();
if (failed( if (failed(
applyPartialConversion(getOperation(), target, std::move(patterns)))) applyPartialConversion(getOperation(), target, std::move(patterns))))

View File

@ -13,7 +13,7 @@ add_mlir_conversion_library(MLIRFuncToLLVM
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRAnalysis MLIRAnalysis
MLIRArithmeticToLLVM MLIRArithToLLVM
MLIRControlFlowToLLVM MLIRControlFlowToLLVM
MLIRDataLayoutInterfaces MLIRDataLayoutInterfaces
MLIRFuncDialect MLIRFuncDialect

View File

@ -14,7 +14,7 @@
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
#include "mlir/Analysis/DataLayoutAnalysis.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/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
@ -741,7 +741,7 @@ struct ConvertFuncToLLVMPass
populateFuncToLLVMConversionPatterns(typeConverter, patterns); populateFuncToLLVMConversionPatterns(typeConverter, patterns);
// TODO: Remove these in favor of their dedicated conversion passes. // TODO: Remove these in favor of their dedicated conversion passes.
arith::populateArithmeticToLLVMConversionPatterns(typeConverter, patterns); arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns); cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);
LLVMConversionTarget target(getContext()); LLVMConversionTarget target(getContext());

View File

@ -29,7 +29,7 @@ add_mlir_conversion_library(MLIRGPUToGPURuntimeTransforms
${NVPTX_LIBS} ${NVPTX_LIBS}
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticToLLVM MLIRArithToLLVM
MLIRAsyncToLLVM MLIRAsyncToLLVM
MLIRControlFlowToLLVM MLIRControlFlowToLLVM
MLIRFuncToLLVM MLIRFuncToLLVM

View File

@ -15,7 +15,7 @@
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h" #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/AsyncToLLVM/AsyncToLLVM.h"
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h" #include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
@ -388,7 +388,7 @@ void GpuToLLVMConversionPass::runOnOperation() {
target.addIllegalDialect<gpu::GPUDialect>(); target.addIllegalDialect<gpu::GPUDialect>();
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter, patterns); mlir::arith::populateArithToLLVMConversionPatterns(converter, patterns);
mlir::cf::populateControlFlowToLLVMConversionPatterns(converter, patterns); mlir::cf::populateControlFlowToLLVMConversionPatterns(converter, patterns);
populateVectorToLLVMConversionPatterns(converter, patterns); populateVectorToLLVMConversionPatterns(converter, patterns);
populateMemRefToLLVMConversionPatterns(converter, patterns); populateMemRefToLLVMConversionPatterns(converter, patterns);

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRGPUToNVVMTransforms
MLIRGPUToNVVMIncGen MLIRGPUToNVVMIncGen
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticToLLVM MLIRArithToLLVM
MLIRFuncToLLVM MLIRFuncToLLVM
MLIRGPUOps MLIRGPUOps
MLIRGPUToGPURuntimeTransforms MLIRGPUToGPURuntimeTransforms

View File

@ -13,14 +13,14 @@
#include "mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h" #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/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h" #include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.h" #include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.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/ControlFlow/IR/ControlFlow.h"
#include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h"
@ -203,7 +203,7 @@ struct LowerGpuOpsToNVVMOpsPass
populateGpuRewritePatterns(patterns); populateGpuRewritePatterns(patterns);
(void)applyPatternsAndFoldGreedily(m, std::move(patterns)); (void)applyPatternsAndFoldGreedily(m, std::move(patterns));
arith::populateArithmeticToLLVMConversionPatterns(converter, llvmPatterns); arith::populateArithToLLVMConversionPatterns(converter, llvmPatterns);
cf::populateControlFlowToLLVMConversionPatterns(converter, llvmPatterns); cf::populateControlFlowToLLVMConversionPatterns(converter, llvmPatterns);
populateFuncToLLVMConversionPatterns(converter, llvmPatterns); populateFuncToLLVMConversionPatterns(converter, llvmPatterns);
populateMemRefToLLVMConversionPatterns(converter, llvmPatterns); populateMemRefToLLVMConversionPatterns(converter, llvmPatterns);

View File

@ -10,7 +10,7 @@ add_mlir_conversion_library(MLIRGPUToROCDLTransforms
MLIRGPUToROCDLIncGen MLIRGPUToROCDLIncGen
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticToLLVM MLIRArithToLLVM
MLIRAMDGPUToROCDL MLIRAMDGPUToROCDL
MLIRFuncToLLVM MLIRFuncToLLVM
MLIRGPUOps MLIRGPUOps

View File

@ -15,7 +15,7 @@
#include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h" #include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.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/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h" #include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
@ -127,8 +127,7 @@ struct LowerGpuOpsToROCDLOpsPass
populateGpuRewritePatterns(patterns); populateGpuRewritePatterns(patterns);
(void)applyPatternsAndFoldGreedily(m, std::move(patterns)); (void)applyPatternsAndFoldGreedily(m, std::move(patterns));
mlir::arith::populateArithmeticToLLVMConversionPatterns(converter, mlir::arith::populateArithToLLVMConversionPatterns(converter, llvmPatterns);
llvmPatterns);
populateAMDGPUToROCDLConversionPatterns(converter, llvmPatterns, populateAMDGPUToROCDLConversionPatterns(converter, llvmPatterns,
*maybeChipset); *maybeChipset);
populateVectorToLLVMConversionPatterns(converter, llvmPatterns); populateVectorToLLVMConversionPatterns(converter, llvmPatterns);

View File

@ -6,7 +6,7 @@ add_mlir_conversion_library(MLIRGPUToSPIRV
MLIRConversionPassIncGen MLIRConversionPassIncGen
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticToSPIRV MLIRArithToSPIRV
MLIRGPUOps MLIRGPUOps
MLIRFuncToSPIRV MLIRFuncToSPIRV
MLIRIR MLIRIR

View File

@ -13,7 +13,7 @@
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h" #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/FuncToSPIRV/FuncToSPIRV.h"
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h" #include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
#include "mlir/Conversion/MemRefToSPIRV/MemRefToSPIRV.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 // TODO: Change SPIR-V conversion to be progressive and remove the following
// patterns. // patterns.
mlir::arith::populateArithmeticToSPIRVPatterns(typeConverter, patterns); mlir::arith::populateArithToSPIRVPatterns(typeConverter, patterns);
populateMemRefToSPIRVPatterns(typeConverter, patterns); populateMemRefToSPIRVPatterns(typeConverter, patterns);
populateFuncToSPIRVPatterns(typeConverter, patterns); populateFuncToSPIRVPatterns(typeConverter, patterns);

View File

@ -141,9 +141,8 @@ struct ConvertLinalgToStandardPass
void ConvertLinalgToStandardPass::runOnOperation() { void ConvertLinalgToStandardPass::runOnOperation() {
auto module = getOperation(); auto module = getOperation();
ConversionTarget target(getContext()); ConversionTarget target(getContext());
target.addLegalDialect<AffineDialect, arith::ArithmeticDialect, target.addLegalDialect<AffineDialect, arith::ArithDialect, func::FuncDialect,
func::FuncDialect, memref::MemRefDialect, memref::MemRefDialect, scf::SCFDialect>();
scf::SCFDialect>();
target.addLegalOp<ModuleOp, func::FuncOp, func::ReturnOp>(); target.addLegalOp<ModuleOp, func::FuncOp, func::ReturnOp>();
RewritePatternSet patterns(&getContext()); RewritePatternSet patterns(&getContext());
populateLinalgToStandardConversionPatterns(patterns); populateLinalgToStandardConversionPatterns(patterns);

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRMathToFuncs
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRControlFlowDialect MLIRControlFlowDialect
MLIRFuncDialect MLIRFuncDialect
MLIRLLVMDialect MLIRLLVMDialect

View File

@ -8,7 +8,7 @@
#include "mlir/Conversion/MathToFuncs/MathToFuncs.h" #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/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
@ -377,7 +377,7 @@ void ConvertMathToFuncsPass::runOnOperation() {
patterns.add<IPowIOpLowering>(patterns.getContext(), getPowerFuncOpByType); patterns.add<IPowIOpLowering>(patterns.getContext(), getPowerFuncOpByType);
ConversionTarget target(getContext()); ConversionTarget target(getContext());
target.addLegalDialect<arith::ArithmeticDialect, cf::ControlFlowDialect, target.addLegalDialect<arith::ArithDialect, cf::ControlFlowDialect,
func::FuncDialect, vector::VectorDialect>(); func::FuncDialect, vector::VectorDialect>();
target.addIllegalOp<math::IPowIOp>(); target.addIllegalOp<math::IPowIOp>();
if (failed(applyPartialConversion(module, target, std::move(patterns)))) if (failed(applyPartialConversion(module, target, std::move(patterns))))

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRMathToLibm
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRDialectUtils MLIRDialectUtils
MLIRFuncDialect MLIRFuncDialect
MLIRMathDialect MLIRMathDialect

View File

@ -8,7 +8,7 @@
#include "mlir/Conversion/MathToLibm/MathToLibm.h" #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/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/Math/IR/Math.h"
@ -212,8 +212,8 @@ void ConvertMathToLibmPass::runOnOperation() {
populateMathToLibmConversionPatterns(patterns, /*benefit=*/1); populateMathToLibmConversionPatterns(patterns, /*benefit=*/1);
ConversionTarget target(getContext()); ConversionTarget target(getContext());
target.addLegalDialect<arith::ArithmeticDialect, BuiltinDialect, target.addLegalDialect<arith::ArithDialect, BuiltinDialect, func::FuncDialect,
func::FuncDialect, vector::VectorDialect>(); vector::VectorDialect>();
target.addIllegalDialect<math::MathDialect>(); target.addIllegalDialect<math::MathDialect>();
if (failed(applyPartialConversion(module, target, std::move(patterns)))) if (failed(applyPartialConversion(module, target, std::move(patterns))))
signalPassFailure(); signalPassFailure();

View File

@ -13,7 +13,7 @@
#include "mlir/Conversion/LLVMCommon/Pattern.h" #include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.h" #include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/Conversion/MemRefToLLVM/AllocLikeConversion.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/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h" #include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h"

View File

@ -8,7 +8,7 @@ add_mlir_conversion_library(MLIROpenACCToSCF
MLIRConversionPassIncGen MLIRConversionPassIncGen
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRIR MLIRIR
MLIROpenACCDialect MLIROpenACCDialect
MLIRSCFDialect MLIRSCFDialect

View File

@ -8,7 +8,7 @@
#include "mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h" #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/OpenACC/OpenACC.h"
#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Pass/Pass.h" #include "mlir/Pass/Pass.h"

View File

@ -12,7 +12,7 @@ add_mlir_conversion_library(MLIROpenMPToLLVM
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticToLLVM MLIRArithToLLVM
MLIRFuncToLLVM MLIRFuncToLLVM
MLIRIR MLIRIR
MLIRLLVMCommonConversion MLIRLLVMCommonConversion

View File

@ -8,7 +8,7 @@
#include "mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h" #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/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
@ -148,7 +148,7 @@ void ConvertOpenMPToLLVMPass::runOnOperation() {
// Convert to OpenMP operations with LLVM IR dialect // Convert to OpenMP operations with LLVM IR dialect
RewritePatternSet patterns(&getContext()); RewritePatternSet patterns(&getContext());
LLVMTypeConverter converter(&getContext()); LLVMTypeConverter converter(&getContext());
arith::populateArithmeticToLLVMConversionPatterns(converter, patterns); arith::populateArithToLLVMConversionPatterns(converter, patterns);
cf::populateControlFlowToLLVMConversionPatterns(converter, patterns); cf::populateControlFlowToLLVMConversionPatterns(converter, patterns);
populateMemRefToLLVMConversionPatterns(converter, patterns); populateMemRefToLLVMConversionPatterns(converter, patterns);
populateFuncToLLVMConversionPatterns(converter, patterns); populateFuncToLLVMConversionPatterns(converter, patterns);

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRSCFToControlFlow
Core Core
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRArithmeticDialect MLIRArithDialect
MLIRControlFlowDialect MLIRControlFlowDialect
MLIRSCFDialect MLIRSCFDialect
MLIRTransforms MLIRTransforms

View File

@ -13,7 +13,7 @@
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h" #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/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/BlockAndValueMapping.h"

View File

@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRSCFToGPU
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRAffineDialect MLIRAffineDialect
MLIRAffineToStandard MLIRAffineToStandard
MLIRArithmeticDialect MLIRArithDialect
MLIRComplexDialect MLIRComplexDialect
MLIRGPUTransforms MLIRGPUTransforms
MLIRIR MLIRIR

View File

@ -16,7 +16,7 @@
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h" #include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/IR/GPUDialect.h"
#include "mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h" #include "mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"

View File

@ -10,7 +10,7 @@
#include "mlir/Conversion/SCFToGPU/SCFToGPU.h" #include "mlir/Conversion/SCFToGPU/SCFToGPU.h"
#include "mlir/Dialect/Affine/IR/AffineOps.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/Complex/IR/Complex.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/IR/SCF.h"

View File

@ -12,7 +12,7 @@ add_mlir_conversion_library(MLIRSCFToOpenMP
LINK_LIBS PUBLIC LINK_LIBS PUBLIC
MLIRAnalysis MLIRAnalysis
MLIRArithmeticDialect MLIRArithDialect
MLIRLLVMDialect MLIRLLVMDialect
MLIROpenMPDialect MLIROpenMPDialect
MLIRSCFDialect MLIRSCFDialect

View File

@ -15,7 +15,7 @@
#include "mlir/Analysis/SliceAnalysis.h" #include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.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/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/OpenMP/OpenMPDialect.h" #include "mlir/Dialect/OpenMP/OpenMPDialect.h"

Some files were not shown because too many files have changed in this diff Show More