From a8a4d35d3ff6906d2ec5f94b0d7e918dce1da229 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Tue, 11 Jun 2019 12:09:50 -0700 Subject: Add a lowering for Linalg matmul to LLVM This CL adds a lowering to LLVM for MamulOp and a corresponding integration test. View descriptor manipulation is moved from MLIR's LLVM dialect to C++ code compiled on the side. To this end a separation is introduced between `cblas.cpp` and `cblas_interface.cpp`, the latter operating on view types whose ABI correspond to the LLVM signature generated by MLIR. An intermediary step is introduced that allocates a new descriptor on the MLIR side for the purpose of passing it to LLVM. The reason for this extra step is that the ABI for by-value ViewType objects wants aligned descriptors, e.g.: ``` extern "C" void linalg_dot_impl(ViewType X, ViewType Y, BaseViewType Z) { ... } ``` produces LLVM IR with the signature: ``` %struct.ViewType = type { %struct.BaseViewType, [1 x i64], [1 x i64] } %struct.BaseViewType = type { float*, i64 } define void @linalg_dot_impl(%struct.ViewType* byval align 8, %struct.ViewType* byval align 8, float*, i64) tensorflow/mlir#0 { ... } ``` We don't seem to be able to make such aligned allocations in the MLIR -> LLVM converter atm. Going through a level of indirection allows the test to pass. The temporary tradeoff is that the MLIR shims have to be written by hand. They will disappear in the future. PiperOrigin-RevId: 252670672 --- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 mlir/test/mlir-cpu-runner/cblas_interface.cpp (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp new file mode 100644 index 00000000000..cf6a49ce4a8 --- /dev/null +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -0,0 +1,63 @@ +//===- cblas_interface.cpp - Simple Blas subset interface -----------------===// +// +// Copyright 2019 The MLIR Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= +// +// Simple Blas subset interface implementation. +// +//===----------------------------------------------------------------------===// + +#include "include/cblas.h" +#include + +template struct ViewType { + T *data; + unsigned long offset; + unsigned long sizes[N]; + unsigned long strides[N]; +}; + +// This is separated out to avoid `unsigned long sizes[0]` which triggers: +// warning: ISO C++ forbids zero-size array [-Wpedantic] +template struct ViewType { + T *data; + unsigned long offset; +}; + +extern "C" void linalg_dot_impl(ViewType *X, ViewType *Y, + ViewType *Z) { + assert(X->sizes[0] == Y->sizes[0] && "Expected X and Y of same size"); + *(Z->data + Z->offset) += + cblas_sdot(X->sizes[0], X->data + X->offset, X->strides[0], + Y->data + Y->offset, Y->strides[0]); +} + +extern "C" void linalg_matmul_impl(ViewType *A, ViewType *B, + ViewType *C) { + assert(A->strides[1] == B->strides[1]); + assert(A->strides[1] == C->strides[1]); + assert(A->strides[1] == 1); + assert(A->sizes[0] >= A->strides[1]); + assert(B->sizes[0] >= B->strides[1]); + assert(C->sizes[0] >= C->strides[1]); + assert(C->sizes[0] == A->sizes[0]); + assert(C->sizes[1] == B->sizes[1]); + assert(A->sizes[1] == B->sizes[0]); + cblas_sgemm(CBLAS_ORDER::CblasRowMajor, CBLAS_TRANSPOSE::CblasNoTrans, + CBLAS_TRANSPOSE::CblasNoTrans, C->sizes[0], C->sizes[1], + A->sizes[1], 0.0f, A->data + A->offset, A->strides[0], + B->data + B->offset, B->strides[0], 1.0f, C->data + C->offset, + C->strides[0]); +} -- cgit v1.2.3 From 00b48e1a9fa91ef53218a587e56d5ef75443458a Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Fri, 26 Jul 2019 03:33:53 -0700 Subject: Fix linalg_matmul_impl interfacing with sgemm This CL provides a fix that makes linal_matmul_impl compliant with the BLAS interface. Before this CL it would compute either C += A * B when called with cblas.cpp:cblas_sgemm implementation and C = A * B with other implementations. PiperOrigin-RevId: 260117367 --- mlir/test/mlir-cpu-runner/cblas.cpp | 2 +- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/test/mlir-cpu-runner/cblas.cpp b/mlir/test/mlir-cpu-runner/cblas.cpp index dfc3a5f9bab..d219b7b1256 100644 --- a/mlir/test/mlir-cpu-runner/cblas.cpp +++ b/mlir/test/mlir-cpu-runner/cblas.cpp @@ -50,7 +50,7 @@ extern "C" void cblas_sgemm(const enum CBLAS_ORDER Order, auto *pB = B + k * ldb; res += pA[k] * pB[n]; } - pC[n] = (1.0f + alpha) * c + beta * res; + pC[n] = alpha * c + beta * res; } } } diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index cf6a49ce4a8..1a632379ac6 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -57,7 +57,7 @@ extern "C" void linalg_matmul_impl(ViewType *A, ViewType *B, assert(A->sizes[1] == B->sizes[0]); cblas_sgemm(CBLAS_ORDER::CblasRowMajor, CBLAS_TRANSPOSE::CblasNoTrans, CBLAS_TRANSPOSE::CblasNoTrans, C->sizes[0], C->sizes[1], - A->sizes[1], 0.0f, A->data + A->offset, A->strides[0], + A->sizes[1], 1.0f, A->data + A->offset, A->strides[0], B->data + B->offset, B->strides[0], 1.0f, C->data + C->offset, C->strides[0]); } -- cgit v1.2.3 From 3708f53219aa2b201e82e7172c5064c1eb9d483b Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Fri, 26 Jul 2019 05:40:58 -0700 Subject: Add sgemm specializations - NFC This CL adds a few specializations for sgemm. A minor change to alpha is made in cblas_interface.cpp to be compatible with actual BLAS calls. For now this is for internal testing purposes only. PiperOrigin-RevId: 260129027 --- mlir/test/mlir-cpu-runner/cblas.cpp | 78 ++++++++++++++++++++++++--- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 4 +- 2 files changed, 73 insertions(+), 9 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/test/mlir-cpu-runner/cblas.cpp b/mlir/test/mlir-cpu-runner/cblas.cpp index d219b7b1256..afc8a6dfa70 100644 --- a/mlir/test/mlir-cpu-runner/cblas.cpp +++ b/mlir/test/mlir-cpu-runner/cblas.cpp @@ -21,6 +21,7 @@ #include "include/cblas.h" #include +#include extern "C" float cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY) { @@ -30,16 +31,79 @@ extern "C" float cblas_sdot(const int N, const float *X, const int incX, return res; } -extern "C" void cblas_sgemm(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, - const int N, const int K, const float alpha, - const float *A, const int lda, const float *B, - const int ldb, const float beta, float *C, - const int ldc) { +#if defined(__GNUC__) || defined(__clang__) +#define __RESTRICT__ __restrict__ +#define __ALIGN__(X) __attribute((aligned(X))) +#define __NOINLINE__ __attribute((noinline)) +#elif defined(_MSC_VER) +#define __RESTRICT__ __restrict +#define __ALIGN__(X) __declspec(align(X)) +#define __NOINLINE__ __declspec(noinline) +#endif + +// Implements a fastpath, specialized matrix multiplication where A, B and C are +// assumed to be small enough to fit within L1 cache. A, B and C are assumed not +// to alias and be aligned modulo 64. +// This is an implementation meant to be compiled for vectorization with e.g.: +// `clang -mavx2 -mfma -ffp-contract=fast` +template +__NOINLINE__ static void +cblas_sgemm_impl(const float alpha, const float *__RESTRICT__ A __ALIGN__(64), + const int lda, const float *__RESTRICT__ B __ALIGN__(64), + const int ldb, const float beta, + float *__RESTRICT__ C __ALIGN__(64), const int ldc) { + for (int m = 0; m < VAL_M; ++m) { + auto *pA = A + m * lda; + auto *pC = C + m * ldc; + float res[VAL_N]; + for (int n = 0; n < VAL_N; ++n) { + res[n] = 0.0f; + } + for (int k = 0; k < VAL_K; ++k) { + auto *pB = B + k * ldb; + float a = pA[k]; + for (int n = 0; n < VAL_N; ++n) { + res[n] += a * pB[n]; + } + } + for (int n = 0; n < VAL_N; ++n) { + pC[n] = alpha * pC[n] + beta * res[n]; + } + } +} + +extern "C" void +cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, + const enum CBLAS_TRANSPOSE TransB, const int M, const int N, + const int K, const float alpha, const float *__RESTRICT__ A, + const int lda, const float *__RESTRICT__ B, const int ldb, + const float beta, float *__RESTRICT__ C, const int ldc) { assert(Order == CBLAS_ORDER::CblasRowMajor); assert(TransA == CBLAS_TRANSPOSE::CblasNoTrans); assert(TransB == CBLAS_TRANSPOSE::CblasNoTrans); + + bool aligned64 = !(reinterpret_cast(A) & 63) && + !(reinterpret_cast(B) & 63) && + !(reinterpret_cast(C) & 63); + if (aligned64) { + if (M == 16 && N == 16 && K == 32) + return cblas_sgemm_impl<16, 16, 32>(alpha, A, lda, B, ldb, beta, C, ldc); + else if (M == 16 && N == 16 && K == 64) + return cblas_sgemm_impl<16, 16, 64>(alpha, A, lda, B, ldb, beta, C, ldc); + else if (M == 16 && N == 32 && K == 16) + return cblas_sgemm_impl<16, 32, 16>(alpha, A, lda, B, ldb, beta, C, ldc); + else if (M == 16 && N == 64 && K == 16) + return cblas_sgemm_impl<16, 64, 16>(alpha, A, lda, B, ldb, beta, C, ldc); + + else if (M == 32 && N == 32 && K == 32) + return cblas_sgemm_impl<32, 32, 32>(alpha, A, lda, B, ldb, beta, C, ldc); + else if (M == 32 && N == 32 && K == 64) + return cblas_sgemm_impl<32, 32, 64>(alpha, A, lda, B, ldb, beta, C, ldc); + else if (M == 32 && N == 64 && K == 32) + return cblas_sgemm_impl<32, 64, 32>(alpha, A, lda, B, ldb, beta, C, ldc); + } + + // Slow path. for (int m = 0; m < M; ++m) { auto *pA = A + m * lda; auto *pC = C + m * ldc; diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index 1a632379ac6..dfb6cb53437 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -46,8 +46,8 @@ extern "C" void linalg_dot_impl(ViewType *X, ViewType *Y, extern "C" void linalg_matmul_impl(ViewType *A, ViewType *B, ViewType *C) { - assert(A->strides[1] == B->strides[1]); - assert(A->strides[1] == C->strides[1]); + assert(A->strides[1] == 1); + assert(A->strides[1] == 1); assert(A->strides[1] == 1); assert(A->sizes[0] >= A->strides[1]); assert(B->sizes[0] >= B->strides[1]); -- cgit v1.2.3 From 130433192675acf5d33f47d7c4d10e1ab64c9a01 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Fri, 26 Jul 2019 06:49:41 -0700 Subject: Automated rollback of commit 3708f53219aa2b201e82e7172c5064c1eb9d483b PiperOrigin-RevId: 260136255 --- mlir/test/mlir-cpu-runner/cblas.cpp | 78 +++------------------------ mlir/test/mlir-cpu-runner/cblas_interface.cpp | 4 +- 2 files changed, 9 insertions(+), 73 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/test/mlir-cpu-runner/cblas.cpp b/mlir/test/mlir-cpu-runner/cblas.cpp index afc8a6dfa70..d219b7b1256 100644 --- a/mlir/test/mlir-cpu-runner/cblas.cpp +++ b/mlir/test/mlir-cpu-runner/cblas.cpp @@ -21,7 +21,6 @@ #include "include/cblas.h" #include -#include extern "C" float cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY) { @@ -31,79 +30,16 @@ extern "C" float cblas_sdot(const int N, const float *X, const int incX, return res; } -#if defined(__GNUC__) || defined(__clang__) -#define __RESTRICT__ __restrict__ -#define __ALIGN__(X) __attribute((aligned(X))) -#define __NOINLINE__ __attribute((noinline)) -#elif defined(_MSC_VER) -#define __RESTRICT__ __restrict -#define __ALIGN__(X) __declspec(align(X)) -#define __NOINLINE__ __declspec(noinline) -#endif - -// Implements a fastpath, specialized matrix multiplication where A, B and C are -// assumed to be small enough to fit within L1 cache. A, B and C are assumed not -// to alias and be aligned modulo 64. -// This is an implementation meant to be compiled for vectorization with e.g.: -// `clang -mavx2 -mfma -ffp-contract=fast` -template -__NOINLINE__ static void -cblas_sgemm_impl(const float alpha, const float *__RESTRICT__ A __ALIGN__(64), - const int lda, const float *__RESTRICT__ B __ALIGN__(64), - const int ldb, const float beta, - float *__RESTRICT__ C __ALIGN__(64), const int ldc) { - for (int m = 0; m < VAL_M; ++m) { - auto *pA = A + m * lda; - auto *pC = C + m * ldc; - float res[VAL_N]; - for (int n = 0; n < VAL_N; ++n) { - res[n] = 0.0f; - } - for (int k = 0; k < VAL_K; ++k) { - auto *pB = B + k * ldb; - float a = pA[k]; - for (int n = 0; n < VAL_N; ++n) { - res[n] += a * pB[n]; - } - } - for (int n = 0; n < VAL_N; ++n) { - pC[n] = alpha * pC[n] + beta * res[n]; - } - } -} - -extern "C" void -cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, const int N, - const int K, const float alpha, const float *__RESTRICT__ A, - const int lda, const float *__RESTRICT__ B, const int ldb, - const float beta, float *__RESTRICT__ C, const int ldc) { +extern "C" void cblas_sgemm(const enum CBLAS_ORDER Order, + const enum CBLAS_TRANSPOSE TransA, + const enum CBLAS_TRANSPOSE TransB, const int M, + const int N, const int K, const float alpha, + const float *A, const int lda, const float *B, + const int ldb, const float beta, float *C, + const int ldc) { assert(Order == CBLAS_ORDER::CblasRowMajor); assert(TransA == CBLAS_TRANSPOSE::CblasNoTrans); assert(TransB == CBLAS_TRANSPOSE::CblasNoTrans); - - bool aligned64 = !(reinterpret_cast(A) & 63) && - !(reinterpret_cast(B) & 63) && - !(reinterpret_cast(C) & 63); - if (aligned64) { - if (M == 16 && N == 16 && K == 32) - return cblas_sgemm_impl<16, 16, 32>(alpha, A, lda, B, ldb, beta, C, ldc); - else if (M == 16 && N == 16 && K == 64) - return cblas_sgemm_impl<16, 16, 64>(alpha, A, lda, B, ldb, beta, C, ldc); - else if (M == 16 && N == 32 && K == 16) - return cblas_sgemm_impl<16, 32, 16>(alpha, A, lda, B, ldb, beta, C, ldc); - else if (M == 16 && N == 64 && K == 16) - return cblas_sgemm_impl<16, 64, 16>(alpha, A, lda, B, ldb, beta, C, ldc); - - else if (M == 32 && N == 32 && K == 32) - return cblas_sgemm_impl<32, 32, 32>(alpha, A, lda, B, ldb, beta, C, ldc); - else if (M == 32 && N == 32 && K == 64) - return cblas_sgemm_impl<32, 32, 64>(alpha, A, lda, B, ldb, beta, C, ldc); - else if (M == 32 && N == 64 && K == 32) - return cblas_sgemm_impl<32, 64, 32>(alpha, A, lda, B, ldb, beta, C, ldc); - } - - // Slow path. for (int m = 0; m < M; ++m) { auto *pA = A + m * lda; auto *pC = C + m * ldc; diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index dfb6cb53437..1a632379ac6 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -46,8 +46,8 @@ extern "C" void linalg_dot_impl(ViewType *X, ViewType *Y, extern "C" void linalg_matmul_impl(ViewType *A, ViewType *B, ViewType *C) { - assert(A->strides[1] == 1); - assert(A->strides[1] == 1); + assert(A->strides[1] == B->strides[1]); + assert(A->strides[1] == C->strides[1]); assert(A->strides[1] == 1); assert(A->sizes[0] >= A->strides[1]); assert(B->sizes[0] >= B->strides[1]); -- cgit v1.2.3 From 59b473c231f6295bd4aa7199da5816caae5a5e3a Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Fri, 9 Aug 2019 07:33:34 -0700 Subject: External library name mangling support for linalg. This CL introduces the ability to generate the external library name for Linalg operations. The problem is that neither mlir or C support overloading and we want a simplified form of name mangling that is still reasonable to read. This CL creates the name of the external call that Linalg expects from the operation name and the type of its arguments. The interface library names are updated and use new cases are added for FillOp. PiperOrigin-RevId: 262556833 --- mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td | 19 ++++++------ mlir/include/mlir/Linalg/IR/LinalgOps.h | 22 ++++++++++++++ mlir/lib/Linalg/IR/LinalgOps.cpp | 33 +++++++++++++++++++++ mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp | 34 +++++++++++----------- mlir/test/Linalg/llvm.mlir | 2 +- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 22 +++++++++++--- .../mlir-cpu-runner/linalg_integration_test.mlir | 22 +++++--------- 7 files changed, 108 insertions(+), 46 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td b/mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td index 547a2c4cf81..998d68ba806 100644 --- a/mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td +++ b/mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td @@ -80,10 +80,9 @@ class LinalgLibraryBase_Op props> class LinalgLibrary_Op props> : LinalgLibraryBase_Op { - - code classDeclaration = [{ - StringRef getLibraryCallName() { - return "linalg_}] # mnemonic # [{"; + code libraryCallName = [{ + std::string getLibraryCallName() { + return generateLibraryCallName(getOperation()); } }]; } @@ -138,7 +137,7 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { return build( builder, result, input, output, AffineMapAttr(), AffineMapAttr()); }]>]; - let extraClassDeclaration = classDeclaration # [{ + let extraClassDeclaration = libraryCallName # [{ unsigned getNumParallelLoops() { auto *view = *(getOperands().begin()); return view->getType().cast().getRank(); @@ -151,7 +150,7 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { def FillOp : LinalgLibrary_Op<"fill", [NInputsAndOutputs<0, 1>]> { let arguments = (ins View, AnyTypeOf<[AnyFloat, AnyInteger, AnyVector]>); - let extraClassDeclaration = classDeclaration # [{ + let extraClassDeclaration = libraryCallName # [{ unsigned getNumParallelLoops() { auto *view = *(getOperands().begin()); return view->getType().cast().getRank(); @@ -170,7 +169,7 @@ def DotOp : LinalgLibrary_Op<"dot", NLoopTypes<0, 1, 0>, ViewRanks<[1, 1, 0]>]> { let arguments = (ins View, View, View); - let extraClassDeclaration = classDeclaration; + let extraClassDeclaration = libraryCallName; } def MatvecOp : LinalgLibrary_Op<"matvec", @@ -178,7 +177,7 @@ def MatvecOp : LinalgLibrary_Op<"matvec", NLoopTypes<1, 1, 0>, ViewRanks<[2, 1, 1]>]> { let arguments = (ins View, View, View); - let extraClassDeclaration = classDeclaration; + let extraClassDeclaration = libraryCallName; } def MatmulOp : LinalgLibrary_Op<"matmul", @@ -186,7 +185,7 @@ def MatmulOp : LinalgLibrary_Op<"matmul", NLoopTypes<2, 1, 0>, ViewRanks<[2, 2, 2]>]> { let arguments = (ins View, View, View); - let extraClassDeclaration = classDeclaration; + let extraClassDeclaration = libraryCallName; } def ConvOp : LinalgLibrary_Op<"conv", [NInputsAndOutputs<2, 1>]> { @@ -211,7 +210,7 @@ def ConvOp : LinalgLibrary_Op<"conv", [NInputsAndOutputs<2, 1>]> { let arguments = (ins View:$filter, View:$input, View:$output, OptionalAttr:$strides, OptionalAttr:$dilations); - let extraClassDeclaration = classDeclaration # [{ + let extraClassDeclaration = libraryCallName # [{ // TODO(ntv) extend to support more than 1 dimensions and potentially // grouping too. unsigned getNumBatchDimensions() { return 1; } diff --git a/mlir/include/mlir/Linalg/IR/LinalgOps.h b/mlir/include/mlir/Linalg/IR/LinalgOps.h index 4085d066324..3187f4f80ef 100644 --- a/mlir/include/mlir/Linalg/IR/LinalgOps.h +++ b/mlir/include/mlir/Linalg/IR/LinalgOps.h @@ -186,6 +186,28 @@ public: } }; +/// Returns the name mangled library call name to disambiguate between different +/// overloads at the C level. The name mangling scheme is basic and uses MLIR +/// type names: +/// 1. form a string which is the concatenation of the linalg op name with all +/// the operand type names, separate by underscores; +/// 2. drop the `linalg.` prefix, and the `<`, `>`, `?` symbols from the type. +/// Assumes `op` is a LinalgOp. +/// +/// Examples: +/// +/// 1. linalg.fill(%A, %f) : !linalg.view, f32 +/// name mangles into `linalg_fill_viewf32_f32_impl` +/// +/// 2. linalg.dot(%A, %B, %C) : +/// !linalg.view, !linalg.view, !linalg.view +/// name mangles into `linalg_dot_viewxf32_viewxf32_viewf32_impl` +/// +/// 3. linalg.matmul(...) : +/// !linalg.view, !linalg.view, !linalg.view +/// name mangles into `linalg_matmul_viewxxf32_viewxxf32_viewxxf32_impl` +std::string generateLibraryCallName(Operation *op); + #define GET_OP_CLASSES #include "mlir/Linalg/IR/LinalgOps.h.inc" diff --git a/mlir/lib/Linalg/IR/LinalgOps.cpp b/mlir/lib/Linalg/IR/LinalgOps.cpp index 6549508fc09..bce2b32be77 100644 --- a/mlir/lib/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Linalg/IR/LinalgOps.cpp @@ -37,6 +37,7 @@ #include "mlir/Transforms/FoldUtils.h" #include "llvm/ADT/StringSet.h" +#include "llvm/Support/raw_ostream.h" using namespace mlir; using namespace mlir::edsc; @@ -1085,3 +1086,35 @@ SmallVector mlir::linalg::loopToOperandRangesMaps(Operation *op) { } llvm_unreachable("Missing loopToOperandRangesMaps for op"); } + +static void appendMangledType(llvm::raw_string_ostream &ss, Type t) { + if (auto view = t.dyn_cast()) { + ss << "view"; + for (unsigned i = 0, e = view.getRank(); i < e; ++i) + ss << "x"; + appendMangledType(ss, view.getElementType()); + } else if (auto vec = t.dyn_cast()) { + ss << "vector"; + interleave( + vec.getShape(), [&](int64_t i) { ss << i; }, [&]() { ss << "x"; }); + appendMangledType(ss, vec.getElementType()); + } else if (t.isIntOrIndexOrFloat()) { + ss << t; + } else { + llvm_unreachable("Invalid type for linalg library name mangling"); + } +} + +std::string mlir::linalg::generateLibraryCallName(Operation *op) { + assert(isa(op)); + std::string name(op->getName().getStringRef().str()); + name.reserve(128); + std::replace(name.begin(), name.end(), '.', '_'); + llvm::raw_string_ostream ss(name); + ss << "_"; + auto types = op->getOperandTypes(); + interleave( + types.begin(), types.end(), [&](Type t) { appendMangledType(ss, t); }, + [&]() { ss << "_"; }); + return ss.str(); +} diff --git a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp index 6967a9dd331..a45f943bea8 100644 --- a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp +++ b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp @@ -39,6 +39,8 @@ #include "mlir/Transforms/DialectConversion.h" #include "mlir/Transforms/LowerAffine.h" #include "mlir/Transforms/Passes.h" + +#include "llvm/ADT/SetVector.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" @@ -545,7 +547,7 @@ static FuncOp getLLVMLibraryCallImplDefinition(FuncOp libFn) { } SmallVector fnArgTypes; for (auto t : libFn.getType().getInputs()) { - assert(t.isa() && + assert(t && t.isa() && "Expected LLVM Type for argument while generating library Call " "Implementation Definition"); fnArgTypes.push_back(t.cast().getPointerTo()); @@ -577,12 +579,8 @@ getLLVMLibraryCallDeclaration(Operation *op, LLVMTypeConverter &lowering, // Get the Function type consistent with LLVM Lowering. SmallVector inputTypes; - for (auto operand : op->getOperands()) { - // TODO(ravishankarm): convertLinalgType handles only a subset of Linalg - // types. Handle other types (as well as non-Linalg types) either here or in - // convertLinalgType. - inputTypes.push_back(convertLinalgType(operand->getType(), lowering)); - } + for (auto operand : op->getOperands()) + inputTypes.push_back(lowering.convertType(operand->getType())); assert(op->getNumResults() == 0 && "Library call for linalg operation can be generated only for ops that " "have void return types"); @@ -632,15 +630,15 @@ public: return convertLinalgType(t, *this); } - void addLibraryFnDeclaration(FuncOp fn) { - libraryFnDeclarations.push_back(fn); - } + void addLibraryFnDeclaration(FuncOp fn) { libraryFnDeclarations.insert(fn); } - ArrayRef getLibraryFnDeclarations() { return libraryFnDeclarations; } + ArrayRef getLibraryFnDeclarations() { + return libraryFnDeclarations.getArrayRef(); + } private: /// List of library functions declarations needed during dialect conversion - SmallVector libraryFnDeclarations; + llvm::SetVector libraryFnDeclarations; }; } // end anonymous namespace @@ -676,11 +674,13 @@ static void populateLinalgToLLVMConversionPatterns(LinalgTypeConverter &converter, OwningRewritePatternList &patterns, MLIRContext *ctx) { - patterns.insert, LinalgOpConversion, - LoadOpConversion, RangeOpConversion, SliceOpConversion, - StoreOpConversion, ViewOpConversion>(ctx, converter); + patterns + .insert, LinalgOpConversion, + LinalgOpConversion, LoadOpConversion, RangeOpConversion, + SliceOpConversion, StoreOpConversion, ViewOpConversion>( + ctx, converter); } namespace { diff --git a/mlir/test/Linalg/llvm.mlir b/mlir/test/Linalg/llvm.mlir index a1739d48abc..e82274a3a24 100644 --- a/mlir/test/Linalg/llvm.mlir +++ b/mlir/test/Linalg/llvm.mlir @@ -87,7 +87,7 @@ func @dot(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg return } // CHECK-LABEL: func @dot(%{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) { -// CHECK: llvm.call @linalg_dot(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) -> () +// CHECK: llvm.call @linalg_dot_viewxf32_viewxf32_viewf32(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) -> () func @dim(%arg0: !linalg.view) { %0 = linalg.dim %arg0, 1 : !linalg.view diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index 1a632379ac6..973c7f2437e 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -36,16 +36,30 @@ template struct ViewType { unsigned long offset; }; -extern "C" void linalg_dot_impl(ViewType *X, ViewType *Y, - ViewType *Z) { +extern "C" void linalg_fill_viewf32_f32_impl(ViewType *X, float *pF) { + *(X->data + X->offset) = *pF; +} + +extern "C" void linalg_fill_viewxf32_f32_impl(ViewType *X, + float *pF) { + float f = *pF; + for (unsigned i = 0; i < X->sizes[0]; ++i) { + *(X->data + X->offset + i * X->strides[0]) = f; + } +} + +extern "C" void linalg_dot_viewxf32_viewxf32_viewf32_impl( + ViewType *X, ViewType *Y, ViewType *Z) { + assert(X->strides[0] == 1); + assert(Y->strides[0] == 1); assert(X->sizes[0] == Y->sizes[0] && "Expected X and Y of same size"); *(Z->data + Z->offset) += cblas_sdot(X->sizes[0], X->data + X->offset, X->strides[0], Y->data + Y->offset, Y->strides[0]); } -extern "C" void linalg_matmul_impl(ViewType *A, ViewType *B, - ViewType *C) { +extern "C" void linalg_matmul_viewxxf32_viewxxf32_viewxxf32_impl( + ViewType *A, ViewType *B, ViewType *C) { assert(A->strides[1] == B->strides[1]); assert(A->strides[1] == C->strides[1]); assert(A->strides[1] == 1); diff --git a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir index 2dc974883c6..76b28abd87a 100644 --- a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir +++ b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir @@ -3,24 +3,18 @@ // RUN: mlir-opt %s -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s // RUN: mlir-opt %s -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -func @fill_f32(%arg0 : !linalg.buffer, %f : f32) { +// Creates and returns a 1-D buffer of size %s filled with the value %f +func @alloc_filled_f32(%s : index, %f : f32) -> !linalg.buffer { %c0 = constant 0 : index %c1 = constant 1 : index - %s = linalg.buffer_size %arg0 : !linalg.buffer + %buf = linalg.buffer_alloc %s : !linalg.buffer %R = linalg.range %c0:%s:%c1 : !linalg.range - %V = linalg.view %arg0[%R] : !linalg.buffer -> !linalg.view - loop.for %i0 = %c0 to %s step %c1 { - linalg.store %f, %V[%i0] : !linalg.view - } - return -} - -func @alloc_filled_f32(%s : index, %f : f32) -> !linalg.buffer { - %A = linalg.buffer_alloc %s : !linalg.buffer - call @fill_f32(%A, %f) : (!linalg.buffer, f32) -> () - return %A : !linalg.buffer + %V = linalg.view %buf[%R] : !linalg.buffer -> !linalg.view + linalg.fill(%V, %f) : !linalg.view, f32 + return %buf : !linalg.buffer } +// Test for linalg.dot. func @dot() -> f32 { %c0 = constant 0 : index %c1 = constant 1 : index @@ -48,6 +42,7 @@ func @dot() -> f32 { return %res : f32 } +// Test for linalg.matmul. func @matmul() -> f32 { %c0 = constant 0 : index %c1 = constant 1 : index @@ -82,6 +77,5 @@ func @matmul() -> f32 { return %res : f32 } - // All tests return this value // CHECK: 4.2{{0+}}e+01 -- cgit v1.2.3 From 9bf69e6a2e9d1ef60ac9e4efa8fda9b6c3560e63 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Mon, 19 Aug 2019 10:21:15 -0700 Subject: Refactor linalg lowering to LLVM The linalg.view type used to be lowered to a struct containing a data pointer, offset, sizes/strides information. This was problematic when passing to external functions due to ABI, struct padding and alignment issues. The linalg.view type is now lowered to LLVMIR as a *pointer* to a struct containing the data pointer, offset and sizes/strides. This simplifies the interfacing with external library functions and makes it trivial to add new functions without creating a shim that would go from a value type struct to a pointer type. The consequences are that: 1. lowering explicitly uses llvm.alloca in lieu of llvm.undef and performs the proper llvm.load/llvm.store where relevant. 2. the shim creation function `getLLVMLibraryCallDefinition` disappears. 3. views are passed by pointer, scalars are passed by value. In the future, other structs will be passed by pointer (on a per-need basis). PiperOrigin-RevId: 264183671 --- mlir/include/mlir/LLVMIR/LLVMOps.td | 22 +- mlir/include/mlir/Linalg/IR/LinalgBase.td | 15 ++ .../GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp | 15 +- .../StandardToLLVM/ConvertStandardToLLVM.cpp | 5 +- mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp | 255 +++++++++++---------- mlir/test/Linalg/llvm.mlir | 161 +++++++------ mlir/test/mlir-cpu-runner/cblas_interface.cpp | 18 +- 7 files changed, 268 insertions(+), 223 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/include/mlir/LLVMIR/LLVMOps.td b/mlir/include/mlir/LLVMIR/LLVMOps.td index d988f36d12c..cf456614442 100644 --- a/mlir/include/mlir/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/LLVMIR/LLVMOps.td @@ -234,14 +234,12 @@ def LLVM_AllocaOp : $res = alloca; }]; let builders = [OpBuilder< - "Builder *b, OperationState *result, Type resultType, Value *arraySize," - "unsigned alignment = 0", + "Builder *b, OperationState *result, Type resultType, Value *arraySize, " + "unsigned alignment", [{ - if (!alignment) + if (alignment == 0) return build(b, result, resultType, arraySize, IntegerAttr()); - auto *ctx = resultType.getContext(); - auto align = IntegerAttr::get(IntegerType::get(64, ctx), alignment); - build(b, result, resultType, arraySize, align); + build(b, result, resultType, arraySize, b->getI64IntegerAttr(alignment)); }]>]; let parser = [{ return parseAllocaOp(parser, result); }]; let printer = [{ printAllocaOp(p, *this); }]; @@ -262,6 +260,12 @@ def LLVM_GEPOp : LLVM_OneResultOp<"getelementptr", [NoSideEffect]>, } def LLVM_LoadOp : LLVM_OneResultOp<"load">, Arguments<(ins LLVM_Type:$addr)>, LLVM_Builder<"$res = builder.CreateLoad($addr);"> { + let builders = [OpBuilder< + "Builder *b, OperationState *result, Value *addr", + [{ + auto type = addr->getType().cast().getPointerElementTy(); + build(b, result, type, addr); + }]>]; let parser = [{ return parseLoadOp(parser, result); }]; let printer = [{ printLoadOp(p, *this); }]; } @@ -344,6 +348,12 @@ def LLVM_InsertValueOp : LLVM_OneResultOp<"insertvalue", [NoSideEffect]>, $res = builder.CreateInsertValue($container, $value, extractPosition($position)); }]; + let builders = [OpBuilder< + "Builder *b, OperationState *result, Value *container, Value *value, " + "ArrayAttr position", + [{ + build(b, result, container->getType(), container, value, position); + }]>]; let parser = [{ return parseInsertValueOp(parser, result); }]; let printer = [{ printInsertValueOp(p, *this); }]; } diff --git a/mlir/include/mlir/Linalg/IR/LinalgBase.td b/mlir/include/mlir/Linalg/IR/LinalgBase.td index ac6eedaddb2..5ca798ed431 100644 --- a/mlir/include/mlir/Linalg/IR/LinalgBase.td +++ b/mlir/include/mlir/Linalg/IR/LinalgBase.td @@ -30,6 +30,21 @@ include "mlir/IR/OpBase.td" def Linalg_Dialect : Dialect { let name = "linalg"; + let description = [{ + The Linalg dialect groups together a set of types and operations that are + useful to implement a "linear algebra"-like abstraction where ops can lower + to scalar load/store and operations or to more general library calls. + + The Linalg dialect adopts a convention that is similar to BLAS when + offloading operations to fast library implementations: pass a non-owning + pointer to input and output data with additional metadata. This convention + is also found in libraries such as MKL, OpenBLAS, cuBLAS, cuDNN, etc.. and + more generally at interface points across language boundaries (e.g. C++ / + Python). + + Generally, Linalg passes non-owning pointers to View data structures to + precompiled library calls linked externally. + }]; } // Whether a type is a BufferType. diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp index b3864a39560..a3b80b1e9e0 100644 --- a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp +++ b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp @@ -111,7 +111,8 @@ private: Value *allocatePointer(OpBuilder &builder, Location loc) { auto one = builder.create(loc, getInt32Type(), builder.getI32IntegerAttr(1)); - return builder.create(loc, getPointerPointerType(), one); + return builder.create(loc, getPointerPointerType(), one, + /*alignment=*/0); } void declareCudaFunctions(Location loc); @@ -233,13 +234,13 @@ GpuLaunchFuncToCudaCallsPass::setupParamsArray(gpu::LaunchFuncOp launchOp, auto arraySize = builder.create( loc, getInt32Type(), builder.getI32IntegerAttr(launchOp.getNumKernelOperands())); - auto array = - builder.create(loc, getPointerPointerType(), arraySize); + auto array = builder.create(loc, getPointerPointerType(), + arraySize, /*alignment=*/0); for (int idx = 0, e = launchOp.getNumKernelOperands(); idx < e; ++idx) { auto operand = launchOp.getKernelOperand(idx); auto llvmType = operand->getType().cast(); - auto memLocation = - builder.create(loc, llvmType.getPointerTo(), one); + auto memLocation = builder.create( + loc, llvmType.getPointerTo(), one, /*alignment=*/1); builder.create(loc, operand, memLocation); auto casted = builder.create(loc, getPointerType(), memLocation); @@ -267,8 +268,8 @@ Value *GpuLaunchFuncToCudaCallsPass::generateKernelNameConstant( auto kernelNameSize = builder.create( loc, getInt32Type(), builder.getI32IntegerAttr(kernelFunction.getName().size() + 1)); - auto kernelName = - builder.create(loc, getPointerType(), kernelNameSize); + auto kernelName = builder.create( + loc, getPointerType(), kernelNameSize, /*alignment=*/1); for (auto byte : llvm::enumerate(kernelFunction.getName())) { auto index = builder.create( loc, getInt32Type(), builder.getI32IntegerAttr(byte.index())); diff --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp index 9ba06db7aba..4240e3e7ae7 100644 --- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp @@ -808,10 +808,7 @@ struct LoadOpLowering : public LoadStoreOpLowering { Value *dataPtr = getDataPtr(op->getLoc(), type, transformed.memref(), transformed.indices(), rewriter, getModule()); - auto elementType = lowering.convertType(type.getElementType()); - - rewriter.replaceOpWithNewOp(op, elementType, - ArrayRef{dataPtr}); + rewriter.replaceOpWithNewOp(op, dataPtr); return matchSuccess(); } }; diff --git a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp index de183f8f76e..05bdf24a975 100644 --- a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp +++ b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp @@ -117,21 +117,22 @@ static Type convertLinalgType(Type t, LLVMTypeConverter &lowering) { if (t.isa()) return LLVMType::getStructTy(int64Ty, int64Ty, int64Ty); - // View descriptor contains the pointer to the data buffer, followed by a - // 64-bit integer containing the distance between the beginning of the buffer - // and the first element to be accessed through the view, followed by two - // arrays, each containing as many 64-bit integers as the rank of the View. - // The first array represents the size, in number of original elements, of the - // view along the given dimension. When taking the view, the size is the - // difference between the upper and the lower bound of the range. The second - // array represents the "stride" (in tensor abstraction sense), i.e. the - // number of consecutive elements of the underlying buffer that separate two - // consecutive elements addressable through the view along the given - // dimension. When taking the view, the strides are constructed as products - // of the original sizes along the trailing dimensions, multiplied by the view - // step. For example, a view of a MxN memref with ranges {0:M:1}, {0:N:1}, - // i.e. the view of a complete memref, will have strides N and 1. A view with - // ranges {0:M:2}, {0:N:3} will have strides 2*N and 3. + // A linalg.view type converts to a *pointer to* a view descriptor. The view + // descriptor contains the pointer to the data buffer, followed by a 64-bit + // integer containing the distance between the beginning of the buffer and the + // first element to be accessed through the view, followed by two arrays, each + // containing as many 64-bit integers as the rank of the View. The first array + // represents the size, in number of original elements, of the view along the + // given dimension. When taking the view, the size is the difference between + // the upper and the lower bound of the range. The second array represents the + // "stride" (in tensor abstraction sense), i.e. the number of consecutive + // elements of the underlying buffer that separate two consecutive elements + // addressable through the view along the given dimension. When taking the + // view, the strides are constructed as products of the original sizes along + // the trailing dimensions, multiplied by the view step. For example, a view + // of a MxN memref with ranges {0:M:1}, {0:N:1}, i.e. the view of a complete + // memref, will have strides N and 1. A view with ranges {0:M:2}, {0:N:3} + // will have strides 2*N and 3. // // template // struct { @@ -139,16 +140,24 @@ static Type convertLinalgType(Type t, LLVMTypeConverter &lowering) { // int64_t offset; // int64_t sizes[Rank]; // int64_t strides[Rank]; - // }; + // } *; if (auto viewType = t.dyn_cast()) { auto ptrTy = getPtrToElementType(viewType, lowering); auto arrayTy = LLVMType::getArrayTy(int64Ty, viewType.getRank()); - return LLVMType::getStructTy(ptrTy, int64Ty, arrayTy, arrayTy); + return LLVMType::getStructTy(ptrTy, int64Ty, arrayTy, arrayTy) + .getPointerTo(); } return Type(); } +static constexpr int kPtrPosInBuffer = 0; +static constexpr int kSizePosInBuffer = 1; +static constexpr int kPtrPosInView = 0; +static constexpr int kOffsetPosInView = 1; +static constexpr int kSizePosInView = 2; +static constexpr int kStridePosInView = 3; + // Create an array attribute containing integer attributes with values provided // in `position`. static ArrayAttr positionAttr(Builder &builder, ArrayRef position) { @@ -192,10 +201,9 @@ public: llvm::divideCeil(vectorType.getElementTypeBitWidth(), 8); else elementSize = llvm::divideCeil(elementType.getIntOrFloatBitWidth(), 8); - auto bufferType = allocOp.getResult()->getType().cast(); + auto bufferType = allocOp.getBufferType(); auto elementPtrType = getPtrToElementType(bufferType, lowering); - auto bufferDescriptorType = - convertLinalgType(allocOp.getResult()->getType(), lowering); + auto bufferDescriptorTy = convertLinalgType(bufferType, lowering); // Emit IR for creating a new buffer descriptor with an underlying malloc. edsc::ScopedContext context(rewriter, op->getLoc()); @@ -212,11 +220,11 @@ public: .getOperation() ->getResult(0); allocated = bitcast(elementPtrType, allocated); - Value *desc = undef(bufferDescriptorType); - desc = insertvalue(bufferDescriptorType, desc, allocated, - positionAttr(rewriter, 0)); - desc = insertvalue(bufferDescriptorType, desc, size, - positionAttr(rewriter, 1)); + Value *desc = undef(bufferDescriptorTy); + desc = insertvalue(bufferDescriptorTy, desc, allocated, + positionAttr(rewriter, kPtrPosInBuffer)); + desc = insertvalue(bufferDescriptorTy, desc, size, + positionAttr(rewriter, kSizePosInBuffer)); rewriter.replaceOp(op, desc); return matchSuccess(); } @@ -246,13 +254,15 @@ public: // Get MLIR types for extracting element pointer. auto deallocOp = cast(op); - auto elementPtrTy = getPtrToElementType( - deallocOp.getOperand()->getType().cast(), lowering); + auto elementPtrTy = + getPtrToElementType(deallocOp.getBufferType(), lowering); // Emit MLIR for buffer_dealloc. + BufferDeallocOpOperandAdaptor adaptor(operands); edsc::ScopedContext context(rewriter, op->getLoc()); - Value *casted = bitcast(voidPtrTy, extractvalue(elementPtrTy, operands[0], - positionAttr(rewriter, 0))); + Value *casted = + bitcast(voidPtrTy, extractvalue(elementPtrTy, adaptor.buffer(), + positionAttr(rewriter, 0))); llvm_call(ArrayRef(), rewriter.getSymbolRefAttr(freeFunc), casted); rewriter.replaceOp(op, llvm::None); return matchSuccess(); @@ -270,8 +280,10 @@ public: ConversionPatternRewriter &rewriter) const override { auto int64Ty = lowering.convertType(rewriter.getIntegerType(64)); edsc::ScopedContext context(rewriter, op->getLoc()); + BufferSizeOpOperandAdaptor adaptor(operands); rewriter.replaceOp( - op, {extractvalue(int64Ty, operands[0], positionAttr(rewriter, 1))}); + op, {extractvalue(int64Ty, adaptor.buffer(), + positionAttr(rewriter, kSizePosInBuffer))}); return matchSuccess(); } }; @@ -288,11 +300,11 @@ public: auto dimOp = cast(op); auto indexTy = lowering.convertType(rewriter.getIndexType()); edsc::ScopedContext context(rewriter, op->getLoc()); - rewriter.replaceOp( - op, - {extractvalue( - indexTy, operands[0], - positionAttr(rewriter, {2, static_cast(dimOp.getIndex())}))}); + auto pos = positionAttr( + rewriter, {kSizePosInView, static_cast(dimOp.getIndex())}); + linalg::DimOpOperandAdaptor adaptor(operands); + Value *viewDescriptor = llvm_load(adaptor.view()); + rewriter.replaceOp(op, {extractvalue(indexTy, viewDescriptor, pos)}); return matchSuccess(); } }; @@ -311,7 +323,7 @@ public: // current view indices. Use the base offset and strides stored in the view // descriptor to emit IR iteratively computing the actual offset, followed by // a getelementptr. This must be called under an edsc::ScopedContext. - Value *obtainDataPtr(Operation *op, Value *viewDescriptor, + Value *obtainDataPtr(Operation *op, Value *viewDescriptorPtr, ArrayRef indices, ConversionPatternRewriter &rewriter) const { auto loadOp = cast(op); @@ -323,10 +335,13 @@ public: // Linearize subscripts as: // base_offset + SUM_i index_i * stride_i. - Value *base = extractvalue(elementTy, viewDescriptor, pos(0)); - Value *offset = extractvalue(int64Ty, viewDescriptor, pos(1)); + Value *viewDescriptor = llvm_load(viewDescriptorPtr); + Value *base = extractvalue(elementTy, viewDescriptor, pos(kPtrPosInView)); + Value *offset = + extractvalue(int64Ty, viewDescriptor, pos(kOffsetPosInView)); for (int i = 0, e = loadOp.getRank(); i < e; ++i) { - Value *stride = extractvalue(int64Ty, viewDescriptor, pos({3, i})); + Value *stride = + extractvalue(int64Ty, viewDescriptor, pos({kStridePosInView, i})); Value *additionalOffset = mul(indices[i], stride); offset = add(offset, additionalOffset); } @@ -344,9 +359,8 @@ class LoadOpConversion : public LoadStoreOpConversion { ConversionPatternRewriter &rewriter) const override { edsc::ScopedContext edscContext(rewriter, op->getLoc()); auto elementTy = lowering.convertType(*op->result_type_begin()); - Value *viewDescriptor = operands[0]; - ArrayRef indices = operands.drop_front(); - auto ptr = obtainDataPtr(op, viewDescriptor, indices, rewriter); + linalg::LoadOpOperandAdaptor adaptor(operands); + auto ptr = obtainDataPtr(op, adaptor.view(), adaptor.indices(), rewriter); rewriter.replaceOp(op, {llvm_load(elementTy, ptr)}); return matchSuccess(); } @@ -368,18 +382,23 @@ public: edsc::ScopedContext context(rewriter, op->getLoc()); // Fill in an aggregate value of the descriptor. + RangeOpOperandAdaptor adaptor(operands); Value *desc = undef(rangeDescriptorTy); - desc = insertvalue(rangeDescriptorTy, desc, operands[0], - positionAttr(rewriter, 0)); - desc = insertvalue(rangeDescriptorTy, desc, operands[1], - positionAttr(rewriter, 1)); - desc = insertvalue(rangeDescriptorTy, desc, operands[2], - positionAttr(rewriter, 2)); + desc = insertvalue(desc, adaptor.min(), positionAttr(rewriter, 0)); + desc = insertvalue(desc, adaptor.max(), positionAttr(rewriter, 1)); + desc = insertvalue(desc, adaptor.step(), positionAttr(rewriter, 2)); rewriter.replaceOp(op, desc); return matchSuccess(); } }; +/// Conversion pattern that transforms a linalg.slice op into: +/// 1. A function entry `alloca` operation to allocate a ViewDescriptor. +/// 2. A load of the ViewDescriptor from the pointer allocated in 1. +/// 3. Updates to the ViewDescriptor to introduce the data ptr, offset, size +/// and stride corresponding to the +/// 4. A store of the resulting ViewDescriptor to the alloca'ed pointer. +/// The linalg.slice op is replaced by the alloca'ed pointer. class SliceOpConversion : public LLVMOpLowering { public: explicit SliceOpConversion(MLIRContext *context, LLVMTypeConverter &lowering_) @@ -390,7 +409,8 @@ public: ConversionPatternRewriter &rewriter) const override { SliceOpOperandAdaptor adaptor(operands); auto sliceOp = cast(op); - auto viewDescriptorTy = convertLinalgType(sliceOp.getViewType(), lowering); + auto viewDescriptorPtrTy = + convertLinalgType(sliceOp.getViewType(), lowering); auto viewType = sliceOp.getBaseViewType(); auto int64Ty = lowering.convertType(rewriter.getIntegerType(64)); @@ -399,26 +419,36 @@ public: auto pos = [&rewriter](ArrayRef values) { return positionAttr(rewriter, values); }; - // Helper function to obtain the ptr of the given `view`. - auto getViewPtr = [pos, this](ViewType type, Value *view) -> Value * { - auto elementPtrTy = getPtrToElementType(type, lowering); - return extractvalue(elementPtrTy, view, pos(0)); - }; edsc::ScopedContext context(rewriter, op->getLoc()); - // Declare the view descriptor and insert data ptr. - Value *desc = undef(viewDescriptorTy); - desc = insertvalue(viewDescriptorTy, desc, - getViewPtr(viewType, adaptor.view()), pos(0)); + // Declare the view descriptor and insert data ptr *at the entry block of + // the function*, which is the preferred location for LLVM's analyses. + auto ip = rewriter.getInsertionPoint(); + auto ib = rewriter.getInsertionBlock(); + rewriter.setInsertionPointToStart( + &op->getParentOfType().getBlocks().front()); + Value *one = + constant(int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 1)); + // Alloca with proper alignment. + Value *allocatedDesc = + llvm_alloca(viewDescriptorPtrTy, one, /*alignment=*/8); + Value *desc = llvm_load(allocatedDesc); + rewriter.setInsertionPoint(ib, ip); + + Value *baseDesc = llvm_load(adaptor.view()); + + auto ptrPos = pos(kPtrPosInView); + auto elementTy = getPtrToElementType(sliceOp.getViewType(), lowering); + desc = insertvalue(desc, extractvalue(elementTy, baseDesc, ptrPos), ptrPos); // TODO(ntv): extract sizes and emit asserts. SmallVector strides(viewType.getRank()); for (int i = 0, e = viewType.getRank(); i < e; ++i) { - strides[i] = extractvalue(int64Ty, adaptor.view(), pos({3, i})); + strides[i] = extractvalue(int64Ty, baseDesc, pos({kStridePosInView, i})); } // Compute and insert base offset. - Value *baseOffset = extractvalue(int64Ty, adaptor.view(), pos(1)); + Value *baseOffset = extractvalue(int64Ty, baseDesc, pos(kOffsetPosInView)); for (int i = 0, e = viewType.getRank(); i < e; ++i) { Value *indexing = adaptor.indexings()[i]; Value *min = @@ -428,7 +458,7 @@ public: Value *product = mul(min, strides[i]); baseOffset = add(baseOffset, product); } - desc = insertvalue(viewDescriptorTy, desc, baseOffset, pos(1)); + desc = insertvalue(desc, baseOffset, pos(kOffsetPosInView)); // Compute and insert view sizes (max - min along the range) and strides. // Skip the non-range operands as they will be projected away from the view. @@ -443,14 +473,15 @@ public: Value *step = extractvalue(int64Ty, rangeDescriptor, pos(2)); Value *size = sub(max, min); Value *stride = mul(strides[i], step); - desc = insertvalue(viewDescriptorTy, desc, size, pos({2, numNewDims})); - desc = - insertvalue(viewDescriptorTy, desc, stride, pos({3, numNewDims})); + desc = insertvalue(desc, size, pos({kSizePosInView, numNewDims})); + desc = insertvalue(desc, stride, pos({kStridePosInView, numNewDims})); ++numNewDims; } } - rewriter.replaceOp(op, desc); + // Store back in alloca'ed region. + llvm_store(desc, allocatedDesc); + rewriter.replaceOp(op, allocatedDesc); return matchSuccess(); } }; @@ -463,16 +494,21 @@ class StoreOpConversion : public LoadStoreOpConversion { matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const override { edsc::ScopedContext edscContext(rewriter, op->getLoc()); - Value *data = operands[0]; - Value *viewDescriptor = operands[1]; - ArrayRef indices = operands.drop_front(2); - Value *ptr = obtainDataPtr(op, viewDescriptor, indices, rewriter); - llvm_store(data, ptr); + linalg::StoreOpOperandAdaptor adaptor(operands); + Value *ptr = obtainDataPtr(op, adaptor.view(), adaptor.indices(), rewriter); + llvm_store(adaptor.value(), ptr); rewriter.replaceOp(op, llvm::None); return matchSuccess(); } }; +/// Conversion pattern that transforms a linalg.view op into: +/// 1. A function entry `alloca` operation to allocate a ViewDescriptor. +/// 2. A load of the ViewDescriptor from the pointer allocated in 1. +/// 3. Updates to the ViewDescriptor to introduce the data ptr, offset, size +/// and stride. +/// 4. A store of the resulting ViewDescriptor to the alloca'ed pointer. +/// The linalg.view op is replaced by the alloca'ed pointer. class ViewOpConversion : public LLVMOpLowering { public: explicit ViewOpConversion(MLIRContext *context, LLVMTypeConverter &lowering_) @@ -482,7 +518,9 @@ public: matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const override { auto viewOp = cast(op); - auto viewDescriptorTy = convertLinalgType(viewOp.getViewType(), lowering); + ViewOpOperandAdaptor adaptor(operands); + auto viewDescriptorPtrTy = + convertLinalgType(viewOp.getViewType(), lowering); auto elementTy = getPtrToElementType(viewOp.getViewType(), lowering); auto int64Ty = lowering.convertType(rewriter.getIntegerType(64)); @@ -490,21 +528,34 @@ public: return positionAttr(rewriter, values); }; - // First operand to `view` is the buffer descriptor. - Value *bufferDescriptor = operands[0]; + Value *bufferDescriptor = adaptor.buffer(); + auto bufferTy = getPtrToElementType( + viewOp.buffer()->getType().cast(), lowering); // Declare the descriptor of the view. edsc::ScopedContext context(rewriter, op->getLoc()); - Value *desc = undef(viewDescriptorTy); + auto ip = rewriter.getInsertionPoint(); + auto ib = rewriter.getInsertionBlock(); + rewriter.setInsertionPointToStart( + &op->getParentOfType().getBlocks().front()); + Value *one = + constant(int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 1)); + // Alloca for proper alignment. + Value *allocatedDesc = + llvm_alloca(viewDescriptorPtrTy, one, /*alignment=*/8); + Value *desc = llvm_load(allocatedDesc); + rewriter.setInsertionPoint(ib, ip); // Copy the buffer pointer from the old descriptor to the new one. - Value *buffer = extractvalue(elementTy, bufferDescriptor, pos(0)); - desc = insertvalue(viewDescriptorTy, desc, buffer, pos(0)); + Value *bufferAsViewElementType = + bitcast(elementTy, + extractvalue(bufferTy, bufferDescriptor, pos(kPtrPosInBuffer))); + desc = insertvalue(desc, bufferAsViewElementType, pos(kPtrPosInView)); // Zero base offset. auto indexTy = rewriter.getIndexType(); Value *baseOffset = constant(int64Ty, IntegerAttr::get(indexTy, 0)); - desc = insertvalue(viewDescriptorTy, desc, baseOffset, pos(1)); + desc = insertvalue(desc, baseOffset, pos(kOffsetPosInView)); // Compute and insert view sizes (max - min along the range). int numRanges = llvm::size(viewOp.ranges()); @@ -514,18 +565,20 @@ public: Value *rangeDescriptor = operands[1 + i]; Value *step = extractvalue(int64Ty, rangeDescriptor, pos(2)); Value *stride = mul(runningStride, step); - desc = insertvalue(viewDescriptorTy, desc, stride, pos({3, i})); + desc = insertvalue(desc, stride, pos({kStridePosInView, i})); // Update size. Value *min = extractvalue(int64Ty, rangeDescriptor, pos(0)); Value *max = extractvalue(int64Ty, rangeDescriptor, pos(1)); Value *size = sub(max, min); - desc = insertvalue(viewDescriptorTy, desc, size, pos({2, i})); + desc = insertvalue(desc, size, pos({kSizePosInView, i})); // Update stride for the next dimension. if (i > 0) runningStride = mul(runningStride, max); } - rewriter.replaceOp(op, desc); + // Store back in alloca'ed region. + llvm_store(desc, allocatedDesc); + rewriter.replaceOp(op, allocatedDesc); return matchSuccess(); } }; @@ -585,32 +638,6 @@ getLLVMLibraryCallDeclaration(Operation *op, LLVMTypeConverter &lowering, return libFn; } -static void getLLVMLibraryCallDefinition(FuncOp fn, - LLVMTypeConverter &lowering) { - // Generate the implementation function definition. - auto implFn = getLLVMLibraryCallImplDefinition(fn); - - // Generate the function body. - OpBuilder builder(fn.addEntryBlock()); - edsc::ScopedContext scope(builder, fn.getLoc()); - SmallVector implFnArgs; - - // Create a constant 1. - auto one = constant(LLVMType::getInt64Ty(lowering.getDialect()), - IntegerAttr::get(IndexType::get(fn.getContext()), 1)); - for (auto arg : fn.getArguments()) { - // Allocate a stack for storing the argument value. The stack is passed to - // the implementation function. - auto alloca = - llvm_alloca(arg->getType().cast().getPointerTo(), one) - .getValue(); - implFnArgs.push_back(alloca); - llvm_store(arg, alloca); - } - llvm_call(ArrayRef(), builder.getSymbolRefAttr(implFn), implFnArgs); - llvm_return{ArrayRef()}; -} - namespace { // The conversion class from Linalg to LLVMIR. class LinalgTypeConverter : public LLVMTypeConverter { @@ -622,16 +649,6 @@ public: return result; return convertLinalgType(t, *this); } - - void addLibraryFnDeclaration(FuncOp fn) { libraryFnDeclarations.insert(fn); } - - ArrayRef getLibraryFnDeclarations() { - return libraryFnDeclarations.getArrayRef(); - } - -private: - /// List of library functions declarations needed during dialect conversion - llvm::SetVector libraryFnDeclarations; }; } // end anonymous namespace @@ -652,7 +669,6 @@ public: auto f = getLLVMLibraryCallDeclaration(op, lowering, rewriter); if (!f) return matchFailure(); - static_cast(lowering).addLibraryFnDeclaration(f); auto fAttr = rewriter.getSymbolRefAttr(f); auto named = rewriter.getNamedAttr("callee", fAttr); @@ -727,11 +743,6 @@ void LowerLinalgToLLVMPass::runOnModule() { if (failed(applyPartialConversion(module, target, patterns, &converter))) { signalPassFailure(); } - - // Emit the function body of any Library function that was declared. - for (auto fn : converter.getLibraryFnDeclarations()) { - getLLVMLibraryCallDefinition(fn, converter); - } } std::unique_ptr mlir::linalg::createLowerLinalgToLLVMPass() { diff --git a/mlir/test/Linalg/llvm.mlir b/mlir/test/Linalg/llvm.mlir index 9fa05af7561..0d691f8f7fa 100644 --- a/mlir/test/Linalg/llvm.mlir +++ b/mlir/test/Linalg/llvm.mlir @@ -6,9 +6,9 @@ func @buffer_size(%arg0: !linalg.buffer) { %t = addi %s, %c1 : index return } -// CHECK-LABEL: func @buffer_size(%{{.*}}: !llvm<"{ float*, i64 }">) { -// CHECK: %{{.*}} = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.add {{.*}}, {{.*}} : !llvm.i64 +// CHECK-LABEL: func @buffer_size +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, i64 }"> +// CHECK-NEXT: llvm.add {{.*}}, {{.*}} : !llvm.i64 func @range(%arg0: index) { %c0 = constant 0 : index @@ -17,106 +17,116 @@ func @range(%arg0: index) { return } // CHECK-LABEL: func @range(%{{.*}}: !llvm.i64) { -// CHECK: %{{.*}} = llvm.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.undef : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.constant(0 : index) : !llvm.i64 +// CHECK-NEXT: llvm.constant(1 : index) : !llvm.i64 +// CHECK-NEXT: llvm.undef : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> func @view(%arg0: !linalg.buffer, %arg1: !linalg.range) { %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> !linalg.view return } -// CHECK-LABEL: func @view(%{{.*}}: !llvm<"{ float*, i64 }">, %{{.*}}: !llvm<"{ i64, i64, i64 }">) { -// CHECK: %{{.*}} = llvm.undef : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.sub %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[2, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-LABEL: func @view +// CHECK-NEXT: llvm.constant(1 : index) : !llvm.i64 +// CHECK-NEXT: llvm.alloca {{.*}} x !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> {alignment = 8 : i64} : (!llvm.i64) -> !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// CHECK: llvm.load %{{.*}} : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, i64 }"> +// CHECK-NEXT: llvm.bitcast {{.*}} : !llvm<"float*"> to !llvm<"float*"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.constant(0 : index) : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.constant(1 : index) : !llvm.i64 +// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.sub %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// CHECK-NEXT: llvm.return func @view3d(%arg0: !linalg.buffer, %arg1: !linalg.range, %arg2: !linalg.range, %arg3: !linalg.range) { %0 = linalg.view %arg0[%arg1, %arg2, %arg3] : !linalg.buffer -> !linalg.view return } -// CHECK-LABEL: func @view3d(%{{.*}}: !llvm<"{ float*, i64 }">, %{{.*}}: !llvm<"{ i64, i64, i64 }">, %{{.*}}: !llvm<"{ i64, i64, i64 }">, %{{.*}}: !llvm<"{ i64, i64, i64 }">) { -// CHECK: %{{.*}} = llvm.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: %{{.*}} = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> +// CHECK-LABEL: func @view3d +// CHECK-NEXT: llvm.constant(1 : index) : !llvm.i64 +// CHECK-NEXT: llvm.alloca {{.*}} x !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> {alignment = 8 : i64} : (!llvm.i64) -> !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*"> +// CHECK-NEXT: llvm.load {{.*}} : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*"> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> func @slice(%arg0: !linalg.buffer, %arg1: !linalg.range) { %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> !linalg.view %1 = linalg.slice %0[%arg1] : !linalg.view, !linalg.range, !linalg.view return } -// CHECK-LABEL: func @slice(%{{.*}}: !llvm<"{ float*, i64 }">, %{{.*}}: !llvm<"{ i64, i64, i64 }">) { -// CHECK: %{{.*}} = llvm.undef : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK: %{{.*}} = llvm.undef : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.add %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: %{{.*}} = llvm.sub %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[2, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-LABEL: func @slice +// 1st load from view_op +// CHECK: llvm.load %{{.*}} : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// 2nd load from reloading the view descriptor pointer +// CHECK: llvm.load %{{.*}} : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// 3rd load from slice_op +// CHECK: llvm.load %{{.*}} : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.add %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.sub %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> func @dot(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { linalg.dot(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view return } -// CHECK-LABEL: func @dot(%{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) { -// CHECK: llvm.call @linalg_dot_viewxf32_viewxf32_viewf32(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) -> () +// CHECK-LABEL: func @dot(%{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, %{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, %{{.*}}: !llvm<"{ float*, i64, [0 x i64], [0 x i64] }*">) { +// CHECK: llvm.call @linalg_dot_viewxf32_viewxf32_viewf32(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64, [0 x i64], [0 x i64] }*">) -> () func @dim(%arg0: !linalg.view) { %0 = linalg.dim %arg0, 1 : !linalg.view return } -// CHECK-LABEL: func @dim(%{{.*}}: !llvm<"{ float*, i64, [2 x i64], [2 x i64] }">) { -// CHECK: %{{.*}} = llvm.extractvalue %{{.*}}[2, 1] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-LABEL: func @dim(%{{.*}}: !llvm<"{ float*, i64, [2 x i64], [2 x i64] }*">) { +// CHECK: llvm.extractvalue %{{.*}}[2, 1] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> func @subview(%arg0: !linalg.view) { %c0 = constant 0 : index %0 = linalg.subview %arg0[%c0, %c0, %c0, %c0, %c0, %c0] : !linalg.view return } -// CHECK-LABEL: func @subview(%{{.*}}: !llvm<"{ float*, i64, [2 x i64], [2 x i64] }">) { -// CHECK: %{{.*}} = llvm.constant(0 : index) : !llvm.i64 -// CHECK: %{{.*}} = llvm.extractvalue %{{.*}}[2, 0] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: %{{.*}} = llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 -// CHECK: %{{.*}} = llvm.undef : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.extractvalue %{{.*}}[2, 1] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: %{{.*}} = llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.i64 -// CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 -// CHECK: %{{.*}} = llvm.undef : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK: %{{.*}} = llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-LABEL: func @subview +// CHECK: llvm.constant(0 : index) : !llvm.i64 +// CHECK: llvm.extractvalue %{{.*}}[2, 0] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK: llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 +// CHECK: llvm.undef : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.extractvalue %{{.*}}[2, 1] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.i64 +// CHECK: llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 +// CHECK: llvm.undef : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> func @view_with_range_and_index(%arg0: !linalg.view) { %c0 = constant 0 : index @@ -128,9 +138,12 @@ func @view_with_range_and_index(%arg0: !linalg.view) { return } // CHECK-LABEL: func @view_with_range_and_index -// CHECK: llvm.undef : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}[0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> +// top of the function alloca + load. +// CHECK: llvm.alloca %{{.*}} x !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> {alignment = 8 : i64} : (!llvm.i64) -> !llvm<"{ double*, i64, [1 x i64], [1 x i64] }*"> +// CHECK: llvm.load %{{.*}} : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }*"> +// loop-body load from descriptor ptr. +// CHECK: llvm.load %{{.*}} : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }*"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[3, 1] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index 973c7f2437e..f5767114283 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -36,20 +36,18 @@ template struct ViewType { unsigned long offset; }; -extern "C" void linalg_fill_viewf32_f32_impl(ViewType *X, float *pF) { - *(X->data + X->offset) = *pF; +extern "C" void linalg_fill_viewf32_f32(ViewType *X, float f) { + *(X->data + X->offset) = f; } -extern "C" void linalg_fill_viewxf32_f32_impl(ViewType *X, - float *pF) { - float f = *pF; - for (unsigned i = 0; i < X->sizes[0]; ++i) { +extern "C" void linalg_fill_viewxf32_f32(ViewType *X, float f) { + for (unsigned i = 0; i < X->sizes[0]; ++i) *(X->data + X->offset + i * X->strides[0]) = f; - } } -extern "C" void linalg_dot_viewxf32_viewxf32_viewf32_impl( - ViewType *X, ViewType *Y, ViewType *Z) { +extern "C" void linalg_dot_viewxf32_viewxf32_viewf32(ViewType *X, + ViewType *Y, + ViewType *Z) { assert(X->strides[0] == 1); assert(Y->strides[0] == 1); assert(X->sizes[0] == Y->sizes[0] && "Expected X and Y of same size"); @@ -58,7 +56,7 @@ extern "C" void linalg_dot_viewxf32_viewxf32_viewf32_impl( Y->data + Y->offset, Y->strides[0]); } -extern "C" void linalg_matmul_viewxxf32_viewxxf32_viewxxf32_impl( +extern "C" void linalg_matmul_viewxxf32_viewxxf32_viewxxf32( ViewType *A, ViewType *B, ViewType *C) { assert(A->strides[1] == B->strides[1]); assert(A->strides[1] == C->strides[1]); -- cgit v1.2.3 From 7f42b3d72130c2ef70e254fc89cb4a297fbdab7a Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Fri, 23 Aug 2019 11:08:59 -0700 Subject: Add lowering of linalg.copy to an external C++ library and a test. This CL extends support for lowering of linalg to external C++ libraries with CopyOp. Currently this can only work when the permutation maps in the copies are identity. Future support for permutations will be added later. PiperOrigin-RevId: 265093025 --- .../Linalg/Transforms/LowerToLLVMDialect.cpp | 27 +++++++++++++------ mlir/test/Linalg/llvm.mlir | 7 +++++ mlir/test/mlir-cpu-runner/cblas_interface.cpp | 31 ++++++++++++++++++++++ .../mlir-cpu-runner/linalg_integration_test.mlir | 2 ++ 4 files changed, 59 insertions(+), 8 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp index b6e0430bee3..e4ce0cade41 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp @@ -670,11 +670,23 @@ public: PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const override { - // Only emit library call declaration. Fill in the body later. auto f = getLLVMLibraryCallDeclaration(op, lowering, rewriter); if (!f) return matchFailure(); + if (std::is_same::value) { + auto copyOp = cast(op); + + // Ensure permutations are identity. + // TODO(ntv): insert a transpose op that captures the permutations and + // remove this. + auto inputPerm = copyOp.inputPermutation(); + if (inputPerm.hasValue() && !inputPerm->isIdentity()) + return matchFailure(); + auto outputPerm = copyOp.outputPermutation(); + if (outputPerm.hasValue() && !outputPerm->isIdentity()) + return matchFailure(); + } auto fAttr = rewriter.getSymbolRefAttr(f); auto named = rewriter.getNamedAttr("callee", fAttr); rewriter.replaceOpWithNewOp(op, operands, @@ -688,13 +700,12 @@ static void populateLinalgToLLVMConversionPatterns(LinalgTypeConverter &converter, OwningRewritePatternList &patterns, MLIRContext *ctx) { - patterns - .insert, LinalgOpConversion, - LinalgOpConversion, LoadOpConversion, RangeOpConversion, - SliceOpConversion, StoreOpConversion, ViewOpConversion>( - ctx, converter); + patterns.insert, LinalgOpConversion, + LinalgOpConversion, LinalgOpConversion, + LoadOpConversion, RangeOpConversion, SliceOpConversion, + StoreOpConversion, ViewOpConversion>(ctx, converter); } namespace { diff --git a/mlir/test/Linalg/llvm.mlir b/mlir/test/Linalg/llvm.mlir index ea3d9d0ca8c..52461031fd4 100644 --- a/mlir/test/Linalg/llvm.mlir +++ b/mlir/test/Linalg/llvm.mlir @@ -191,3 +191,10 @@ func @view_with_range_and_index(%arg0: !linalg.view) { // CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> // CHECK: llvm.insertvalue %{{.*}}[2, 0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.insertvalue %{{.*}}[3, 0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> + +func @copy(%arg0: !linalg.view, %arg1: !linalg.view) { + linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view + return +} +// CHECK-LABEL: func @copy +// CHECK: llvm.call @linalg_copy_viewxxxf32_viewxxxf32(%{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">, !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">) -> () diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index f5767114283..514d5229d73 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -45,6 +45,37 @@ extern "C" void linalg_fill_viewxf32_f32(ViewType *X, float f) { *(X->data + X->offset + i * X->strides[0]) = f; } +extern "C" void linalg_fill_viewxxf32_f32(ViewType *X, float f) { + for (unsigned i = 0; i < X->sizes[0]; ++i) + for (unsigned j = 0; j < X->sizes[1]; ++j) + *(X->data + X->offset + i * X->strides[0] + j * X->strides[1]) = f; +} + +extern "C" void linalg_copy_viewf32_viewf32(ViewType *I, + ViewType *O) { + O->data[O->offset] = I->data[I->offset]; +} + +extern "C" void linalg_copy_viewxf32_viewxf32(ViewType *I, + ViewType *O) { + assert(I->sizes[0] == O->sizes[0]); + for (unsigned i = 0; i < I->sizes[0]; ++i) + O->data[O->offset + i * O->strides[0]] = + I->data[I->offset + i * I->strides[0]]; +} + +extern "C" void linalg_copy_viewxxf32_viewxxf32(ViewType *I, + ViewType *O) { + assert(I->sizes[0] == O->sizes[0]); + assert(I->sizes[1] == O->sizes[1]); + auto so0 = O->strides[0], so1 = O->strides[1]; + auto si0 = I->strides[0], si1 = I->strides[1]; + for (unsigned i = 0; i < I->sizes[0]; ++i) + for (unsigned j = 0; j < I->sizes[1]; ++j) + O->data[O->offset + i * so0 + j * so1] = + I->data[I->offset + i * si0 + j * si1]; +} + extern "C" void linalg_dot_viewxf32_viewxf32_viewf32(ViewType *X, ViewType *Y, ViewType *Z) { diff --git a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir index 7741ce9c092..9c5d9aa282d 100644 --- a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir +++ b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir @@ -2,6 +2,8 @@ // RUN: mlir-opt %s -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e dot -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s // RUN: mlir-opt %s -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s // RUN: mlir-opt %s -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s // Creates and returns a 1-D buffer of size %s filled with the value %f func @alloc_filled_f32(%s : index, %f : f32) -> !linalg.buffer { -- cgit v1.2.3 From e36337a998a6be39d65872eab3e3e2291b6518b9 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Tue, 1 Oct 2019 05:22:54 -0700 Subject: Unify Linalg types by using strided memrefs This CL finishes the implementation of the Linalg + Affine type unification of the [strided memref RFC](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio). As a consequence, the !linalg.view type, linalg::DimOp, linalg::LoadOp and linalg::StoreOp can now disappear and Linalg can use standard types everywhere. PiperOrigin-RevId: 272187165 --- mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td | 9 +- .../mlir/Dialect/Linalg/IR/LinalgLibraryOps.td | 106 ++++--- mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h | 9 +- mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td | 164 +++------- mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h | 47 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h | 32 +- .../include/mlir/Dialect/Linalg/Utils/Intrinsics.h | 6 - mlir/include/mlir/Dialect/Linalg/Utils/Utils.h | 4 +- mlir/include/mlir/IR/OpBase.td | 14 + mlir/include/mlir/IR/StandardTypes.h | 29 +- .../StandardToLLVM/ConvertStandardToLLVM.cpp | 70 ++--- .../Dialect/Linalg/Analysis/DependenceAnalysis.cpp | 2 +- mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | 305 ++++++------------- mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp | 93 +----- mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp | 8 +- .../Linalg/Transforms/LowerToLLVMDialect.cpp | 336 ++++++--------------- .../lib/Dialect/Linalg/Transforms/LowerToLoops.cpp | 40 +-- mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp | 23 +- mlir/lib/IR/StandardTypes.cpp | 115 +++++-- mlir/test/Dialect/Linalg/canonicalize.mlir | 73 ----- mlir/test/Dialect/Linalg/fusion-2-level.mlir | 37 ++- mlir/test/Dialect/Linalg/fusion.mlir | 235 +++++++------- mlir/test/Dialect/Linalg/invalid.mlir | 112 +++---- mlir/test/Dialect/Linalg/llvm.mlir | 60 ++-- mlir/test/Dialect/Linalg/loops.mlir | 257 ++++++++-------- mlir/test/Dialect/Linalg/promote.mlir | 46 +-- mlir/test/Dialect/Linalg/roundtrip.mlir | 152 +++++----- mlir/test/Dialect/Linalg/tile.mlir | 158 +++++----- mlir/test/Dialect/Linalg/tile_conv.mlir | 38 +-- .../lib/Transforms/TestMemRefStrideCalculation.cpp | 8 +- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 26 +- .../mlir-cpu-runner/linalg_integration_test.mlir | 39 +-- 32 files changed, 1107 insertions(+), 1546 deletions(-) delete mode 100644 mlir/test/Dialect/Linalg/canonicalize.mlir (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td index 5ca798ed431..1984056d88f 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td @@ -42,8 +42,9 @@ def Linalg_Dialect : Dialect { more generally at interface points across language boundaries (e.g. C++ / Python). - Generally, Linalg passes non-owning pointers to View data structures to - precompiled library calls linked externally. + Generally, Linalg passes non-owning pointers to strided memref data + structures to precompiled library calls linked externally. The name `view` + is used interchangeably in Linalg to signify strided memref. }]; } @@ -55,8 +56,4 @@ def Buffer : Type; def LinalgIsRangeTypePred : CPred<"$_self.isa()">; def Range : Type; -// Whether a type is a ViewType. -def LinalgIsViewTypePred : CPred<"$_self.isa()">; -def View : Type; - #endif // LINALG_BASE diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td index 67457b7b611..1e6384c66b9 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td @@ -59,20 +59,12 @@ class NLoopTypes : LinalgParametricIntNativeOpTrait<"NLoopTypes", [n_par, n_red, n_win]> {} -// The linalg `ViewRanks` trait the API for ops that are known to have a -// specified list of view ranks. -// See Linalg/LinalgTraits.h for implementation details an usage. -class ViewRanks ranks> : -LinalgParametricIntNativeOpTrait<"ViewRanks", ranks> -{} - def ViewTraits : NativeOpTrait<"linalg::ViewTraits">; // The linalg 'LinalgLibraryInterface' provides access to the 'LinalgOp' // interface. def LinalgLibraryInterface : OpInterface<"LinalgOp"> { let methods = [ - /// Query the number of inputs and outputs from the operation. InterfaceMethod< "Query the number of inputs from the current operation.", "unsigned", "getNumInputs" @@ -97,8 +89,6 @@ def LinalgLibraryInterface : OpInterface<"LinalgOp"> { "Query the input and output operands from the current operation.", "Operation::operand_range", "getInputsAndOutputs" >, - - /// Query the number of each type of loop. InterfaceMethod< "Query the number of parallel loops within the current operation.", "unsigned", "getNumParallelLoops" @@ -117,16 +107,12 @@ def LinalgLibraryInterface : OpInterface<"LinalgOp"> { return op.getNumParallelLoops() + op.getNumReductionLoops() + op.getNumWindowLoops(); }]>, - - /// Get a specific input/output at the given index. - InterfaceMethod<"Query the input for the given index.", + InterfaceMethod<"Query the input view at the given index.", "Value *", "getInput", (ins "unsigned":$i) >, - InterfaceMethod<"Query the output for the given index.", + InterfaceMethod<"Query the output view at the given index.", "Value *", "getOutput", (ins "unsigned":$i) >, - - /// Get the index of the given value, or None if the value is not an input. InterfaceMethod<[{ Query the index of the given input value, or `None` if the value is not an input. @@ -139,16 +125,13 @@ def LinalgLibraryInterface : OpInterface<"LinalgOp"> { }], "llvm::Optional", "getIndexOfOutput", (ins "Value *":$view) >, + InterfaceMethod<[{ + Query the type of the input view at the given index. + }], "MemRefType", "getInputViewType", (ins "unsigned":$i)>, + InterfaceMethod<[{ + Query the type of the output view at the given index. + }], "MemRefType", "getOutputViewType", (ins "unsigned":$i)>, - /// Get the view type of the input/output at the given index. - InterfaceMethod<"Query the view type for the given input.", - "ViewType", "getInputViewType", (ins "unsigned":$i) - >, - InterfaceMethod<"Query the view type for the given output.", - "ViewType", "getOutputViewType", (ins "unsigned":$i) - >, - - /// Create an operation with the given location and operands. StaticInterfaceMethod<[{ Create an operation of the current type with the given location, operands, and attributes. @@ -211,13 +194,14 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { Copies the data in the input view into the output view. Usage: - linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view + linalg.copy(%arg0, %arg1) : memref, + memref One possible lowering to loop form is: %0 = linalg.dim %arg0, 0 : index loop.for %i0 = %c0 to %0 step %c1 { - %1 = linalg.load %arg0[%i0] : !linalg.view - linalg.store %1, %arg1[%i0] : !linalg.view + %1 = linalg.load %arg0[%i0] : memref + linalg.store %1, %arg1[%i0] : memref } Optionally, can take `input_permutation` and `output_permutation` attributes @@ -226,7 +210,8 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { Usage: linalg.copy(%arg0, %arg1) {inputPermutation : (i, j, k) -> (i, k, j), outputPermutation : (i, j, k) -> (k, j, i)} : - !linalg.view, !linalg.view + memref, + memref One possible lowering to loop form is: %0 = linalg.dim %arg0, 0 @@ -235,15 +220,17 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { loop.for %i0 = %c0 to %{{.*}} step %c1 { loop.for %i1 = %c0 to %{{.*}} step %c1 { loop.for %i2 = %c0 to %{{.*}} step %c1 { - %3 = linalg.load %arg0[%i0, %i2, %i1] : !linalg.view - linalg.store %3, %arg1[%i2, %i1, %i0] : !linalg.view + %3 = linalg.load %arg0[%i0, %i2, %i1] : + memref + linalg.store %3, %arg1[%i2, %i1, %i0] : + memref The views are expected to be compatible for correctness but this is not enforced at the moment. }]; let arguments = (ins - View:$input, - View:$output, + AnyStridedMemRef:$input, + AnyStridedMemRef:$output, OptionalAttr:$inputPermutation, OptionalAttr:$outputPermutation); // TODO(ntv) this should go away once the usage of OptionalAttr triggers @@ -256,7 +243,7 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { let extraClassDeclaration = libraryCallName # [{ unsigned getNumParallelLoops() { auto *view = *(getOperands().begin()); - return view->getType().cast().getRank(); + return view->getType().cast().getRank(); } unsigned getNumReductionLoops() { return 0; } unsigned getNumWindowLoops() { return 0; } @@ -265,11 +252,12 @@ def CopyOp : LinalgLibrary_Op<"copy", [NInputsAndOutputs<1, 1>]> { } def FillOp : LinalgLibrary_Op<"fill", [NInputsAndOutputs<0, 1>]> { - let arguments = (ins View, AnyTypeOf<[AnyFloat, AnyInteger, AnyVector]>); + let arguments = (ins AnyStridedMemRef, + AnyTypeOf<[AnyFloat, AnyInteger, AnyVector]>); let extraClassDeclaration = libraryCallName # [{ unsigned getNumParallelLoops() { auto *view = *(getOperands().begin()); - return view->getType().cast().getRank(); + return view->getType().cast().getRank(); } unsigned getNumReductionLoops() { return 0; } unsigned getNumWindowLoops() { return 0; } @@ -282,25 +270,28 @@ def FillOp : LinalgLibrary_Op<"fill", [NInputsAndOutputs<0, 1>]> { def DotOp : LinalgLibrary_Op<"dot", [NInputsAndOutputs<2, 1>, - NLoopTypes<0, 1, 0>, - ViewRanks<[1, 1, 0]>]> { - let arguments = (ins View, View, View); + NLoopTypes<0, 1, 0>]> { + let arguments = (ins AnyStridedMemRefOfRank<1>, + AnyStridedMemRefOfRank<1>, + AnyStridedMemRefOfRank<0>); let extraClassDeclaration = libraryCallName; } def MatvecOp : LinalgLibrary_Op<"matvec", [NInputsAndOutputs<2, 1>, - NLoopTypes<1, 1, 0>, - ViewRanks<[2, 1, 1]>]> { - let arguments = (ins View, View, View); + NLoopTypes<1, 1, 0>]> { + let arguments = (ins AnyStridedMemRefOfRank<2>, + AnyStridedMemRefOfRank<1>, + AnyStridedMemRefOfRank<1>); let extraClassDeclaration = libraryCallName; } def MatmulOp : LinalgLibrary_Op<"matmul", [NInputsAndOutputs<2, 1>, - NLoopTypes<2, 1, 0>, - ViewRanks<[2, 2, 2]>]> { - let arguments = (ins View, View, View); + NLoopTypes<2, 1, 0>]> { + let arguments = (ins AnyStridedMemRefOfRank<2>, + AnyStridedMemRefOfRank<2>, + AnyStridedMemRefOfRank<2>); let extraClassDeclaration = libraryCallName; } @@ -323,7 +314,8 @@ def ConvOp : LinalgLibrary_Op<"conv", [NInputsAndOutputs<2, 1>]> { // TODO(ntv) padding. // Following the TF source of truth above, strides and dilations are integer // attributes of the same rank as the number of window dimensions. - let arguments = (ins View:$filter, View:$input, View:$output, + let arguments = (ins AnyStridedMemRef:$filter, AnyStridedMemRef:$input, + AnyStridedMemRef:$output, OptionalAttr:$strides, OptionalAttr:$dilations); let extraClassDeclaration = libraryCallName # [{ @@ -373,7 +365,9 @@ def GenericOp : LinalgLibraryBase_Op<"generic", []> { ``` linalg.generic #trait_attribute %A, %B, %C {other-attributes} : - !linalg.view, !linalg.view, !linalg.view + memref, + memref, + memref ``` Where #trait_attributes is an alias of a dictionary attribute containing: @@ -424,13 +418,17 @@ def GenericOp : LinalgLibraryBase_Op<"generic", []> { And can be reused in multiple places as: ``` linalg.generic #matmul_trait %A, %B, %C [other-attributes] : - !linalg.view, !linalg.view, !linalg.view + memref, + memref, + memref ``` This may lower to either: ``` call @linalg_matmul(%A, %B, %C) : - (!linalg.view, !linalg.view, !linalg.view) + (memref, + memref, + memref) -> () ``` @@ -439,17 +437,17 @@ def GenericOp : LinalgLibraryBase_Op<"generic", []> { loop.for %m = %c0 to %M step %c1 { loop.for %n = %c0 to %N step %c1 { loop.for %k = %c0 to %K step %c1 { - %a = linalg.load %A[%m, %k] : !linalg.view - %b = linalg.load %B[%k, %n] : !linalg.view - %c = linalg.load %C[%m, %n] : !linalg.view + %a = linalg.load %A[%m, %k] : memref + %b = linalg.load %B[%k, %n] : memref + %c = linalg.load %C[%m, %n] : memref %d = call @mac(%a, %b, %c) : (f32, f32, f32) -> (f32) - linalg.store %d, %C[%m, %n] : !linalg.view + linalg.store %d, %C[%m, %n] : memref } } } ``` }]; - let arguments = (ins Variadic:$views, + let arguments = (ins Variadic:$views, AffineMapArrayAttr:$indexing_maps, I64ArrayAttr:$n_loop_types, I64ArrayAttr:$n_views, diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h index f9bcf770252..b1dbdf3cb76 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h @@ -44,15 +44,18 @@ namespace linalg { /// /// Examples: /// -/// 1. linalg.fill(%A, %f) : !linalg.view, f32 +/// 1. linalg.fill(%A, %f) : memref, f32 /// name mangles into `linalg_fill_viewf32_f32_impl` /// /// 2. linalg.dot(%A, %B, %C) : -/// !linalg.view, !linalg.view, !linalg.view +/// memref, +/// memref, memref /// name mangles into `linalg_dot_viewxf32_viewxf32_viewf32_impl` /// /// 3. linalg.matmul(...) : -/// !linalg.view, !linalg.view, !linalg.view +/// memref, +/// memref, +/// memref /// name mangles into `linalg_matmul_viewxxf32_viewxxf32_viewxxf32_impl` std::string generateLibraryCallName(Operation *op); diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td index 15efbd64103..cf6f36c7098 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -142,76 +142,6 @@ def BufferSizeOp : let verifier = ?; } -def DimOp : Linalg_Op<"dim", [NoSideEffect]>, - Arguments<(ins View:$view, APIntAttr:$index)>, - Results<(outs Index)> { - let summary = "dimension index operation"; - let description = [{ - The "linalg.dim" operation takes a linalg.view and returns an - "index". It requires a single integer attribute named "index". It - returns the size of the specified dimension. - - Example: - - %1 = linalg.dim %0, 2 : view - }]; - - let verifier = [{ - if (getIndex() >= getViewType().getRank()) - return emitOpError("index is out of range"); - return success(); - }]; - - let builders = [OpBuilder< - "Builder *builder, OperationState &result, Value *view, unsigned index", - [{ - result.addOperands(view); - result.addAttribute( - "index", builder->getIntegerAttr(builder->getIndexType(), index)); - result.types.push_back(builder->getIndexType()); - }]>]; - - let extraClassDeclaration = [{ - unsigned getIndex() { - return getAttrOfType("index").getValue().getZExtValue(); - } - ViewType getViewType() { return getOperand()->getType().cast(); } - }]; - - let hasCanonicalizer = 1; -} - -def LoadOp : - Linalg_Op<"load" - // TODO(ntv): activate once ViewType can be made a ShapeType (i.e. - // shape type is extensible or standard adopts a reasonable view type). - // , [ PredOpTrait<"operand and result have same element type", - // TCresVTEtIsSameAsOpBase<0, 0>>] - >, - Arguments<(ins View:$view, Variadic:$indices)>, - Results<(outs AnyType:$value)> { - let summary = "Read an elemental value from a view at a certain index"; - let description = [{ - The `linalg.load` op reads an elemental value from a view at a certain - index. This is the counterpart of other load ops but operating on ViewType. - - Example: - - %0 = linalg.load %V[%c0] : !linalg.view - }]; - let builders = [OpBuilder< - "Builder *builder, OperationState &result, Value *view, " - "ArrayRef indices", - [{ - auto viewType = view->getType().cast(); - build(builder, result, viewType.getElementType(), view, indices); - }]>]; - let extraClassDeclaration = [{ - unsigned getRank() { return getViewType().getRank(); } - ViewType getViewType() { return view()->getType().cast(); } - }]; -} - def RangeOp : Linalg_Op<"range", [NoSideEffect]>, Arguments<(ins Index:$min, Index:$max, Index:$step)>, @@ -238,8 +168,8 @@ def RangeOp : } def SliceOp : Linalg_Op<"slice", [NoSideEffect]>, - Arguments<(ins View:$view, Variadic>:$indexings)>, - Results<(outs View)> { + Arguments<(ins AnyStridedMemRef:$view, Variadic>:$indexings)>, + Results<(outs AnyStridedMemRef)> { let summary = "Produce a linalg.view which is a subview of a base view."; let description = [{ The "linalg.slice" op produces a linalg.view which is a subview of a given @@ -259,18 +189,18 @@ def SliceOp : Linalg_Op<"slice", [NoSideEffect]>, 1. rank-preserving slice: - %4 = linalg.slice %0[%1, %2] : !linalg.view, !linalg.range, - !linalg.range, !linalg.view + %4 = linalg.slice %0[%1, %2] : memref, + !linalg.range, !linalg.range, memref 2. rank-reducing slice (from 2-D to 1-D): - %4 = linalg.slice %0[%1, %2] : !linalg.view, index, - !linalg.range, !linalg.view + %4 = linalg.slice %0[%1, %2] : memref, + index, !linalg.range, memref 3. rank-reducing slice (from 2-D to 0-D): - %4 = linalg.slice %0[%1, %2] : !linalg.view, index, index, - !linalg.view + %4 = linalg.slice %0[%1, %2] : memref, + index, index, memref }]; let builders = [OpBuilder< @@ -281,9 +211,9 @@ def SliceOp : Linalg_Op<"slice", [NoSideEffect]>, enum { FirstIndexingOperand = 1 }; unsigned getRank() { return getViewType().getRank(); } Type getElementType() { return getViewType().getElementType(); } - ViewType getViewType() { return getType().cast(); } + MemRefType getViewType() { return getType().cast(); } unsigned getBaseViewRank() { return getBaseViewType().getRank(); } - ViewType getBaseViewType() { return view()->getType().cast(); } + MemRefType getBaseViewType() { return view()->getType().cast(); } // Get the underlying indexing at a given rank. Value *indexing(unsigned rank) { return *(indexings().begin() + rank); } @@ -299,33 +229,9 @@ def SliceOp : Linalg_Op<"slice", [NoSideEffect]>, }]; } -def StoreOp : - Linalg_Op<"store" - // TODO(ntv): activate once ViewType can be made a ShapeType (i.e. - // shape type is extensible or standard adopts a reasonable view type). - // , [ PredOpTrait<"value to store and view have the same element type", - // TCopVTEtIsSameAs<0, 1>>] - >, - Arguments<(ins AnyType:$value, View:$view, Variadic:$indices)>, - Results<(outs)> { - let summary = "Write an elemental value in a view at a certain index"; - let description = [{ - The `linalg.store` op writes an elemental value in a view at a certain - index. This is the counterpart of other store ops but operating on ViewType. - - Example: - - linalg.store %f, %V[%c0] : !linalg.view - }]; - let extraClassDeclaration = [{ - unsigned getRank() { return getViewType().getRank(); } - ViewType getViewType() { return view()->getType().cast(); } - }]; -} - def SubViewOp : Linalg_Op<"subview", [NoSideEffect]>, - Arguments<(ins View:$view, Variadic:$ranges)>, - Results<(outs View)> { + Arguments<(ins AnyStridedMemRef:$view, Variadic:$ranges)>, + Results<(outs AnyStridedMemRef)> { let summary = "subview operation"; let description = [{ The "linalg.subview" op produces a linalg.view which is a subview of a given @@ -344,32 +250,30 @@ def SubViewOp : Linalg_Op<"subview", [NoSideEffect]>, Example: - %1 = linalg.subview %0[%1, %2, %3, %4, %5, %6] : view + %1 = linalg.subview %0[%1, %2, %3, %4, %5, %6] : + memref }]; // TODO(ntv) evolve syntax towards: - // linalg.subview %0[%1:%2:%3][%4:%5:%6] : view + // linalg.subview %0[%1:%2:%3][%4:%5:%6] : + // memref let builders = [OpBuilder< - "Builder *builder, OperationState &result, Value *view, " - "ArrayRef ranges", - [{ - result.addOperands(view); - result.addOperands(ranges); - result.types.push_back(view->getType()); - }]>]; + "Builder *b, OperationState &result, Value *buffer, " + "ArrayRef ranges, Type resultType = Type(), " + "ArrayRef attrs = {}">]; let verifier = [{ auto rank = getViewType().getRank(); if (getNumOperands() != 3 * rank + 1) - return emitOpError("expected a view followed by ") << (3 * rank) << - " indices specifying a range for each dimension"; + return emitOpError("expected a strided memref followed by ") << (3 * rank) + << " indices specifying a range for each dimension"; return success(); }]; let extraClassDeclaration = [{ Value *getView() { return getOperand(0); } - ViewType getViewType() { return getView()->getType().cast(); } + MemRefType getViewType() { return getView()->getType().cast(); } struct Range { Value *min; Value *max; Value *step; }; @@ -400,16 +304,17 @@ def SubViewOp : Linalg_Op<"subview", [NoSideEffect]>, } def TransposeOp : Linalg_Op<"transpose", [NoSideEffect]>, - Arguments<(ins View:$view, AffineMapAttr:$permutation)>, - Results<(outs View)> { - let summary = "transpose operation produces a new view (metadata-only)"; + Arguments<(ins AnyStridedMemRef:$view, AffineMapAttr:$permutation)>, + Results<(outs AnyStridedMemRef)> { + let summary = "transpose operation produces a new strided memref (metadata-only)"; let description = [{ - The "linalg.transpose" op produces a linalg.view whose sizes and strides are - a permutation of the original. This is a pure metadata transformation. + The "linalg.transpose" op produces a strided memref whose sizes and strides + are a permutation of the original. This is a pure metadata transformation. Example: - %1 = linalg.transpose %0 (i, j) -> (j, i) : !linalg.view + %1 = linalg.transpose %0 (i, j) -> (j, i) : + memref }]; let builders = [OpBuilder< @@ -426,16 +331,16 @@ def TransposeOp : Linalg_Op<"transpose", [NoSideEffect]>, let extraClassDeclaration = [{ static StringRef getPermutationAttrName() { return "permutation"; } - ViewType getViewType() { return view()->getType().cast(); } + MemRefType getViewType() { return view()->getType().cast(); } }]; } def ViewOp : Linalg_Op<"view", [NoSideEffect]>, Arguments<(ins Buffer:$buffer, Variadic:$ranges)>, - Results<(outs View)> { + Results<(outs AnyStridedMemRef)> { let summary = "view operation"; let description = [{ - The "linalg.view" op produces a linalg.view which is a multi-dimensional + The "linalg.view" op produces a strided memref which is a multi-dimensional range abstraction on top of an underlying linalg.buffer. This gives an indexing structure to an otherwise non-indexable linalg.buffer. @@ -447,7 +352,8 @@ def ViewOp : Linalg_Op<"view", [NoSideEffect]>, %1 = linalg.buffer_alloc %0 : !linalg.buffer %2 = linalg.range %arg2:%arg3:%arg4 : !linalg.range - %3 = linalg.view %1[%2, %2] : !linalg.view> + %3 = linalg.view %1[%2, %2] : + memref, stride_specification> }]; let builders = [OpBuilder< @@ -465,7 +371,7 @@ def ViewOp : Linalg_Op<"view", [NoSideEffect]>, enum { FirstIndexingOperand = 1 }; unsigned getRank() { return getViewType().getRank(); } Type getElementType() { return getViewType().getElementType(); } - ViewType getViewType() { return getType().cast(); } + MemRefType getViewType() { return getType().cast(); } /// Get the underlying indexing at a given rank. Value *getRange(unsigned rank) { assert(rank < getRank() && "rank overflow"); diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h index 593021db2f8..5456debdcd3 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h @@ -18,8 +18,9 @@ #ifndef MLIR_DIALECT_LINALG_LINALGTRAITS_H_ #define MLIR_DIALECT_LINALG_LINALGTRAITS_H_ -#include "mlir/IR/OpDefinition.h" #include "mlir/Dialect/Linalg/IR/LinalgTypes.h" +#include "mlir/IR/OpDefinition.h" +#include "mlir/IR/StandardTypes.h" #include "mlir/Support/LLVM.h" namespace mlir { @@ -81,8 +82,8 @@ public: return llvm::None; } /// Return the `i`-th input view type. - mlir::linalg::ViewType getInputViewType(unsigned i) { - return getInput(i)->getType().template cast(); + MemRefType getInputViewType(unsigned i) { + return getInput(i)->getType().template cast(); } /// Return the range over input views. Operation::operand_range getInputs() { @@ -102,8 +103,8 @@ public: return llvm::None; } /// Return the `i`-th output view type. - mlir::linalg::ViewType getOutputViewType(unsigned i) { - return getOutput(i)->getType().template cast(); + MemRefType getOutputViewType(unsigned i) { + return getOutput(i)->getType().template cast(); } /// Return the range over output views. Operation::operand_range getOutputs() { @@ -114,7 +115,7 @@ public: /// Return the number of input and output views. unsigned getNumInputsAndOutputs() { return nInputs() + nOutputs(); } /// Return the `i`-th view type. - mlir::linalg::ViewType getViewType(unsigned i) { + MemRefType getViewType(unsigned i) { return (i < nInputs()) ? getInputViewType(i) : getOutputViewType(i - nInputs()); } @@ -127,10 +128,6 @@ public: auto nViews = cast(op).getNumInputsAndOutputs(); if (failed(OpTrait::impl::verifyAtLeastNOperands(op, nViews))) return failure(); - for (unsigned i = 0, e = nViews; i < e; ++i) { - if (!op->getOperand(i)->getType().dyn_cast()) - return op->emitOpError("operand ") << i << " must have view type "; - } return success(); } }; @@ -156,36 +153,6 @@ public: }; }; -/// This class provides the API for ops that are known to have a specified -/// list of view ranks. This is used as a trait like this: -/// -/// class MatvecOp : public Op::Impl> { -/// -template class ViewRanks { -public: - template - class Impl - : public OpTrait::TraitBase::Impl> { - public: - static LogicalResult verifyTrait(Operation *op) { - if (op->getNumOperands() != sizeof...(Ranks)) - return op->emitError("expected ") << sizeof...(Ranks) << " operands"; - - unsigned ranks[]{Ranks...}; - for (unsigned i = 0, e = op->getNumOperands(); i < e; ++i) { - auto viewType = - op->getOperand(i)->getType().dyn_cast(); - if (!viewType) - return op->emitOpError("operand ") << i << " must have view type "; - if (ranks[i] != viewType.getRank()) - return op->emitOpError("operand ") - << i << " must have rank " << ranks[i]; - } - return success(); - } - }; -}; - } // namespace linalg } // namespace OpTrait } // namespace mlir diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h index 86b77f17868..18350736fc5 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h @@ -28,8 +28,7 @@ namespace linalg { enum LinalgTypes { Buffer = Type::FIRST_LINALG_TYPE, Range, - View, - LAST_USED_LINALG_TYPE = View, + LAST_USED_LINALG_TYPE = Range, }; class LinalgDialect : public Dialect { @@ -86,35 +85,6 @@ public: static bool kindof(unsigned kind) { return kind == LinalgTypes::Range; } }; -/// A ViewType represents a multi-dimensional range abstraction on top of an -/// underlying storage type. It is parameterizable by the underlying element -/// type and the rank of the view. -/// A new value of ViewType is constructed from a buffer with a view op and -/// passing it ranges: -/// -/// ```{.mlir} -/// %1 = linalg.buffer_alloc %0 : !linalg.buffer -/// %2 = linalg.range %arg2:%arg3:%arg4 : !linalg.range -/// %3 = linalg.view %1[%2, %2] : !linalg.view -/// ``` -struct ViewTypeStorage; -class ViewType : public Type::TypeBase { -public: - // Used for generic hooks in TypeBase. - using Base::Base; - /// Construction hook. - static ViewType get(MLIRContext *context, Type elementType, unsigned rank); - // Used to implement llvm-style cast. - static bool kindof(unsigned kind) { return kind == LinalgTypes::View; } - - // Type-specific functionality. - /// Return the underlying elemental type. - Type getElementType(); - /// Return the rank of the view. - /// This is the number of indexings needed to reach an underlying element. - unsigned getRank(); -}; - } // namespace linalg } // namespace mlir diff --git a/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h b/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h index 014fa728405..1c6bb68eb88 100644 --- a/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h +++ b/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h @@ -25,22 +25,16 @@ namespace linalg { class BufferAllocOp; class BufferDeallocOp; class CopyOp; -class DimOp; class FillOp; -class LoadOp; class RangeOp; class SliceOp; -class StoreOp; class ViewOp; namespace intrinsics { using buffer_alloc = mlir::edsc::intrinsics::ValueBuilder; using buffer_dealloc = mlir::edsc::intrinsics::OperationBuilder; using copy = mlir::edsc::intrinsics::OperationBuilder; -using dim = mlir::edsc::intrinsics::ValueBuilder; using fill = mlir::edsc::intrinsics::OperationBuilder; -using linalg_load = mlir::edsc::intrinsics::ValueBuilder; -using linalg_store = mlir::edsc::intrinsics::OperationBuilder; using range = mlir::edsc::intrinsics::ValueBuilder; using slice = mlir::edsc::intrinsics::ValueBuilder; using view = mlir::edsc::intrinsics::ValueBuilder; diff --git a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h index ff46f6a10ce..fce2f7383b0 100644 --- a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h +++ b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h @@ -84,9 +84,9 @@ template SmallVector getViewSizes(ConcreteOp linalgOp) { SmallVector res; for (auto v : linalgOp.getInputsAndOutputs()) { - ViewType t = v->getType().template cast(); + MemRefType t = v->getType().template cast(); for (unsigned i = 0; i < t.getRank(); ++i) - res.push_back(intrinsics::dim(v, i)); + res.push_back(edsc::intrinsics::dim(v, i)); } return res; } diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index c662576fdb2..4bb88a2192e 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -495,6 +495,20 @@ class StaticShapeMemRefOf allowedTypes> def AnyStaticShapeMemRef : StaticShapeMemRefOf<[AnyType]>; +// For a MemRefType, verify that it has strides. +def HasStridesPred : CPred<[{ isStrided($_self.cast()) }]>; + +class StridedMemRefOf allowedTypes> + : Type.predicate, HasStridesPred]>, + "strided " # MemRefOf.description>; + +def AnyStridedMemRef : StridedMemRefOf<[AnyType]>; + +class AnyStridedMemRefOfRank : + Type.predicate]>, + AnyStridedMemRef.description # " of rank " # rank>; + // This represents a generic tuple without any constraints on element type. def AnyTuple : Type; diff --git a/mlir/include/mlir/IR/StandardTypes.h b/mlir/include/mlir/IR/StandardTypes.h index 225b717bfd7..55aa4408af7 100644 --- a/mlir/include/mlir/IR/StandardTypes.h +++ b/mlir/include/mlir/IR/StandardTypes.h @@ -387,11 +387,11 @@ public: /// layout map, returns llvm::None. /// /// The convention is that the strides for dimensions d0, .. dn appear in - /// order followed by the constant offset, to make indexing intuitive into the - /// result. + /// order to make indexing intuitive into the result. static constexpr int64_t kDynamicStrideOrOffset = std::numeric_limits::min(); - LogicalResult getStridesAndOffset(SmallVectorImpl &strides) const; + LogicalResult getStridesAndOffset(SmallVectorImpl &strides, + int64_t &offset) const; static bool kindof(unsigned kind) { return kind == StandardTypes::MemRef; } @@ -491,6 +491,29 @@ public: static bool kindof(unsigned kind) { return kind == StandardTypes::None; } }; + +/// Given a list of strides (in which MemRefType::kDynamicStrideOrOffset +/// represents a dynamic value), return the single result AffineMap which +/// represents the linearized strided layout map. Dimensions correspond to the +/// offset followed by the strides in order. Symbols are inserted for each +/// dynamic dimension in order. A stride cannot take value `0`. +/// +/// Examples: +/// ========= +/// +/// 1. For offset: 0 strides: ?, ?, 1 return +/// (i, j, k)[M, N]->(M * i + N * j + k) +/// +/// 2. For offset: 3 strides: 32, ?, 16 return +/// (i, j, k)[M]->(3 + 32 * i + M * j + 16 * k) +/// +/// 3. For offset: ? strides: ?, ?, ? return +/// (i, j, k)[off, M, N, P]->(off + M * i + N * j + P * k) +AffineMap makeStridedLinearLayoutMap(ArrayRef strides, int64_t offset, + MLIRContext *context); + +bool isStrided(MemRefType t); + } // end namespace mlir #endif // MLIR_IR_STANDARDTYPES_H diff --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp index 663c30203cc..1539f02d0e6 100644 --- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp @@ -150,8 +150,9 @@ static unsigned kOffsetPosInMemRefDescriptor = 1; static unsigned kSizePosInMemRefDescriptor = 2; static unsigned kStridePosInMemRefDescriptor = 3; Type LLVMTypeConverter::convertMemRefType(MemRefType type) { + int64_t offset; SmallVector strides; - bool strideSuccess = succeeded(type.getStridesAndOffset(strides)); + bool strideSuccess = succeeded(type.getStridesAndOffset(strides, offset)); assert(strideSuccess && "Non-strided layout maps must have been normalized away"); (void)strideSuccess; @@ -568,15 +569,16 @@ struct AllocOpLowering : public LLVMLegalizationPattern { if (isSupportedMemRefType(type)) return matchSuccess(); - SmallVector stridesAndOffset; - auto successStrides = type.getStridesAndOffset(stridesAndOffset); + int64_t offset; + SmallVector strides; + auto successStrides = type.getStridesAndOffset(strides, offset); if (failed(successStrides)) return matchFailure(); // Dynamic strides are ok if they can be deduced from dynamic sizes (which // is guaranteed when succeeded(successStrides)). // Dynamic offset however can never be alloc'ed. - if (stridesAndOffset.back() != MemRefType::kDynamicStrideOrOffset) + if (offset != MemRefType::kDynamicStrideOrOffset) return matchFailure(); return matchSuccess(); @@ -648,15 +650,17 @@ struct AllocOpLowering : public LLVMLegalizationPattern { allocated = rewriter.create(op->getLoc(), elementPtrType, ArrayRef(allocated)); - SmallVector stridesAndOffset; - auto successStrides = type.getStridesAndOffset(stridesAndOffset); + int64_t offset; + SmallVector strides; + auto successStrides = type.getStridesAndOffset(strides, offset); assert(succeeded(successStrides) && "unexpected non-strided memref"); (void)successStrides; + assert(offset != MemRefType::kDynamicStrideOrOffset && + "unexpected dynamic offset"); - ArrayRef strides = ArrayRef(stridesAndOffset).drop_back(); // 0-D memref corner case: they have size 1 ... assert((type.getRank() == 0 && strides.empty() && sizes.size() == 1) || - (strides.size() == sizes.size()) && "unexpected number of stride"); + (strides.size() == sizes.size()) && "unexpected number of strides"); // Create the MemRef descriptor. auto structType = lowering.convertType(type); @@ -668,14 +672,15 @@ struct AllocOpLowering : public LLVMLegalizationPattern { rewriter.getIndexArrayAttr(kPtrPosInMemRefDescriptor)); memRefDescriptor = rewriter.create( op->getLoc(), structType, memRefDescriptor, - createIndexConstant(rewriter, op->getLoc(), stridesAndOffset.back()), + createIndexConstant(rewriter, op->getLoc(), offset), rewriter.getIndexArrayAttr(kOffsetPosInMemRefDescriptor)); if (type.getRank() == 0) - // No size/stride arrays in 0-D memref, use the descriptor value. + // No size/stride descriptor in memref, return the descriptor value. return rewriter.replaceOp(op, memRefDescriptor); - // Store all sizes in the descriptor. + // Store all sizes in the descriptor. Only dynamic sizes are passed in as + // operands to AllocOp. Value *runningStride = nullptr; // Iterate strides in reverse order, compute runningStride and strideValues. auto nStrides = strides.size(); @@ -874,29 +879,25 @@ struct MemRefCastOpLowering : public LLVMLegalizationPattern { struct DimOpLowering : public LLVMLegalizationPattern { using LLVMLegalizationPattern::LLVMLegalizationPattern; - PatternMatchResult match(Operation *op) const override { - auto dimOp = cast(op); - MemRefType type = dimOp.getOperand()->getType().cast(); - return isSupportedMemRefType(type) ? matchSuccess() : matchFailure(); - } - - void rewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { + PatternMatchResult + matchAndRewrite(Operation *op, ArrayRef operands, + ConversionPatternRewriter &rewriter) const override { auto dimOp = cast(op); OperandAdaptor transformed(operands); MemRefType type = dimOp.getOperand()->getType().cast(); auto shape = type.getShape(); int64_t index = dimOp.getIndex(); - // Extract dynamic size from the memref descriptor and define static size - // as a constant. + // Extract dynamic size from the memref descriptor. if (ShapedType::isDynamic(shape[index])) rewriter.replaceOpWithNewOp( op, getIndexType(), transformed.memrefOrTensor(), rewriter.getI64ArrayAttr({kSizePosInMemRefDescriptor, index})); else + // Use constant for static size. rewriter.replaceOp( op, createIndexConstant(rewriter, op->getLoc(), shape[index])); + return matchSuccess(); } }; @@ -945,19 +946,18 @@ struct LoadStoreOpLowering : public LLVMLegalizationPattern { Value *getStridedElementPtr(Location loc, Type elementTypePtr, Value *memRefDescriptor, ArrayRef indices, - ArrayRef stridesAndOffset, + ArrayRef strides, int64_t offset, ConversionPatternRewriter &rewriter) const { auto indexTy = this->getIndexType(); Value *base = rewriter.create( loc, elementTypePtr, memRefDescriptor, rewriter.getIndexArrayAttr(kPtrPosInMemRefDescriptor)); - Value *offset = - stridesAndOffset.back() == MemRefType::kDynamicStrideOrOffset + Value *offsetValue = + offset == MemRefType::kDynamicStrideOrOffset ? rewriter.create( loc, indexTy, memRefDescriptor, rewriter.getIndexArrayAttr(kOffsetPosInMemRefDescriptor)) - : this->createIndexConstant(rewriter, loc, stridesAndOffset.back()); - auto strides = stridesAndOffset.drop_back(); + : this->createIndexConstant(rewriter, loc, offset); for (int i = 0, e = indices.size(); i < e; ++i) { Value *stride; if (strides[i] != MemRefType::kDynamicStrideOrOffset) { @@ -973,9 +973,10 @@ struct LoadStoreOpLowering : public LLVMLegalizationPattern { } Value *additionalOffset = rewriter.create(loc, indices[i], stride); - offset = rewriter.create(loc, offset, additionalOffset); + offsetValue = + rewriter.create(loc, offsetValue, additionalOffset); } - return rewriter.create(loc, elementTypePtr, base, offset); + return rewriter.create(loc, elementTypePtr, base, offsetValue); } Value *getDataPtr(Location loc, MemRefType type, Value *memRefDesc, @@ -983,12 +984,13 @@ struct LoadStoreOpLowering : public LLVMLegalizationPattern { ConversionPatternRewriter &rewriter, llvm::Module &module) const { auto ptrType = getMemRefElementPtrType(type, this->lowering); - SmallVector stridesAndOffset; - auto res = type.getStridesAndOffset(stridesAndOffset); - assert(succeeded(res) && "expected strided MemRef"); - (void)res; - return getStridedElementPtr(loc, ptrType, memRefDesc, indices, - stridesAndOffset, rewriter); + int64_t offset; + SmallVector strides; + auto successStrides = type.getStridesAndOffset(strides, offset); + assert(succeeded(successStrides) && "unexpected non-strided memref"); + (void)successStrides; + return getStridedElementPtr(loc, ptrType, memRefDesc, indices, strides, + offset, rewriter); } }; diff --git a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp index ed904e0f950..8e304be1b5f 100644 --- a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp +++ b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp @@ -55,7 +55,7 @@ Value *Aliases::find(Value *v) { auto it = aliases.find(v); if (it != aliases.end()) { assert(((isa(it->getSecond()) && - it->getSecond()->getType().isa()) || + it->getSecond()->getType().isa()) || it->getSecond()->getType().isa()) && "Buffer or block argument expected"); return it->getSecond(); diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp index f3251fcff87..64a8013f186 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -45,80 +45,6 @@ using namespace mlir::edsc; using namespace mlir::edsc::intrinsics; using namespace mlir::linalg; -namespace { -/// Fold constant dimensions into an alloc operation. -struct SimplifyDimOp : public OpRewritePattern { - using OpRewritePattern::OpRewritePattern; - - PatternMatchResult matchAndRewrite(linalg::DimOp dimOp, - PatternRewriter &rewriter) const override; -}; -} // end namespace - -PatternMatchResult -SimplifyDimOp::matchAndRewrite(linalg::DimOp dimOp, - PatternRewriter &rewriter) const { - auto *viewProducingOp = dimOp.view()->getDefiningOp(); - auto subView = dyn_cast_or_null(viewProducingOp); - auto slice = dyn_cast_or_null(viewProducingOp); - auto view = dyn_cast_or_null(viewProducingOp); - assert(subView || slice || view); - - unsigned dim = dimOp.getIndex(); - Value *min, *max, *step; - if (view) { - // Cannot traverse block arguments, fail. - if (isa(view.getRange(dim))) - return matchFailure(); - // Record min, max, step for further processing. - auto range = cast(view.getRange(dim)->getDefiningOp()); - std::tie(min, max, step) = - std::make_tuple(range.min(), range.max(), range.step()); - } else if (subView) { - // Record min, max, step for further processing. - auto range = subView.getRange(dim); - std::tie(min, max, step) = - std::make_tuple(range.min, range.max, range.step); - } else { - // Taking the dim of a slice must take a range (since other dims have been - // rank-reduced). - auto *rangeValue = slice.getRanges()[dim]; - // Cannot traverse block arguments, fail. - if (isa(rangeValue)) - return matchFailure(); - auto range = cast(rangeValue->getDefiningOp()); - // Record min, max, step for further processing. - std::tie(min, max, step) = - std::make_tuple(range.min(), range.max(), range.step()); - } - - // Only support constant steps of 1 atm. - auto constant = dyn_cast_or_null(step->getDefiningOp()); - if (!constant || constant.getValue() != 1) - return matchFailure(); - - // Circumvent affine constraints: - // emit an affine_apply when possible, otherwise emit a `subi`. - bool validAffineMin = isValidDim(min) || isValidSymbol(min) || - isa_and_nonnull(min->getDefiningOp()); - bool validAffineMax = isValidDim(max) || isValidSymbol(max) || - isa_and_nonnull(max->getDefiningOp()); - - OpBuilder b(dimOp); - ScopedContext scope(b, dimOp.getLoc()); - // Emit `subi`. - if (!validAffineMin || !validAffineMax) { - rewriter.replaceOp(dimOp, {subi(max, min)}, {dimOp.view()}); - return matchSuccess(); - } - - // Emit affine_apply. - using edsc::op::operator-; - rewriter.replaceOp(dimOp, {ValueHandle(max) - ValueHandle(min)}, - {dimOp.view()}); - return matchSuccess(); -} - ///////////////////// Operations defined with Tablegen ///////////////////////// // For such operations that do not correspond to library calls (i.e. defined in // LinalgOps.td), we define an overloaded `print` function and a @@ -220,35 +146,6 @@ static ParseResult parseBufferSizeOp(OpAsmParser &parser, parser.addTypeToList(parser.getBuilder().getIndexType(), result.types)); } -//===----------------------------------------------------------------------===// -// DimOp -//===----------------------------------------------------------------------===// -void mlir::linalg::DimOp::getCanonicalizationPatterns( - OwningRewritePatternList &results, MLIRContext *context) { - results.insert(context); -} - -static void print(OpAsmPrinter &p, linalg::DimOp op) { - p << op.getOperationName() << " " << *op.getOperand() << ", " - << op.getIndex(); - p.printOptionalAttrDict(op.getAttrs(), /*elidedAttrs=*/{"index"}); - p << " : " << op.getOperand()->getType(); -} - -static ParseResult parseDimOp(OpAsmParser &parser, OperationState &result) { - OpAsmParser::OperandType operandInfo; - IntegerAttr indexAttr; - Type type; - Type indexType = parser.getBuilder().getIndexType(); - return failure( - parser.parseOperand(operandInfo) || parser.parseComma() || - parser.parseAttribute(indexAttr, indexType, "index", result.attributes) || - parser.parseOptionalAttributeDict(result.attributes) || - parser.parseColonType(type) || - parser.resolveOperand(operandInfo, type, result.operands) || - parser.addTypeToList(indexType, result.types)); -} - //===----------------------------------------------------------------------===// // GenericOp //===----------------------------------------------------------------------===// @@ -389,41 +286,6 @@ static LogicalResult verify(GenericOp op) { return success(); } -//===----------------------------------------------------------------------===// -// LoadOp -//===----------------------------------------------------------------------===// - -static void print(OpAsmPrinter &p, linalg::LoadOp op) { - p << op.getOperationName() << " " << *op.view() << '['; - p.printOperands(op.indices()); - p << ']'; - p.printOptionalAttrDict(op.getAttrs()); - p << " : " << op.getViewType(); -} - -static ParseResult parseLoadOp(OpAsmParser &parser, OperationState &result) { - OpAsmParser::OperandType viewInfo; - SmallVector indexInfo; - ViewType type; - - auto indexTy = parser.getBuilder().getIndexType(); - return failure( - parser.parseOperand(viewInfo) || - parser.parseOperandList(indexInfo, OpAsmParser::Delimiter::Square) || - parser.parseOptionalAttributeDict(result.attributes) || - parser.parseColonType(type) || - parser.resolveOperand(viewInfo, type, result.operands) || - parser.resolveOperands(indexInfo, indexTy, result.operands) || - parser.addTypeToList(type.getElementType(), result.types)); -} - -static LogicalResult verify(linalg::LoadOp op) { - if (op.getRank() != llvm::size(op.indices())) - return op.emitOpError("expected ") - << op.getRank() << " indices, got " << llvm::size(op.indices()); - return success(); -} - //===----------------------------------------------------------------------===// // RangeOp //===----------------------------------------------------------------------===// @@ -457,13 +319,21 @@ void mlir::linalg::SliceOp::build(Builder *b, OperationState &result, result.addOperands(base); result.addOperands(indexings); - ViewType viewType = base->getType().cast(); - unsigned rank = viewType.getRank(); - for (auto *i : indexings) - if (!i->getType().isa()) - rank--; - Type elementType = viewType.getElementType(); - result.addTypes({ViewType::get(b->getContext(), elementType, rank)}); + auto memRefType = base->getType().cast(); + int64_t offset; + SmallVector strides; + auto res = memRefType.getStridesAndOffset(strides, offset); + assert(succeeded(res) && strides.size() == indexings.size()); + (void)res; + + unsigned rank = memRefType.getRank(); + // TODO(ntv): propagate static size and stride information when available. + SmallVector sizes(rank, -1); // -1 encodes dynamic size. + Type elementType = memRefType.getElementType(); + result.addTypes({MemRefType::get( + sizes, elementType, + {makeStridedLinearLayoutMap(strides, offset, b->getContext())}, + memRefType.getMemorySpace())}); } static void print(OpAsmPrinter &p, SliceOp op) { @@ -518,50 +388,28 @@ static LogicalResult verify(SliceOp op) { return success(); } -//===----------------------------------------------------------------------===// -// StoreOp -//===----------------------------------------------------------------------===// - -static void print(OpAsmPrinter &p, linalg::StoreOp op) { - p << op.getOperationName() << " " << *op.value(); - p << ", " << *op.view() << '['; - p.printOperands(op.indices()); - p << ']'; - p.printOptionalAttrDict(op.getAttrs()); - p << " : " << op.getViewType(); -} - -static ParseResult parseStoreOp(OpAsmParser &parser, OperationState &result) { - OpAsmParser::OperandType storeValueInfo; - OpAsmParser::OperandType viewInfo; - SmallVector indexInfo; - ViewType viewType; - - auto indexTy = parser.getBuilder().getIndexType(); - return failure( - parser.parseOperand(storeValueInfo) || parser.parseComma() || - parser.parseOperand(viewInfo) || - parser.parseOperandList(indexInfo, OpAsmParser::Delimiter::Square) || - parser.parseOptionalAttributeDict(result.attributes) || - parser.parseColonType(viewType) || - parser.resolveOperand(storeValueInfo, viewType.getElementType(), - result.operands) || - parser.resolveOperand(viewInfo, viewType, result.operands) || - parser.resolveOperands(indexInfo, indexTy, result.operands)); -} - -static LogicalResult verify(linalg::StoreOp op) { - if (op.value()->getType() != op.getViewType().getElementType()) - return op.emitOpError("expected value type to match view element type"); - if (op.getRank() != llvm::size(op.indices())) - return op.emitOpError("expected ") - << op.getRank() << " indices, got " << llvm::size(op.indices()); - return success(); -} - //===----------------------------------------------------------------------===// // SubViewOp //===----------------------------------------------------------------------===// +void mlir::linalg::SubViewOp::build(Builder *b, OperationState &result, + Value *view, ArrayRef ranges, + Type resultType, + ArrayRef attrs) { + // If the result type is not specified, assume sizes are fully dynamic. + // Strides don't change though. + // TODO(ntv) for canonicalization it may be better to use a (min, size, step) + // instead of a (min, max, step) abstraction. + if (!resultType) { + auto rank = ranges.size(); + SmallVector sizes(rank, -1); + auto memRefType = view->getType().cast(); + Type elementType = memRefType.getElementType(); + resultType = MemRefType::get(sizes, elementType, memRefType.getAffineMaps(), + memRefType.getMemorySpace()); + } + build(b, result, resultType, view, ranges); + result.addAttributes(attrs); +} static void print(OpAsmPrinter &p, SubViewOp op) { p << op.getOperationName() << " " << *op.getOperand(0) << "["; @@ -576,7 +424,7 @@ static void print(OpAsmPrinter &p, SubViewOp op) { static ParseResult parseSubViewOp(OpAsmParser &parser, OperationState &result) { OpAsmParser::OperandType inputView, resultView; - Type viewType; + MemRefType memRefType; if (parser.parseOperand(inputView)) return failure(); @@ -587,13 +435,14 @@ static ParseResult parseSubViewOp(OpAsmParser &parser, OperationState &result) { // linalg.subview %0[%1:%2:%3][%4:%5:%6] if (parser.parseOperandList(ops, OpAsmParser::Delimiter::Square) || parser.parseOptionalAttributeDict(result.attributes) || - parser.parseColonType(viewType)) + parser.parseColonType(memRefType)) return failure(); auto indexTy = parser.getBuilder().getIndexType(); - return failure(parser.resolveOperand(inputView, viewType, result.operands) || - parser.resolveOperands(ops, indexTy, result.operands) || - parser.addTypeToList(viewType, result.types)); + return failure( + parser.resolveOperand(inputView, memRefType, result.operands) || + parser.resolveOperands(ops, indexTy, result.operands) || + parser.addTypeToList(memRefType, result.types)); } //===----------------------------------------------------------------------===// @@ -602,8 +451,31 @@ static ParseResult parseSubViewOp(OpAsmParser &parser, OperationState &result) { void mlir::linalg::TransposeOp::build(Builder *b, OperationState &result, Value *view, AffineMapAttr permutation, ArrayRef attrs) { - // TODO(ntv): once views have static dimensions, compute the permuted type. - build(b, result, view->getType(), view, attrs); + auto permutationMap = permutation.getValue(); + assert(permutationMap); + + auto memRefType = view->getType().cast(); + auto rank = memRefType.getRank(); + auto originalSizes = memRefType.getShape(); + // Compute permuted sizes. + SmallVector sizes(rank, 0); + for (auto en : llvm::enumerate(permutationMap.getResults())) + sizes[en.index()] = + originalSizes[en.value().cast().getPosition()]; + + // Compute permuted strides. + int64_t offset; + SmallVector strides; + auto res = memRefType.getStridesAndOffset(strides, offset); + assert(succeeded(res) && strides.size() == static_cast(rank)); + (void)res; + auto map = makeStridedLinearLayoutMap(strides, offset, b->getContext()); + map = permutationMap ? map.compose(permutationMap) : map; + // Compute result type. + auto resultType = MemRefType::get(sizes, memRefType.getElementType(), map, + memRefType.getMemorySpace()); + + build(b, result, resultType, view, attrs); result.addAttribute(TransposeOp::getPermutationAttrName(), permutation); } @@ -618,7 +490,7 @@ static ParseResult parseTransposeOp(OpAsmParser &parser, OperationState &result) { OpAsmParser::OperandType view; AffineMapAttr permutation; - Type type; + MemRefType type; return failure(parser.parseOperand(view) || parser.parseAttribute(permutation, TransposeOp::getPermutationAttrName(), @@ -636,9 +508,13 @@ void mlir::linalg::ViewOp::build(Builder *b, OperationState &result, Value *buffer, ArrayRef ranges, Type resultType, ArrayRef attrs) { + // If the result type is not specified, assume sizes are fully dynamic. + // Strides are set to match an empty layout map which means "contiguous view". if (!resultType) { + auto rank = ranges.size(); + SmallVector sizes(rank, -1); Type elementType = buffer->getType().cast().getElementType(); - resultType = ViewType::get(b->getContext(), elementType, ranges.size()); + resultType = MemRefType::get(sizes, elementType, {}, 0); } build(b, result, resultType, buffer, ranges); result.addAttributes(attrs); @@ -664,18 +540,18 @@ static ParseResult parseViewOp(OpAsmParser &parser, OperationState &result) { return failure(); } - ViewType viewType = vType.dyn_cast(); - if (!viewType) - return parser.emitError(parser.getNameLoc(), "expected view type"); - if (viewType.getRank() != rangesInfo.size()) + MemRefType memRefType = vType.dyn_cast(); + if (!memRefType) + return parser.emitError(parser.getNameLoc(), "expected memref type"); + if (static_cast(memRefType.getRank()) != rangesInfo.size()) return parser.emitError(parser.getNameLoc(), "expected ") - << viewType.getRank() << " ranges"; + << memRefType.getRank() << " ranges"; return failure( parser.resolveOperand(bufferInfo, bType, result.operands) || (!rangesInfo.empty() && parser.resolveOperands(rangesInfo, RangeType::get(vType.getContext()), result.operands)) || - parser.addTypeToList(viewType, result.types)); + parser.addTypeToList(memRefType, result.types)); } //===----------------------------------------------------------------------===// @@ -747,10 +623,12 @@ static LogicalResult verify(YieldOp op) { // // ``` // linalg.matmul(%0, %1, %2) : -// !linalg.view, !linalg.view, !linalg.view +// memref, +// memref, +// memref // ``` // -// Where %0, %1 and %2 are ssa-values of type ViewType. +// Where %0, %1 and %2 are ssa-values of type MemRefType with strides. static void printLinalgLibraryOp(OpAsmPrinter &p, Operation *op) { assert(op->getAbstractOperation() && "unregistered operation"); p << op->getName().getStringRef() << "("; @@ -829,14 +707,14 @@ verifyStrideOrDilation(ConvOp op, ArrayRef attrs, bool isStride) { } static LogicalResult verify(ConvOp op) { - auto oType = op.output()->getType().cast(); - auto fType = op.filter()->getType().cast(); - auto iType = op.input()->getType().cast(); + auto oType = op.output()->getType().cast(); + auto fType = op.filter()->getType().cast(); + auto iType = op.input()->getType().cast(); if (oType.getElementType() != iType.getElementType() || oType.getElementType() != fType.getElementType()) - return op.emitOpError("expects view elemental types to match"); + return op.emitOpError("expects memref elemental types to match"); if (oType.getRank() != iType.getRank() || oType.getRank() != fType.getRank()) - return op.emitOpError("expects view ranks to match"); + return op.emitOpError("expects memref ranks to match"); if (auto strides = op.strides()) { if (failed( verifyStrideOrDilation(op, strides->getValue(), /*isStride=*/true))) @@ -1000,11 +878,14 @@ SmallVector mlir::linalg::loopToOperandRangesMaps(Operation *op) { } static void appendMangledType(llvm::raw_string_ostream &ss, Type t) { - if (auto view = t.dyn_cast()) { + if (auto memref = t.dyn_cast()) { ss << "view"; - for (unsigned i = 0, e = view.getRank(); i < e; ++i) - ss << "x"; - appendMangledType(ss, view.getElementType()); + for (auto size : memref.getShape()) + if (size < 0) + ss << "sx"; + else + ss << size << "x"; + appendMangledType(ss, memref.getElementType()); } else if (auto vec = t.dyn_cast()) { ss << "vector"; interleave( diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp index 6fdd9adb1dd..c09b75e6deb 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp @@ -34,7 +34,7 @@ using namespace mlir::linalg; mlir::linalg::LinalgDialect::LinalgDialect(MLIRContext *context) : Dialect(getDialectNamespace(), context) { - addTypes(); + addTypes(); addOperations< #define GET_OP_LIST #include "mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc" @@ -142,76 +142,10 @@ Type mlir::linalg::LinalgDialect::parseType(StringRef spec, return (bufferSize == -1 ? BufferType::get(getContext(), t) : BufferType::get(getContext(), t, bufferSize)); } - } else if (spec.consume_front("view")) { - if (spec.consume_front("<") && spec.consume_back(">")) { - // Just count the number of ? to get the rank. - unsigned rank = 0; - for (unsigned i = 0, e = spec.size(); i < e; ++i) { - if (spec.consume_front("?")) { - ++rank; - if (!spec.consume_front("x")) { - emitError(loc, "expected a list of '?x' dimension specifiers: ") - << spec; - return Type(); - } - } - } - if (auto t = mlir::parseType(spec, context)) - return ViewType::get(context, t, rank); - } } return (emitError(loc, "unknown Linalg type: " + origSpec), Type()); } -struct mlir::linalg::ViewTypeStorage : public TypeStorage { - /// Underlying Key type to transport the payload needed to construct a custom - /// type in a generic way. - struct Key { - Key(Type elementType, unsigned rank) - : elementType(elementType), rank(rank) {} - Type elementType; - unsigned rank; - }; - /// `KeyTy` is a necessary typename hook for MLIR's custom type unique'ing. - using KeyTy = Key; - - /// Construction in the llvm::BumpPtrAllocator given a key. - static ViewTypeStorage *construct(TypeStorageAllocator &allocator, - const Key &key) { - return new (allocator.allocate()) ViewTypeStorage(key); - } - - /// Equality operator for hashing. - bool operator==(const Key &key) const { - return elementType == key.elementType && rank == key.rank; - } - - /// Hashing for unique'ing. - static unsigned hashKey(const Key &key) { - return llvm::hash_combine(key.elementType, key.rank); - } - - unsigned getRank() { return rank; }; - Type getElementType() { return elementType; }; - -private: - ViewTypeStorage(const Key &key) - : elementType(key.elementType), rank(key.rank) {} - - Type elementType; - unsigned rank; -}; - -ViewType mlir::linalg::ViewType::get(MLIRContext *context, Type elementType, - unsigned rank) { - return Base::get(context, LinalgTypes::View, elementType, rank); -} - -Type mlir::linalg::ViewType::getElementType() { - return getImpl()->getElementType(); -} - -unsigned mlir::linalg::ViewType::getRank() { return getImpl()->getRank(); } /// BufferType prints as "buffer". static void print(BufferType bt, raw_ostream &os) { @@ -228,28 +162,6 @@ static void print(BufferType bt, raw_ostream &os) { /// RangeType prints as just "range". static void print(RangeType rt, raw_ostream &os) { os << "range"; } -/// ViewType prints as: -/// -/// ```{.mlir} -/// view -/// ``` -/// -/// or -/// -/// ```{.mlir} -/// view -/// ``` -/// -/// for 0-D views (a.k.a pointer to a scalar value). -static void print(mlir::linalg::ViewType rt, raw_ostream &os) { - os << "view<"; - for (unsigned i = 0, e = rt.getRank(); i < e; ++i) { - os << "?x"; - } - os << rt.getElementType(); - os << ">"; -} - void mlir::linalg::LinalgDialect::printType(Type type, raw_ostream &os) const { switch (type.getKind()) { default: @@ -260,8 +172,5 @@ void mlir::linalg::LinalgDialect::printType(Type type, raw_ostream &os) const { case LinalgTypes::Range: print(type.cast(), os); break; - case LinalgTypes::View: - print(type.cast(), os); - break; } } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp index 42ff5ce9c5e..1f1f8acc960 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp @@ -186,10 +186,10 @@ static LinalgOp fuse(Value *producedView, LinalgOp producer, LinalgOp consumer, << "existing LoopRange: " << loopRanges[i] << "\n"); else { auto viewDim = getViewDefiningLoopRange(producer, i); - loopRanges[i] = SubViewOp::Range{ - state.create(b, loc, 0), - linalg::intrinsics::dim(viewDim.view, viewDim.dimension), - state.create(b, loc, 1)}; + loopRanges[i] = + SubViewOp::Range{state.create(b, loc, 0), + dim(viewDim.view, viewDim.dimension), + state.create(b, loc, 1)}; LLVM_DEBUG(llvm::dbgs() << "new LoopRange: " << loopRanges[i] << "\n"); } } diff --git a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp index 8a8e7473629..9e0a3ebf559 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp @@ -123,36 +123,6 @@ static Type convertLinalgType(Type t, LLVMTypeConverter &lowering) { if (t.isa()) return LLVMType::getStructTy(int64Ty, int64Ty, int64Ty); - // A linalg.view type converts to a view descriptor. The view descriptor - // contains the pointer to the data buffer, followed by a 64-bit integer - // containing the distance between the beginning of the buffer and the first - // element to be accessed through the view, followed by two arrays, each - // containing as many 64-bit integers as the rank of the View. The first array - // represents the size, in number of original elements, of the view along the - // given dimension. When taking the view, the size is the difference between - // the upper and the lower bound of the range. The second array represents the - // "stride" (in tensor abstraction sense), i.e. the number of consecutive - // elements of the underlying buffer that separate two consecutive elements - // addressable through the view along the given dimension. When taking the - // view, the strides are constructed as products of the original sizes along - // the trailing dimensions, multiplied by the view step. For example, a view - // of a MxN memref with ranges {0:M:1}, {0:N:1}, i.e. the view of a complete - // memref, will have strides N and 1. A view with ranges {0:M:2}, {0:N:3} - // will have strides 2*N and 3. - // - // template - // struct { - // Elem *ptr; - // int64_t offset; - // int64_t sizes[Rank]; - // int64_t strides[Rank]; - // }; - if (auto viewType = t.dyn_cast()) { - auto ptrTy = getPtrToElementType(viewType, lowering); - auto arrayTy = LLVMType::getArrayTy(int64Ty, viewType.getRank()); - return LLVMType::getStructTy(ptrTy, int64Ty, arrayTy, arrayTy); - } - return Type(); } @@ -171,24 +141,27 @@ namespace { /// 3. view descriptor construction `desc`. class BaseViewConversionHelper { public: - BaseViewConversionHelper(Operation *op, ViewType viewType, + BaseViewConversionHelper(Location loc, MemRefType memRefType, ConversionPatternRewriter &rewriter, LLVMTypeConverter &lowering) - : elementTy(getPtrToElementType(viewType, lowering)), + : zeroDMemRef(memRefType.getRank() == 0), + elementTy(getPtrToElementType(memRefType, lowering)), int64Ty( lowering.convertType(rewriter.getIntegerType(64)).cast()), - rewriter(rewriter) { - viewDescriptorTy = convertLinalgType(viewType, lowering).cast(); - desc = rewriter.create(op->getLoc(), viewDescriptorTy); + desc(nullptr), rewriter(rewriter) { + assert(isStrided(memRefType) && "expected strided memref type"); + viewDescriptorTy = lowering.convertType(memRefType).cast(); + desc = rewriter.create(loc, viewDescriptorTy); } ArrayAttr pos(ArrayRef values) const { return rewriter.getI64ArrayAttr(values); }; + bool zeroDMemRef; LLVMType elementTy, int64Ty, viewDescriptorTy; - ConversionPatternRewriter &rewriter; Value *desc; + ConversionPatternRewriter &rewriter; }; } // namespace @@ -325,83 +298,6 @@ public: } }; -// DimOp creates a new `index` value. -class DimOpConversion : public LLVMOpLowering { -public: - explicit DimOpConversion(MLIRContext *context, LLVMTypeConverter &lowering_) - : LLVMOpLowering(linalg::DimOp::getOperationName(), context, lowering_) {} - - PatternMatchResult - matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { - auto dimOp = cast(op); - auto indexTy = lowering.convertType(rewriter.getIndexType()); - edsc::ScopedContext context(rewriter, op->getLoc()); - auto pos = rewriter.getI64ArrayAttr( - {kSizePosInView, static_cast(dimOp.getIndex())}); - linalg::DimOpOperandAdaptor adaptor(operands); - Value *viewDescriptor = adaptor.view(); - rewriter.replaceOp(op, {extractvalue(indexTy, viewDescriptor, pos)}); - return matchSuccess(); - } -}; - -namespace { -// Common functionality for Linalg LoadOp and StoreOp conversion to the -// LLVM IR Dialect. -template class LoadStoreOpConversion : public LLVMOpLowering { -public: - explicit LoadStoreOpConversion(MLIRContext *context, - LLVMTypeConverter &lowering_) - : LLVMOpLowering(Op::getOperationName(), context, lowering_) {} - using Base = LoadStoreOpConversion; - - // Compute the pointer to an element of the buffer underlying the view given - // current view indices. Use the base offset and strides stored in the view - // descriptor to emit IR iteratively computing the actual offset, followed by - // a getelementptr. This must be called under an edsc::ScopedContext. - Value *obtainDataPtr(Operation *op, Value *viewDescriptor, - ArrayRef indices, - ConversionPatternRewriter &rewriter) const { - auto loadOp = cast(op); - auto elementTy = getPtrToElementType(loadOp.getViewType(), lowering); - auto int64Ty = lowering.convertType(rewriter.getIntegerType(64)); - auto pos = [&rewriter](ArrayRef values) { - return rewriter.getI64ArrayAttr(values); - }; - - // Linearize subscripts as: - // base_offset + SUM_i index_i * stride_i. - Value *base = extractvalue(elementTy, viewDescriptor, pos(kPtrPosInView)); - Value *offset = - extractvalue(int64Ty, viewDescriptor, pos(kOffsetPosInView)); - for (int i = 0, e = loadOp.getRank(); i < e; ++i) { - Value *stride = - extractvalue(int64Ty, viewDescriptor, pos({kStridePosInView, i})); - Value *additionalOffset = mul(indices[i], stride); - offset = add(offset, additionalOffset); - } - return gep(elementTy, base, offset); - } -}; -} // namespace - -// A load is converted into the actual address computation, getelementptr and -// an LLVM IR load. -class LoadOpConversion : public LoadStoreOpConversion { - using Base::Base; - PatternMatchResult - matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { - edsc::ScopedContext edscContext(rewriter, op->getLoc()); - auto elementTy = lowering.convertType(*op->result_type_begin()); - linalg::LoadOpOperandAdaptor adaptor(operands); - auto ptr = obtainDataPtr(op, adaptor.view(), adaptor.indices(), rewriter); - rewriter.replaceOp(op, {llvm_load(elementTy, ptr)}); - return matchSuccess(); - } -}; - // RangeOp creates a new range descriptor. class RangeOpConversion : public LLVMOpLowering { public: @@ -448,39 +344,45 @@ public: Value *baseDesc = adaptor.view(); auto sliceOp = cast(op); - BaseViewConversionHelper helper(op, sliceOp.getViewType(), rewriter, - lowering); + auto memRefType = sliceOp.getBaseViewType(); + + BaseViewConversionHelper helper(op->getLoc(), sliceOp.getViewType(), + rewriter, lowering); LLVMType elementTy = helper.elementTy, int64Ty = helper.int64Ty; Value *desc = helper.desc; - auto viewType = sliceOp.getBaseViewType(); - edsc::ScopedContext context(rewriter, op->getLoc()); - Value *zero = - constant(int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 0)); - - auto ptrPos = helper.pos(kPtrPosInView); - desc = insertvalue(desc, extractvalue(elementTy, baseDesc, ptrPos), ptrPos); // TODO(ntv): extract sizes and emit asserts. - SmallVector strides(viewType.getRank()); - for (int i = 0, e = viewType.getRank(); i < e; ++i) { + SmallVector strides(memRefType.getRank()); + for (int i = 0, e = memRefType.getRank(); i < e; ++i) strides[i] = extractvalue(int64Ty, baseDesc, helper.pos({kStridePosInView, i})); - } - // Compute and insert base offset. + // Compute base offset. Value *baseOffset = extractvalue(int64Ty, baseDesc, helper.pos(kOffsetPosInView)); - for (int i = 0, e = viewType.getRank(); i < e; ++i) { + for (int i = 0, e = memRefType.getRank(); i < e; ++i) { Value *indexing = adaptor.indexings()[i]; Value *min = indexing; if (sliceOp.indexing(i)->getType().isa()) min = extractvalue(int64Ty, indexing, helper.pos(0)); baseOffset = add(baseOffset, mul(min, strides[i])); } + + // Insert base pointer. + auto ptrPos = helper.pos(kPtrPosInView); + desc = insertvalue(desc, extractvalue(elementTy, baseDesc, ptrPos), ptrPos); + + // Insert base offset. desc = insertvalue(desc, baseOffset, helper.pos(kOffsetPosInView)); + // Corner case, no sizes or strides: early return the descriptor. + if (helper.zeroDMemRef) + return rewriter.replaceOp(op, desc), matchSuccess(); + + Value *zero = + constant(int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 0)); // Compute and insert view sizes (max - min along the range) and strides. // Skip the non-range operands as they will be projected away from the view. int numNewDims = 0; @@ -515,22 +417,6 @@ public: } }; -// A store is converted into the actual address computation, getelementptr and -// an LLVM IR store. -class StoreOpConversion : public LoadStoreOpConversion { - using Base::Base; - PatternMatchResult - matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { - edsc::ScopedContext edscContext(rewriter, op->getLoc()); - linalg::StoreOpOperandAdaptor adaptor(operands); - Value *ptr = obtainDataPtr(op, adaptor.view(), adaptor.indices(), rewriter); - llvm_store(adaptor.value(), ptr); - rewriter.replaceOp(op, llvm::None); - return matchSuccess(); - } -}; - /// Conversion pattern that transforms a linalg.transpose op into: /// 1. A function entry `alloca` operation to allocate a ViewDescriptor. /// 2. A load of the ViewDescriptor from the pointer allocated in 1. @@ -556,8 +442,8 @@ public: if (tranposeOp.permutation().isIdentity()) return rewriter.replaceOp(op, baseDesc), matchSuccess(); - BaseViewConversionHelper helper(op, tranposeOp.getViewType(), rewriter, - lowering); + BaseViewConversionHelper helper(op->getLoc(), tranposeOp.getViewType(), + rewriter, lowering); LLVMType elementTy = helper.elementTy, int64Ty = helper.int64Ty; Value *desc = helper.desc; @@ -606,8 +492,8 @@ public: ViewOpOperandAdaptor adaptor(operands); auto viewOp = cast(op); - BaseViewConversionHelper helper(op, viewOp.getViewType(), rewriter, - lowering); + BaseViewConversionHelper helper(op->getLoc(), viewOp.getViewType(), + rewriter, lowering); LLVMType elementTy = helper.elementTy, int64Ty = helper.int64Ty; Value *desc = helper.desc; @@ -629,6 +515,12 @@ public: Value *baseOffset = constant(int64Ty, IntegerAttr::get(indexTy, 0)); desc = insertvalue(desc, baseOffset, helper.pos(kOffsetPosInView)); + // Corner case, no sizes or stride: early return the descriptor. + if (helper.zeroDMemRef) { + rewriter.replaceOp(op, desc); + return matchSuccess(); + } + // Compute and insert view sizes (max - min along the range). int numRanges = llvm::size(viewOp.ranges()); Value *runningStride = constant(int64Ty, IntegerAttr::get(indexTy, 1)); @@ -653,60 +545,11 @@ public: } }; -// Promote LLVM struct types to pointer to struct types to avoid ABI issues -// related to C struct packing. -static SmallVector -promoteStructTypes(Operation::operand_range operands, - LLVMTypeConverter &lowering) { - SmallVector res; - for (auto operand : operands) { - auto type = lowering.convertType(operand->getType()).cast(); - if (type.isStructTy()) - res.push_back(type.getPointerTo()); - else - res.push_back(type); - } - return res; -} - -// Promote LLVM struct to pointer to struct to avoid ABI issues related to -// C struct packing. -static SmallVector -promoteStructs(Location loc, ArrayRef operands, - ConversionPatternRewriter &rewriter, - LLVMTypeConverter &lowering) { - auto *context = rewriter.getContext(); - auto int64Ty = LLVM::LLVMType::getInt64Ty(lowering.getDialect()); - auto indexType = IndexType::get(context); - edsc::ScopedContext scope(rewriter, loc); - SmallVector promotedOperands; - promotedOperands.reserve(operands.size()); - for (auto *operand : operands) { - auto type = operand->getType().cast(); - if (!type.isStructTy()) { - promotedOperands.push_back(operand); - continue; - } - // Alloca with proper alignment. This is purely for solving ABI issues - // related to C struct packing across external library call boundaries. We - // do not expect optimizations of this alloca op and so we omit - // allocating at the entry block. - auto ptrType = type.cast().getPointerTo(); - Value *one = constant(int64Ty, IntegerAttr::get(indexType, 1)); - Value *allocated = llvm_alloca(ptrType, one, /*alignment=*/8); - // Store into the alloca'ed descriptor. - llvm_store(operand, allocated); - promotedOperands.push_back(allocated); - } - return promotedOperands; -} - // Get function definition for the LinalgOp. If it doesn't exist, insert a // definition. template -static FuncOp -getLLVMLibraryCallDeclaration(Operation *op, LLVMTypeConverter &lowering, - ConversionPatternRewriter &rewriter) { +static FuncOp getLLVMLibraryCallDeclaration(Operation *op, + PatternRewriter &rewriter) { auto linalgOp = cast(op); auto fnName = linalgOp.getLibraryCallName(); if (fnName.empty()) { @@ -718,19 +561,19 @@ getLLVMLibraryCallDeclaration(Operation *op, LLVMTypeConverter &lowering, return f; } - // Get the Function type consistent with LLVM Lowering. - // Structs are automatically promoted to pointer to struct in order to avoid - // ABI issues related to C struct packing that we don't want to handle here. - auto inputTypes = promoteStructTypes(op->getOperands(), lowering); + SmallVector inputTypes(op->getOperandTypes()); assert(op->getNumResults() == 0 && "Library call for linalg operation can be generated only for ops that " "have void return types"); - auto libFnType = FunctionType::get(inputTypes, {}, op->getContext()); - auto libFn = FuncOp::create(op->getLoc(), fnName, libFnType); - module.push_back(libFn); - // Return after creating the function definition. The body will be created - // later. - return libFn; + auto libFnType = FunctionType::get(inputTypes, {}, rewriter.getContext()); + // fnName is a dynamic std::String, unique it via a SymbolRefAttr. + SymbolRefAttr fnNameAttr = rewriter.getSymbolRefAttr(fnName); + OpBuilder::InsertionGuard guard(rewriter); + // Insert before module terminator. + rewriter.setInsertionPoint(module.getBody(), + std::prev(module.getBody()->end())); + return rewriter.create(op->getLoc(), fnNameAttr.getValue(), libFnType, + ArrayRef{}); } namespace { @@ -751,56 +594,50 @@ public: // `LinalgOp::getLibraryCallName()` function. // The implementation of the function can be either in the same module or in an // externally linked library. -template class LinalgOpConversion : public LLVMOpLowering { +template +class LinalgOpConversion : public OpRewritePattern { public: - explicit LinalgOpConversion(MLIRContext *context, - LinalgTypeConverter &lowering_) - : LLVMOpLowering(LinalgOp::getOperationName(), context, lowering_) {} + using OpRewritePattern::OpRewritePattern; - PatternMatchResult - matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { - auto f = getLLVMLibraryCallDeclaration(op, lowering, rewriter); + PatternMatchResult matchAndRewrite(LinalgOp op, + PatternRewriter &rewriter) const override { + auto f = getLLVMLibraryCallDeclaration(op, rewriter); if (!f) - return matchFailure(); + return this->matchFailure(); auto fAttr = rewriter.getSymbolRefAttr(f); - auto named = rewriter.getNamedAttr("callee", fAttr); - rewriter.replaceOpWithNewOp( - op, promoteStructs(op->getLoc(), operands, rewriter, lowering), - ArrayRef{named}); - return matchSuccess(); + SmallVector operands(op.getOperands().begin(), + op.getOperands().end()); + rewriter.replaceOpWithNewOp(op, fAttr.getValue(), + ArrayRef{}, operands); + return this->matchSuccess(); } }; /// Conversion pattern specialization for CopyOp. This kicks in when both input /// and output permutations are left unspecified or are the identity. -template <> class LinalgOpConversion : public LLVMOpLowering { +template <> class LinalgOpConversion : public OpRewritePattern { public: - explicit LinalgOpConversion(MLIRContext *context, - LinalgTypeConverter &lowering_) - : LLVMOpLowering(CopyOp::getOperationName(), context, lowering_) {} + using OpRewritePattern::OpRewritePattern; - PatternMatchResult - matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { - auto copyOp = cast(op); - auto inputPerm = copyOp.inputPermutation(); + PatternMatchResult matchAndRewrite(CopyOp op, + PatternRewriter &rewriter) const override { + auto inputPerm = op.inputPermutation(); if (inputPerm.hasValue() && !inputPerm->isIdentity()) return matchFailure(); - auto outputPerm = copyOp.outputPermutation(); + auto outputPerm = op.outputPermutation(); if (outputPerm.hasValue() && !outputPerm->isIdentity()) return matchFailure(); - auto f = getLLVMLibraryCallDeclaration(op, lowering, rewriter); + auto f = getLLVMLibraryCallDeclaration(op, rewriter); if (!f) return matchFailure(); auto fAttr = rewriter.getSymbolRefAttr(f); - auto named = rewriter.getNamedAttr("callee", fAttr); - rewriter.replaceOpWithNewOp( - op, promoteStructs(op->getLoc(), operands, rewriter, lowering), - ArrayRef{named}); + SmallVector operands(op.getOperands().begin(), + op.getOperands().end()); + rewriter.replaceOpWithNewOp(op, fAttr.getValue(), + ArrayRef{}, operands); return matchSuccess(); } }; @@ -836,19 +673,23 @@ public: } }; +/// Populate the given list with patterns that convert from Linalg to Standard. +static void +populateLinalgToStandardConversionPatterns(OwningRewritePatternList &patterns, + MLIRContext *ctx) { + patterns.insert, + LinalgOpConversion, LinalgOpConversion, + LinalgOpConversion>(ctx); +} + /// Populate the given list with patterns that convert from Linalg to LLVM. static void populateLinalgToLLVMConversionPatterns(LinalgTypeConverter &converter, OwningRewritePatternList &patterns, MLIRContext *ctx) { - patterns.insert(ctx); patterns.insert, LinalgOpConversion, - LinalgOpConversion, LinalgOpConversion, - LoadOpConversion, RangeOpConversion, SliceOpConversion, - StoreOpConversion, TransposeOpConversion, ViewOpConversion>( - ctx, converter); + BufferSizeOpConversion, RangeOpConversion, SliceOpConversion, + TransposeOpConversion, ViewOpConversion>(ctx, converter); } namespace { @@ -885,15 +726,16 @@ void LowerLinalgToLLVMPass::runOnModule() { populateAffineToStdConversionPatterns(patterns, &getContext()); populateLoopToStdConversionPatterns(patterns, &getContext()); populateStdToLLVMConversionPatterns(converter, patterns); + populateLinalgToStandardConversionPatterns(patterns, &getContext()); populateLinalgToLLVMConversionPatterns(converter, patterns, &getContext()); ConversionTarget target(getContext()); target.addLegalDialect(); target.addDynamicallyLegalOp( [&](FuncOp op) { return converter.isSignatureLegal(op.getType()); }); - if (failed(applyPartialConversion(module, target, patterns, &converter))) { + target.addLegalOp(); + if (failed(applyFullConversion(module, target, patterns, &converter))) signalPassFailure(); - } } std::unique_ptr> @@ -902,5 +744,5 @@ mlir::linalg::createLowerLinalgToLLVMPass() { } static PassRegistration - pass("linalg-lower-to-llvm-dialect", + pass("linalg-convert-to-llvm", "Lower the operations from the linalg dialect into the LLVM dialect"); diff --git a/mlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp b/mlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp index 6c5777c05b9..7854df8d332 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp @@ -40,7 +40,7 @@ using namespace mlir::edsc::intrinsics; using namespace mlir::linalg; using namespace mlir::linalg::intrinsics; -using IndexedLinalgValue = TemplatedIndexedValue; +using IndexedLinalgValue = TemplatedIndexedValue; using edsc::op::operator+; using edsc::op::operator==; @@ -191,12 +191,12 @@ public: }; // Emits the MLIR for the scalar part of the generic op by: -// 1. Emitting linalg_load and linalg_store ops for each input and output +// 1. Emitting std_load and std_store ops for each input and output // view in order. This is achieved by applying the appropriate input or // output map to the enclosing induction variables. // 2. Emitting a call to `op.fun()` that takes as arguments the scalars // from point 1. above. -// 3. Emitting linalg_store to store the results of 2. to the output +// 3. Emitting std_store to store the results of 2. to the output // views. // // An example output may resemble: @@ -205,12 +205,17 @@ public: // loop.for %i = %c0 to %0 step %c1 { // loop.for %j = %c0 to %1 step %c1 { // loop.for %k = %c0 to %4 step %c1 { -// %11 = linalg.load %arg0[%i, %j] : !linalg.view -// %12 = linalg.load %arg1[%i, %j, %k] : !linalg.view -// %13 = linalg.load %arg2[%i, %k, %j] : !linalg.view +// %11 = linalg.load %arg0[%i, %j] : +// memref +// %12 = linalg.load %arg1[%i, %j, %k] : +// memref +// %13 = linalg.load %arg2[%i, %k, %j] : +// memref // %14:2 = call @foo(%11, %12, %13) : (f32, f32, f32) -> (f32, f32) -// linalg.store %14#0, %arg1[%i, %j, %k] : !linalg.view -// linalg.store %14#1, %arg2[%i, %k, %j] : !linalg.view +// linalg.store %14#0, %arg1[%i, %j, %k] : +// memref +// linalg.store %14#1, %arg2[%i, %k, %j] : +// memref // } // } // } @@ -227,19 +232,18 @@ public: unsigned nOutputs = genericOp.getNumOutputs(); SmallVector indexedValues(nInputs + nOutputs); - // 1.a. Emit linalg_load from input views. + // 1.a. Emit std_load from input views. for (unsigned i = 0, e = nInputs; i < e; ++i) { ValueHandleArray indexing(foldedAffineApplies( b, loc, genericOp.getInputIndexingMap(i), allIvs, folder)); - indexedValues[i] = linalg_load(genericOp.getInput(i), indexing); + indexedValues[i] = std_load(genericOp.getInput(i), indexing); } - // 1.b. Emit linalg_load from output views. + // 1.b. Emit std_load from output views. for (unsigned i = 0, e = nOutputs; i < e; ++i) { ValueHandleArray indexing(foldedAffineApplies( b, loc, genericOp.getOutputIndexingMap(i), allIvs, folder)); - indexedValues[nInputs + i] = - linalg_load(genericOp.getOutput(i), indexing); + indexedValues[nInputs + i] = std_load(genericOp.getOutput(i), indexing); } auto funcOp = genericOp.getFunction(); @@ -248,11 +252,11 @@ public: Operation *callOp = call(funcOp, indexedValues); assert(callOp->getNumResults() == genericOp.getNumOutputs()); - // 3. Emit linalg_store. + // 3. Emit std_store. for (unsigned i = 0, e = nOutputs; i < e; ++i) { ValueHandleArray indexing(foldedAffineApplies( b, loc, genericOp.getOutputIndexingMap(i), allIvs, folder)); - linalg_store(callOp->getResult(i), genericOp.getOutput(i), indexing); + std_store(callOp->getResult(i), genericOp.getOutput(i), indexing); } } else { // TODO(ntv): When a region inliner exists, use it. @@ -271,14 +275,14 @@ public: map.map(std::get<0>(it), std::get<1>(it)); } - // 3. Emit linalg_store. + // 3. Emit std_store. auto *yieldOp = cast(block.back()).getOperation(); assert(yieldOp->getNumOperands() == nOutputs); for (unsigned i = 0, e = nOutputs; i < e; ++i) { ValueHandleArray indexing(foldedAffineApplies( b, loc, genericOp.getOutputIndexingMap(i), allIvs, folder)); - linalg_store(map.lookup(yieldOp->getOperand(i)), genericOp.getOutput(i), - indexing); + std_store(map.lookup(yieldOp->getOperand(i)), genericOp.getOutput(i), + indexing); } } } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp index 929e26b746f..aca94775622 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -177,7 +177,7 @@ makeTiledViews(OpBuilder &b, Location loc, LinalgOp linalgOp, for (unsigned viewIndex = 0; viewIndex < linalgOp.getNumInputsAndOutputs(); ++viewIndex) { Value *view = *(viewIteratorBegin + viewIndex); - unsigned viewRank = view->getType().cast().getRank(); + unsigned rank = view->getType().cast().getRank(); auto map = loopToOperandRangesMaps(linalgOp)[viewIndex]; // If the view is not tiled, we can use it as is. if (!isTiled(map, tileSizes)) { @@ -187,12 +187,12 @@ makeTiledViews(OpBuilder &b, Location loc, LinalgOp linalgOp, // Construct a new subview for the tile. SmallVector subViewOperands; - subViewOperands.reserve(viewRank * 3); - for (unsigned r = 0; r < viewRank; ++r) { + subViewOperands.reserve(rank * 3); + for (unsigned r = 0; r < rank; ++r) { if (!isTiled(map.getSubMap({r}), tileSizes)) { - subViewOperands.push_back(SubViewOp::Range{ - constant_index(folder, 0), linalg::intrinsics::dim(view, r), - constant_index(folder, 1)}); + subViewOperands.push_back(SubViewOp::Range{constant_index(folder, 0), + dim(view, r), + constant_index(folder, 1)}); continue; } @@ -261,15 +261,14 @@ static PromotionInfo promoteFullTileBuffer(OpBuilder &b, Location loc, auto rank = en.index(); auto rangeValue = en.value(); Value *d = - isa(rangeValue.max->getDefiningOp()) + isa(rangeValue.max->getDefiningOp()) ? rangeValue.max : applyMapToValues(b, loc, getAffineDifferenceMap(b.getContext()), {rangeValue.max, rangeValue.min}, folder) .front(); allocSize = muli(folder, allocSize, d).getValue(); fullRanges.push_back(range(folder, zero, d, one)); - partialRanges.push_back( - range(folder, zero, linalg::intrinsics::dim(subView, rank), one)); + partialRanges.push_back(range(folder, zero, dim(subView, rank), one)); } auto *buffer = allocBuffer(viewType.getElementType(), allocSize); auto fullLocalView = view(buffer, fullRanges); @@ -293,13 +292,13 @@ static PromotionInfo promotePartialTileBuffer(OpBuilder &b, Location loc, auto zero = constant_index(folder, 0); auto one = constant_index(folder, 1); - auto viewType = v->getType().cast(); + auto viewType = v->getType().cast(); auto rank = viewType.getRank(); Value *allocSize = one; SmallVector partialRanges; partialRanges.reserve(rank); for (unsigned r = 0; r < rank; ++r) { - Value *d = linalg::intrinsics::dim(v, r); + Value *d = dim(v, r); allocSize = muli(folder, allocSize, d).getValue(); partialRanges.push_back(range(folder, zero, d, one)); } @@ -333,7 +332,7 @@ mlir::linalg::promoteLinalgViews(OpBuilder &b, Location loc, auto info = promotionInfo.find(v); if (info == promotionInfo.end()) continue; - auto viewType = v->getType().cast(); + auto viewType = v->getType().cast(); // TODO(ntv): value to fill with should be related to the operation. // For now, just use APFloat(0.0f). auto t = viewType.getElementType().cast(); diff --git a/mlir/lib/IR/StandardTypes.cpp b/mlir/lib/IR/StandardTypes.cpp index 6d445ccfbba..6ef18ce7716 100644 --- a/mlir/lib/IR/StandardTypes.cpp +++ b/mlir/lib/IR/StandardTypes.cpp @@ -452,14 +452,29 @@ static void accumulateStrides(MutableArrayRef strides, strides[pos] += val; } +// This sums multiple offsets as they are seen. In the particular case of +// accumulating a dynamic offset with either a static of dynamic one, this +// saturates to MemRefType::kDynamicStrideOrOffset. +static void accumulateOffset(int64_t &offset, bool &seenOffset, int64_t val) { + if (!seenOffset) { + // Newly seen case, sets value + offset = val; + seenOffset = true; + return; + } + if (offset != MemRefType::kDynamicStrideOrOffset) + // Already seen case accumulates unless they are already saturated. + offset += val; +} + /// Takes a single AffineExpr `e` and populates the `strides` and `seen` arrays /// with the strides values for each dim position and whether a value exists at /// that position, respectively. /// The convention is that the strides for dimensions d0, .. dn appear in -/// order followed by the constant offset, to make indexing intuitive into the -/// result. +/// order to make indexing intuitive into the result. static void extractStrides(AffineExpr e, MutableArrayRef strides, - MutableArrayRef seen, bool &failed) { + int64_t &offset, MutableArrayRef seen, + bool &seenOffset, bool &failed) { auto bin = e.dyn_cast(); if (!bin) return; @@ -485,11 +500,11 @@ static void extractStrides(AffineExpr e, MutableArrayRef strides, for (auto e : {bin.getLHS(), bin.getRHS()}) { if (auto cst = e.dyn_cast()) { // Independent constants cumulate. - accumulateStrides(strides, seen, seen.size() - 1, cst.getValue()); + accumulateOffset(offset, seenOffset, cst.getValue()); } else if (auto sym = e.dyn_cast()) { // Independent symbols saturate. - strides.back() = MemRefType::kDynamicStrideOrOffset; - seen.back() = true; + offset = MemRefType::kDynamicStrideOrOffset; + seenOffset = true; } else if (auto dim = e.dyn_cast()) { // Independent symbols cumulate 1. accumulateStrides(strides, seen, dim.getPosition(), 1); @@ -501,25 +516,27 @@ static void extractStrides(AffineExpr e, MutableArrayRef strides, llvm_unreachable("unexpected binary operation"); } -// Fallback cases for terminal dim/sym/cst that are not part of a binary op -// (i.e. single term). +// Fallback cases for terminal dim/sym/cst that are not part of a binary op ( +// i.e. single term). static void extractStridesFromTerm(AffineExpr e, MutableArrayRef strides, - MutableArrayRef seen) { + int64_t &offset, MutableArrayRef seen, + bool &seenOffset) { if (auto cst = e.dyn_cast()) { - assert(!seen.back() && "unexpected `seen` bit with single term"); - strides.back() = cst.getValue(); - seen.back() = true; + assert(!seenOffset && "unexpected `seen` bit with single term"); + offset = cst.getValue(); + seenOffset = true; return; } if (auto sym = e.dyn_cast()) { - assert(!seen.back() && "unexpected `seen` bit with single term"); - strides.back() = MemRefType::kDynamicStrideOrOffset; - seen.back() = true; + assert(!seenOffset && "unexpected `seen` bit with single term"); + offset = MemRefType::kDynamicStrideOrOffset; + seenOffset = true; return; } if (auto dim = e.dyn_cast()) { - assert(!seen.back() && "unexpected `seen` bit with single term"); + assert(!seen[dim.getPosition()] && + "unexpected `seen` bit with single term"); strides[dim.getPosition()] = 1; seen[dim.getPosition()] = true; return; @@ -527,8 +544,8 @@ static void extractStridesFromTerm(AffineExpr e, llvm_unreachable("unexpected binary operation"); } -LogicalResult -MemRefType::getStridesAndOffset(SmallVectorImpl &strides) const { +LogicalResult MemRefType::getStridesAndOffset(SmallVectorImpl &strides, + int64_t &offset) const { auto affineMaps = getAffineMaps(); // For now strides are only computed on a single affine map with a single // result (i.e. the closed subset of linearization maps that are compatible @@ -540,7 +557,7 @@ MemRefType::getStridesAndOffset(SmallVectorImpl &strides) const { if (affineMaps.empty() || affineMaps[0].isIdentity()) { if (getRank() == 0) { // Handle 0-D corner case. - strides.push_back(0); + offset = 0; return success(); } stridedExpr = makeCanonicalStridedLayoutExpr(getShape(), getContext()); @@ -551,27 +568,28 @@ MemRefType::getStridesAndOffset(SmallVectorImpl &strides) const { return failure(); bool failed = false; - strides = SmallVector(getRank() + 1, 0); - SmallVector seen(getRank() + 1, false); + strides = SmallVector(getRank(), 0); + bool seenOffset = false; + SmallVector seen(getRank(), false); if (stridedExpr.isa()) { stridedExpr.walk([&](AffineExpr e) { if (!failed) - extractStrides(e, strides, seen, failed); + extractStrides(e, strides, offset, seen, seenOffset, failed); }); } else { - extractStridesFromTerm(stridedExpr, strides, seen); + extractStridesFromTerm(stridedExpr, strides, offset, seen, seenOffset); } // Constant offset may not be present in `stridedExpr` which means it is // implicitly 0. - if (!seen.back()) { - seen.back() = true; - strides.back() = 0; - } + if (!seenOffset) + offset = 0; + if (failed || !llvm::all_of(seen, [](bool b) { return b; })) { strides.clear(); return failure(); } + return success(); } @@ -630,3 +648,46 @@ void TupleType::getFlattenedTypes(SmallVectorImpl &types) { /// Return the number of element types. size_t TupleType::size() const { return getImpl()->size(); } + +AffineMap mlir::makeStridedLinearLayoutMap(ArrayRef strides, + int64_t offset, + MLIRContext *context) { + AffineExpr expr; + unsigned nSymbols = 0; + + // AffineExpr for offset. + // Static case. + if (offset != MemRefType::kDynamicStrideOrOffset) { + auto cst = getAffineConstantExpr(offset, context); + expr = cst; + } else { + // Dynamic case, new symbol for the offset. + auto sym = getAffineSymbolExpr(nSymbols++, context); + expr = sym; + } + + // AffineExpr for strides. + for (auto en : llvm::enumerate(strides)) { + auto dim = en.index(); + auto stride = en.value(); + assert(stride != 0 && "Invalid stride specification"); + auto d = getAffineDimExpr(dim, context); + AffineExpr mult; + // Static case. + if (stride != MemRefType::kDynamicStrideOrOffset) + mult = getAffineConstantExpr(stride, context); + else + // Dynamic case, new symbol for each new stride. + mult = getAffineSymbolExpr(nSymbols++, context); + expr = expr + d * mult; + } + + return AffineMap::get(strides.size(), nSymbols, expr); +} + +bool mlir::isStrided(MemRefType t) { + int64_t offset; + SmallVector stridesAndOffset; + auto res = t.getStridesAndOffset(stridesAndOffset, offset); + return succeeded(res); +} diff --git a/mlir/test/Dialect/Linalg/canonicalize.mlir b/mlir/test/Dialect/Linalg/canonicalize.mlir deleted file mode 100644 index 65e1d544131..00000000000 --- a/mlir/test/Dialect/Linalg/canonicalize.mlir +++ /dev/null @@ -1,73 +0,0 @@ -// RUN: mlir-opt %s -canonicalize | FileCheck %s - -// CHECK-DAG: #[[SUB:.*]] = ()[s0, s1] -> (s0 - s1) - -func @fold_constants(%arg0: !linalg.buffer) -> (index, index, index, index, index) { - %c0 = constant 0 : index - %c1 = constant 1 : index - %c2 = constant 2 : index - %c3 = constant 3 : index - %c4 = constant 4 : index - %c5 = constant 5 : index - %R02 = linalg.range %c0:%c2:%c1 : !linalg.range - %R03 = linalg.range %c0:%c3:%c1 : !linalg.range - %R04 = linalg.range %c0:%c4:%c1 : !linalg.range - %R12 = linalg.range %c1:%c2:%c1 : !linalg.range - %R13 = linalg.range %c1:%c3:%c1 : !linalg.range - %R14 = linalg.range %c1:%c4:%c1 : !linalg.range - - %v = linalg.view %arg0[%R02, %R14] : !linalg.buffer -> !linalg.view - // Expected 2. - %v0 = linalg.dim %v, 0 : !linalg.view - // Expected 3. - %v1 = linalg.dim %v, 1 : !linalg.view - - %s = linalg.slice %v[%c1, %R12] : !linalg.view, index, !linalg.range, !linalg.view - // Expected 1. - %s0 = linalg.dim %s, 0 : !linalg.view - - %sv = linalg.subview %v[%v0, %v1, %c1, %c2, %c4, %c1] : !linalg.view - // Expected 1. - %sv0 = linalg.dim %sv, 0 : !linalg.view - // Expected 2. - %sv1 = linalg.dim %sv, 1 : !linalg.view - - return %v0, %v1, %s0, %sv0, %sv1 : index, index, index, index, index -} - -// CHECK-LABEL: fold_constants -// CHECK-DAG: %[[c1:.*]] = constant 1 : index -// CHECK-DAG: %[[c2:.*]] = constant 2 : index -// CHECK-DAG: %[[c3:.*]] = constant 3 : index -// CHECK: return %[[c2]], %[[c3]], %[[c1]], %[[c1]], %[[c2]] - - -func @fold_indices(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: index) -> (index, index, index, index) { - %c0 = constant 0 : index - %c1 = constant 1 : index - %R = linalg.range %arg1:%arg3:%c1 : !linalg.range - - %v = linalg.view %arg0[%R, %R] : !linalg.buffer -> !linalg.view - // Expected %arg3 - %arg1. - %v0 = linalg.dim %v, 0 : !linalg.view - // Expected %arg3 - %arg1. - %v1 = linalg.dim %v, 1 : !linalg.view - - %arg1_p_arg2 = addi %arg1, %arg2: index - %arg1_p_arg2_affine = affine.apply (i, j) -> (i + j) (%arg1, %arg2) - %sv = linalg.subview %v[%arg1, %arg1_p_arg2, %c1, %arg1, %arg1_p_arg2_affine, %c1] : !linalg.view - // Expected %arg2 but can't fold affine.apply with addi. - %sv0 = linalg.dim %sv, 0 : !linalg.view - // Expected %arg2. - %sv1 = linalg.dim %sv, 1 : !linalg.view - - return %v0, %v1, %sv0, %sv1 : index, index, index, index -} - -// CHECK-LABEL: fold_indices -// CHECK: (%[[arg0:.*]]: !linalg.buffer, %[[arg1:.*]]: index, %[[arg2:.*]]: index, %[[arg3:.*]]: index -// CHECK: %[[r0:.*]] = affine.apply #[[SUB]]()[%[[arg3]], %[[arg1]]] -// CHECK: %[[r1:.*]] = affine.apply #[[SUB]]()[%[[arg3]], %[[arg1]]] -// CHECK: %[[add:.*]] = addi %[[arg1]], %[[arg2]] : index -// CHECK: %[[aff:.*]] = affine.apply #[[SUB]]()[%[[add]], %[[arg1]]] -// CHECK: return %[[r0]], %[[r1]], %[[aff]], %[[arg2]] \ No newline at end of file diff --git a/mlir/test/Dialect/Linalg/fusion-2-level.mlir b/mlir/test/Dialect/Linalg/fusion-2-level.mlir index 1ef4a0b7659..632ba343cd1 100644 --- a/mlir/test/Dialect/Linalg/fusion-2-level.mlir +++ b/mlir/test/Dialect/Linalg/fusion-2-level.mlir @@ -1,11 +1,16 @@ // RUN: mlir-opt %s -linalg-fusion | FileCheck %s + #map0 = (d0) -> (d0 + 20) #map1 = (d0) -> (d0 + 40) #map2 = (d0) -> (d0 + 30) #map3 = (d0) -> (d0 + 2) #map4 = (d0) -> (d0 + 4) #map5 = (d0) -> (d0 + 3) -func @f1(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { + +// CHECK-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) + +func @f1(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index @@ -14,39 +19,39 @@ func @f1(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< %c40 = constant 40 : index %c30 = constant 30 : index %c20 = constant 20 : index - %0 = linalg.dim %C, 0 : !linalg.view - %1 = linalg.dim %C, 1 : !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view + %0 = dim %C, 0 : memref + %1 = dim %C, 1 : memref + %2 = dim %D, 1 : memref + linalg.matmul(%A, %B, %C) : memref, memref, memref loop.for %arg5 = %c0 to %0 step %c20 { loop.for %arg6 = %c0 to %2 step %c30 { loop.for %arg7 = %c0 to %1 step %c40 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - %9 = linalg.dim %5, 0 : !linalg.view - %10 = linalg.dim %5, 1 : !linalg.view - %11 = linalg.dim %7, 1 : !linalg.view + %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + %9 = dim %5, 0 : memref + %10 = dim %5, 1 : memref + %11 = dim %7, 1 : memref loop.for %arg8 = %c0 to %9 step %c2 { loop.for %arg9 = %c0 to %11 step %c3 { loop.for %B0 = %c0 to %10 step %c4 { %12 = affine.apply #map3(%arg8) %13 = affine.apply #map4(%B0) - %14 = linalg.subview %5[%arg8, %12, %c1, %B0, %13, %c1] : !linalg.view + %14 = linalg.subview %5[%arg8, %12, %c1, %B0, %13, %c1] : memref %15 = affine.apply #map5(%arg9) - %16 = linalg.subview %7[%B0, %13, %c1, %arg9, %15, %c1] : !linalg.view - %17 = linalg.subview %8[%arg8, %12, %c1, %arg9, %15, %c1] : !linalg.view - linalg.matmul(%14, %16, %17) : !linalg.view, !linalg.view, !linalg.view + %16 = linalg.subview %7[%B0, %13, %c1, %arg9, %15, %c1] : memref + %17 = linalg.subview %8[%arg8, %12, %c1, %arg9, %15, %c1] : memref + linalg.matmul(%14, %16, %17) : memref, memref, memref } } } } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f1 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) diff --git a/mlir/test/Dialect/Linalg/fusion.mlir b/mlir/test/Dialect/Linalg/fusion.mlir index 65e8c72fb6c..d75ae64b19f 100644 --- a/mlir/test/Dialect/Linalg/fusion.mlir +++ b/mlir/test/Dialect/Linalg/fusion.mlir @@ -4,30 +4,33 @@ #map1 = (d0) -> (d0 + 4) #map2 = (d0) -> (d0 + 3) -func @f1(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +// CHECK-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) + +func @f1(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - %0 = linalg.dim %A, 0 : !linalg.view - %1 = linalg.dim %A, 1 : !linalg.view - %2 = linalg.dim %B, 1 : !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view + %0 = dim %A, 0 : memref + %1 = dim %A, 1 : memref + %2 = dim %B, 1 : memref + linalg.matmul(%A, %B, %C) : memref, memref, memref %c1 = constant 1 : index loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %A[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %A[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %B[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %C[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %B[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %C[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f1 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) @@ -38,109 +41,109 @@ func @f1(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< // CHECK: loop.for // CHECK: linalg.matmul -func @f2(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f2(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - %0 = linalg.dim %C, 0 : !linalg.view - %1 = linalg.dim %C, 1 : !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view + linalg.matmul(%A, %B, %C) : memref, memref, memref + %0 = dim %C, 0 : memref + %1 = dim %C, 1 : memref + %2 = dim %D, 1 : memref loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f2 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) -// CHECK-DAG: %[[C_0:.*]] = linalg.dim %[[C]], 0 : !linalg.view -// CHECK-DAG: %[[C_1:.*]] = linalg.dim %[[C]], 1 : !linalg.view -// CHECK-DAG: %[[D_1:.*]] = linalg.dim %[[D]], 1 : !linalg.view +// CHECK-DAG: %[[C_0:.*]] = dim %[[C]], 0 : memref +// CHECK-DAG: %[[C_1:.*]] = dim %[[C]], 1 : memref +// CHECK-DAG: %[[D_1:.*]] = dim %[[D]], 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[D_1]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_1]] step %{{.*}} { // CHECK: linalg.matmul // CHECK: linalg.matmul -func @f3(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f3(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - %0 = linalg.dim %D, 0 : !linalg.view - %1 = linalg.dim %D, 1 : !linalg.view - %2 = linalg.dim %C, 1 : !linalg.view + linalg.matmul(%A, %B, %C) : memref, memref, memref + %0 = dim %D, 0 : memref + %1 = dim %D, 1 : memref + %2 = dim %C, 1 : memref loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %D[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %D[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %C[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %C[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f3 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) -// CHECK: %[[D_0:.*]] = linalg.dim %[[D]], 0 : !linalg.view -// CHECK: %[[D_1:.*]] = linalg.dim %[[D]], 1 : !linalg.view -// CHECK: %[[C_1:.*]] = linalg.dim %[[C]], 1 : !linalg.view +// CHECK: %[[D_0:.*]] = dim %[[D]], 0 : memref +// CHECK: %[[D_1:.*]] = dim %[[D]], 1 : memref +// CHECK: %[[C_1:.*]] = dim %[[C]], 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[D_0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_1]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[D_1]] step %{{.*}} { // CHECK: linalg.matmul // CHECK: linalg.matmul -func @f4(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f4(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - linalg.matmul(%A, %B, %D) : !linalg.view, !linalg.view, !linalg.view - %0 = linalg.dim %C, 0 : !linalg.view - %1 = linalg.dim %C, 1 : !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view + linalg.matmul(%A, %B, %C) : memref, memref, memref + linalg.matmul(%A, %B, %D) : memref, memref, memref + %0 = dim %C, 0 : memref + %1 = dim %C, 1 : memref + %2 = dim %D, 1 : memref loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f4 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) -// CHECK: %[[C_0:.*]] = linalg.dim %[[C]], 0 : !linalg.view -// CHECK: %[[C_1:.*]] = linalg.dim %[[C]], 1 : !linalg.view -// CHECK: %[[D_1:.*]] = linalg.dim %[[D]], 1 : !linalg.view +// CHECK: %[[C_0:.*]] = dim %[[C]], 0 : memref +// CHECK: %[[C_1:.*]] = dim %[[C]], 1 : memref +// CHECK: %[[D_1:.*]] = dim %[[D]], 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[D_1]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_1]] step %{{.*}} { @@ -149,37 +152,37 @@ func @f4(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< // CHECK: linalg.matmul // CHECK: linalg.matmul -func @f5(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f5(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - %0 = linalg.dim %B, 1 : !linalg.view - %1 = linalg.dim %D, 0 : !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - linalg.matmul(%C, %B, %D) : !linalg.view, !linalg.view, !linalg.view + %0 = dim %B, 1 : memref + %1 = dim %D, 0 : memref + %2 = dim %D, 1 : memref + linalg.matmul(%A, %B, %C) : memref, memref, memref + linalg.matmul(%C, %B, %D) : memref, memref, memref loop.for %arg5 = %c0 to %1 step %c2 { loop.for %arg6 = %c0 to %0 step %c3 { loop.for %arg7 = %c0 to %2 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %D[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %D[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %B[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %B[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f5 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) -// CHECK-DAG: %[[B_1:.*]] = linalg.dim %[[B]], 1 : !linalg.view -// CHECK-DAG: %[[D_0:.*]] = linalg.dim %[[D]], 0 : !linalg.view -// CHECK-DAG: %[[D_1:.*]] = linalg.dim %[[D]], 1 : !linalg.view +// CHECK-DAG: %[[B_1:.*]] = dim %[[B]], 1 : memref +// CHECK-DAG: %[[D_0:.*]] = dim %[[D]], 0 : memref +// CHECK-DAG: %[[D_1:.*]] = dim %[[D]], 1 : memref // Don't fuse C due to false dependence, note that this is too conservative though. // CHECK: linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) // CHECK: loop.for %{{.*}} = %{{.*}} to %[[D_0]] step %{{.*}} { @@ -188,31 +191,31 @@ func @f5(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< // CHECK: linalg.matmul // CHECK: linalg.matmul -func @f6(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f6(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - %0 = linalg.dim %C, 1 : !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - linalg.matmul(%A, %C, %E) : !linalg.view, !linalg.view, !linalg.view - %1 = linalg.dim %C, 0 : !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view + %0 = dim %C, 1 : memref + linalg.matmul(%A, %B, %C) : memref, memref, memref + linalg.matmul(%A, %C, %E) : memref, memref, memref + %1 = dim %C, 0 : memref + %2 = dim %D, 1 : memref loop.for %arg5 = %c0 to %1 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %0 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %C[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f6 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) @@ -226,29 +229,29 @@ func @f6(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< // CHECK: linalg.matmul // CHECK-NOT: linalg.matmul -func @f7(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f7(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - %0 = linalg.dim %A, 0 : !linalg.view - %1 = linalg.dim %A, 1 : !linalg.view - %2 = linalg.dim %C, 1 : !linalg.view - %3 = linalg.dim %C, 0 : !linalg.view - %4 = linalg.dim %D, 1 : !linalg.view - linalg.matmul(%A, %C, %E) : !linalg.view, !linalg.view, !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view + %0 = dim %A, 0 : memref + %1 = dim %A, 1 : memref + %2 = dim %C, 1 : memref + %3 = dim %C, 0 : memref + %4 = dim %D, 1 : memref + linalg.matmul(%A, %C, %E) : memref, memref, memref + linalg.matmul(%A, %B, %C) : memref, memref, memref loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %5 = affine.apply #map0(%arg5) %6 = affine.apply #map1(%arg7) - %7 = linalg.subview %A[%arg5, %5, %c1, %arg7, %6, %c1] : !linalg.view + %7 = linalg.subview %A[%arg5, %5, %c1, %arg7, %6, %c1] : memref %8 = affine.apply #map2(%arg6) - %9 = linalg.subview %C[%arg7, %6, %c1, %arg6, %8, %c1] : !linalg.view - %10 = linalg.subview %E[%arg5, %5, %c1, %arg6, %8, %c1] : !linalg.view - linalg.matmul(%7, %9, %10) : !linalg.view, !linalg.view, !linalg.view + %9 = linalg.subview %C[%arg7, %6, %c1, %arg6, %8, %c1] : memref + %10 = linalg.subview %E[%arg5, %5, %c1, %arg6, %8, %c1] : memref + linalg.matmul(%7, %9, %10) : memref, memref, memref } } } @@ -257,23 +260,23 @@ func @f7(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< loop.for %arg7 = %c0 to %2 step %c4 { %5 = affine.apply #map0(%arg5) %6 = affine.apply #map1(%arg7) - %7 = linalg.subview %C[%arg5, %5, %c1, %arg7, %6, %c1] : !linalg.view + %7 = linalg.subview %C[%arg5, %5, %c1, %arg7, %6, %c1] : memref %8 = affine.apply #map2(%arg6) - %9 = linalg.subview %D[%arg7, %6, %c1, %arg6, %8, %c1] : !linalg.view - %10 = linalg.subview %E[%arg5, %5, %c1, %arg6, %8, %c1] : !linalg.view - linalg.matmul(%7, %9, %10) : !linalg.view, !linalg.view, !linalg.view + %9 = linalg.subview %D[%arg7, %6, %c1, %arg6, %8, %c1] : memref + %10 = linalg.subview %E[%arg5, %5, %c1, %arg6, %8, %c1] : memref + linalg.matmul(%7, %9, %10) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f7 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) -// CHECK: %[[A_0:.*]] = linalg.dim %[[A]], 0 : !linalg.view -// CHECK: %[[A_1:.*]] = linalg.dim %[[A]], 1 : !linalg.view -// CHECK: %[[C_1:.*]] = linalg.dim %[[C]], 1 : !linalg.view -// CHECK: %[[C_0:.*]] = linalg.dim %[[C]], 0 : !linalg.view -// CHECK: %[[D_1:.*]] = linalg.dim %[[D]], 1 : !linalg.view +// CHECK: %[[A_0:.*]] = dim %[[A]], 0 : memref +// CHECK: %[[A_1:.*]] = dim %[[A]], 1 : memref +// CHECK: %[[C_1:.*]] = dim %[[C]], 1 : memref +// CHECK: %[[C_0:.*]] = dim %[[C]], 0 : memref +// CHECK: %[[D_1:.*]] = dim %[[D]], 1 : memref // CHECK: linalg.matmul(%[[A]], %[[C]], %[[E]]) // CHECK: loop.for %{{.*}} = %{{.*}} to %[[A_0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[C_1]] step %{{.*}} { @@ -286,31 +289,31 @@ func @f7(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< // CHECK: linalg.matmul // CHECK-NOT: linalg.matmul -func @f8(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view, %E: !linalg.view) -> !linalg.view { +func @f8(%A: memref, %B: memref, %C: memref, %D: memref, %E: memref) -> memref { %c1 = constant 1 : index %c0 = constant 0 : index %c4 = constant 4 : index %c3 = constant 3 : index %c2 = constant 2 : index - %0 = linalg.dim %A, 0 : !linalg.view - %1 = linalg.dim %A, 1 : !linalg.view - linalg.matmul(%A, %C, %D) : !linalg.view, !linalg.view, !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - %2 = linalg.dim %D, 1 : !linalg.view + %0 = dim %A, 0 : memref + %1 = dim %A, 1 : memref + linalg.matmul(%A, %C, %D) : memref, memref, memref + linalg.matmul(%A, %B, %C) : memref, memref, memref + %2 = dim %D, 1 : memref loop.for %arg5 = %c0 to %0 step %c2 { loop.for %arg6 = %c0 to %2 step %c3 { loop.for %arg7 = %c0 to %1 step %c4 { %3 = affine.apply #map0(%arg5) %4 = affine.apply #map1(%arg7) - %5 = linalg.subview %A[%arg5, %3, %c1, %arg7, %4, %c1] : !linalg.view + %5 = linalg.subview %A[%arg5, %3, %c1, %arg7, %4, %c1] : memref %6 = affine.apply #map2(%arg6) - %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : !linalg.view - %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : !linalg.view - linalg.matmul(%5, %7, %8) : !linalg.view, !linalg.view, !linalg.view + %7 = linalg.subview %D[%arg7, %4, %c1, %arg6, %6, %c1] : memref + %8 = linalg.subview %E[%arg5, %3, %c1, %arg6, %6, %c1] : memref + linalg.matmul(%5, %7, %8) : memref, memref, memref } } } - return %E : !linalg.view + return %E : memref } // CHECK-LABEL: func @f8 // CHECK: (%[[A:.*]]:{{.*}}, %[[B:.*]]:{{.*}}, %[[C:.*]]:{{.*}}, %[[D:.*]]:{{.*}}, %[[E:.*]]:{{.*}}) @@ -328,7 +331,7 @@ func @f8(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view< n_loop_types = [2, 0, 0], n_views = [2, 1] } -func @pointwise(%A: !linalg.view, %B: !linalg.view, %C: !linalg.view, %D: !linalg.view) { +func @pointwise(%A: memref, %B: memref, %C: memref, %D: memref) { %c1 = constant 1 : index %c0 = constant 0 : index %c3 = constant 3 : index @@ -337,21 +340,21 @@ func @pointwise(%A: !linalg.view, %B: !linalg.view, %C: !linal ^bb0(%E: f32, %arg5: f32, %arg6: f32): // no predecessors %2 = addf %E, %arg5 : f32 linalg.yield %2 : f32 - }: !linalg.view, !linalg.view, !linalg.view - %0 = linalg.dim %B, 0 : !linalg.view - %1 = linalg.dim %B, 1 : !linalg.view + }: memref, memref, memref + %0 = dim %B, 0 : memref + %1 = dim %B, 1 : memref loop.for %E = %c0 to %0 step %c2 { loop.for %arg5 = %c0 to %1 step %c3 { %2 = affine.apply #map0(%E) %3 = affine.apply #map1(%arg5) - %4 = linalg.subview %B[%E, %2, %c1, %arg5, %3, %c1] : !linalg.view - %5 = linalg.subview %C[%E, %2, %c1, %arg5, %3, %c1] : !linalg.view - %6 = linalg.subview %D[%E, %2, %c1, %arg5, %3, %c1] : !linalg.view + %4 = linalg.subview %B[%E, %2, %c1, %arg5, %3, %c1] : memref + %5 = linalg.subview %C[%E, %2, %c1, %arg5, %3, %c1] : memref + %6 = linalg.subview %D[%E, %2, %c1, %arg5, %3, %c1] : memref linalg.generic #pointwise_2d_trait %4, %5, %6 { ^bb0(%arg6: f32, %arg7: f32, %arg8: f32): // no predecessors %7 = mulf %arg6, %arg7 : f32 linalg.yield %7 : f32 - }: !linalg.view, !linalg.view, !linalg.view + }: memref, memref, memref } } return diff --git a/mlir/test/Dialect/Linalg/invalid.mlir b/mlir/test/Dialect/Linalg/invalid.mlir index 9ea9e51e9f1..c8a3cb426dd 100644 --- a/mlir/test/Dialect/Linalg/invalid.mlir +++ b/mlir/test/Dialect/Linalg/invalid.mlir @@ -44,63 +44,63 @@ func @buffer_valid_element_type() { // ----- -func @load_number_of_indices(%v : !linalg.view) { - // expected-error @+2 {{expected 0 indices, got 1}} +func @load_number_of_indices(%v : memref) { + // expected-error @+2 {{incorrect number of indices for load}} %c0 = constant 0 : index - linalg.load %v[%c0] : !linalg.view + load %v[%c0] : memref } // ----- -func @slice_number_of_indexings(%arg0: !linalg.view) { +func @slice_number_of_indexings(%arg0: memref(off + M * i + j)>) { // expected-error @+2 {{expected 2 indexings, got 1}} %c0 = constant 0: index - %0 = linalg.slice %arg0[%c0] : !linalg.view, index, !linalg.view + %0 = linalg.slice %arg0[%c0] : memref(off + M * i + j)>, index, memref(off + M * i + j)> } // ----- -func @slice_rank_vs_range_indices(%arg0: !linalg.view) { +func @slice_rank_vs_range_indices(%arg0: memref(off + M * i + j)>) { // expected-error @+2 {{op expected rank of the view(1) to be the number of ranges(0)}} %c0 = constant 0: index - %0 = linalg.slice %arg0[%c0, %c0] : !linalg.view, index, index, !linalg.view + %0 = linalg.slice %arg0[%c0, %c0] : memref(off + M * i + j)>, index, index, memref(off + i)> } // ----- -func @store_number_of_indices(%v : !linalg.view) { - // expected-error @+3 {{expected 0 indices, got 1}} +func @store_number_of_indices(%v : memref) { + // expected-error @+3 {{store index operand count not equal to memref rank}} %c0 = constant 0 : index %f0 = constant 0.0 : f32 - linalg.store %f0, %v[%c0] : !linalg.view + store %f0, %v[%c0] : memref } // ----- -func @subview_number_of_indices(%v : !linalg.view) { - // expected-error @+2 {{expected a view followed by 6 indices specifying a range for each dimension}} +func @subview_number_of_indices(%v : memref(off + M * i + j)>) { + // expected-error @+2 {{expected a strided memref followed by 6 indices specifying a range for each dimension}} %c0 = constant 0 : index - linalg.subview %v[%c0, %c0] : !linalg.view + linalg.subview %v[%c0, %c0] : memref(off + M * i + j)> } // ----- -func @transpose_not_permutation(%v : !linalg.view) { +func @transpose_not_permutation(%v : memref(off + M * i + j)>) { // expected-error @+1 {{expected a permutation map}} - linalg.transpose %v (i, j) -> (i, i) : !linalg.view + linalg.transpose %v (i, j) -> (i, i) : memref(off + M * i + j)> } // ----- -func @transpose_bad_rank(%v : !linalg.view) { +func @transpose_bad_rank(%v : memref(off + M * i + j)>) { // expected-error @+1 {{expected a permutation map of same rank as the view}} - linalg.transpose %v (i) -> (i) : !linalg.view + linalg.transpose %v (i) -> (i) : memref(off + M * i + j)> } // ----- func @view_type(%buf: !linalg.buffer, %min: index, %max: index, %step: index) { - // expected-error @+2 {{expected view type}} + // expected-error @+2 {{expected memref type}} %r = linalg.range %min:%max:%step : !linalg.range %0 = linalg.view %buf[%r]: !linalg.buffer -> index } @@ -110,134 +110,134 @@ func @view_type(%buf: !linalg.buffer, %min: index, %max: index, %step: in func @view_num_ranges(%buf: !linalg.buffer, %min: index, %max: index, %step: index) { // expected-error @+2 {{expected 2 ranges}} %r = linalg.range %min:%max:%step : !linalg.range - %0 = linalg.view %buf[%r]: !linalg.buffer -> !linalg.view + %0 = linalg.view %buf[%r]: !linalg.buffer -> memref(off + M * i + j)> } // ----- -func @yield_parent(%arg0: !linalg.view) { +func @yield_parent(%arg0: memref(off + i)>) { // expected-error @+1 {{op expected 'linalg.generic' parent op}} - linalg.yield %arg0: !linalg.view + linalg.yield %arg0: memref(off + i)> } // ----- -func @generic_at_least_2_operands(%arg0: !linalg.view) { +func @generic_at_least_2_operands(%arg0: memref) { // expected-error @+1 {{op expected 2 or more operands}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [1, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- -func @generic_exactly_2_views(%arg0: !linalg.view) { +func @generic_exactly_2_views(%arg0: memref) { // expected-error @+1 {{op expected exactly 2 view operands}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [1, 1], n_loop_types = [0, 0, 0] - } %arg0, %arg0, %arg0: !linalg.view, !linalg.view, !linalg.view + } %arg0, %arg0, %arg0: memref, memref, memref } // ----- -func @generic_undefined_fun(%arg0: !linalg.view) { +func @generic_undefined_fun(%arg0: memref) { // expected-error @+1 {{op expected fun attribute to refer to a defined symbol}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [1, 1], n_loop_types = [0, 0, 0] - } %arg0, %arg0: !linalg.view, !linalg.view + } %arg0, %arg0: memref, memref } // ----- func @foo() { return } -func @generic_mismatched_num_arguments(%arg0: !linalg.view) { +func @generic_mismatched_num_arguments(%arg0: memref) { // expected-error @+1 {{op expected fun arguments to match number of views}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- func @foo(%0: i32) { return } -func @generic_mismatched_num_returns(%arg0: !linalg.view) { +func @generic_mismatched_num_returns(%arg0: memref) { // expected-error @+1 {{op expected fun results to match number of output views}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- func @foo(%0: i32) -> i32 { return %0: i32 } -func @generic_symbol_in_map(%arg0: !linalg.view) { +func @generic_symbol_in_map(%arg0: memref) { // expected-error @+1 {{op expected indexing_map #0 to have no symbols}} linalg.generic { fun = @foo, indexing_maps = [ ()[N] -> (0) ], n_views = [0, 1], n_loop_types = [1, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- func @foo(%0: i32) -> i32 { return %0: i32 } -func @generic_wrong_dim_in_map(%arg0: !linalg.view) { +func @generic_wrong_dim_in_map(%arg0: memref) { // expected-error @+1 {{op expected indexing_map #0 to have 1 dim(s) to match the number of loops}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [1, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- func @foo(%0: i32) -> i32 { return %0: i32 } -func @generic_zero_d_view(%arg0: !linalg.view) { - // expected-error @+1 {{op expected indexing_map #0 to be 0 to match 0-D view: '!linalg.view'}} +func @generic_zero_d_view(%arg0: memref) { + // expected-error @+1 {{op expected indexing_map #0 to be 0 to match 0-D view: 'memref'}} linalg.generic { fun = @foo, indexing_maps = [ () -> (1) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref } // ----- func @foo(%0: f32) -> f32 { return %0: f32 } -func @generic_one_d_view(%arg0: !linalg.view) { - // expected-error @+1 {{op expected indexing_map #0 results to match view rank: '!linalg.view'}} +func @generic_one_d_view(%arg0: memref(off + i)>) { + // expected-error @+1 {{op expected indexing_map #0 results to match view rank: 'memref (d0 + s0)>'}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0, 0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref(off + i)> } // ----- @@ -247,14 +247,14 @@ func @foo(%0: i32) -> f32 { return %1: f32 } -func @generic_fun_arg_0_element_type(%arg0: !linalg.view) { +func @generic_fun_arg_0_element_type(%arg0: memref(off + i)>) { // expected-error @+1 {{op expected fun argument 0 to match view element type: 'f32'}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref(off + i)> } // ----- @@ -264,21 +264,21 @@ func @foo(%0: f32) -> i4 { return %1: i4 } -func @generic_fun_result_0_element_type(%arg0: !linalg.view) { +func @generic_fun_result_0_element_type(%arg0: memref(off + i)>) { // expected-error @+1 {{op expected fun result 0 to match output view element type: 'f32'}} linalg.generic { fun = @foo, indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] - } %arg0: !linalg.view + } %arg0: memref(off + i)> } // ----- func @foo(%0: f32, %1: f32) -> f32 { return %1: f32 } -func @generic_singular_maps(%arg0: !linalg.view, %arg1: !linalg.view) { +func @generic_singular_maps(%arg0: memref(off + i)>, %arg1: memref(off + i)>) { // expected-error @+1 {{op expected the concatenation of maps in indexing_map to be invertible}} linalg.generic { fun = @foo, @@ -288,7 +288,7 @@ func @generic_singular_maps(%arg0: !linalg.view, %arg1: !linalg.view, !linalg.view + } %arg0, %arg1: memref(off + i)>, memref(off + i)> } //////////////////////////////////////////////////////////////////////////////// @@ -297,7 +297,7 @@ func @generic_singular_maps(%arg0: !linalg.view, %arg1: !linalg.view) { +func @generic_empty_region(%arg0: memref) { // expected-error @+1 {{op expected region with 1 block}} linalg.generic { indexing_maps = [ () -> (0) ], @@ -306,12 +306,12 @@ func @generic_empty_region(%arg0: !linalg.view) { } %arg0, %arg0 { ^bb1: ^bb2: - }: !linalg.view, !linalg.view + }: memref, memref } // ----- -func @generic_mismatched_num_arguments(%arg0: !linalg.view) { +func @generic_mismatched_num_arguments(%arg0: memref) { // expected-error @+1 {{op expected number of block arguments to match number of views}} linalg.generic { indexing_maps = [ () -> (0) ], @@ -319,25 +319,25 @@ func @generic_mismatched_num_arguments(%arg0: !linalg.view) { n_loop_types = [0, 0, 0] } %arg0 { ^bb: - }: !linalg.view + }: memref } // ----- -func @generic_block_arg_type(%arg0: !linalg.view) { - // expected-error @+1 {{op expected block argument 0 of the same type as elemental type of output view: '!linalg.view'}} +func @generic_block_arg_type(%arg0: memref) { + // expected-error @+1 {{op expected block argument 0 of the same type as elemental type of output view: 'memref'}} linalg.generic { indexing_maps = [ () -> (0) ], n_views = [0, 1], n_loop_types = [0, 0, 0] } %arg0 { ^bb(%i: i1): - }: !linalg.view + }: memref } // ----- -func @generic_fun_result_0_element_type(%arg0: !linalg.view) { +func @generic_fun_result_0_element_type(%arg0: memref(off + i)>) { // expected-error @+8 {{type of return operand 0 ('i1') doesn't match view element type ('f32')}} linalg.generic { indexing_maps = [ (i) -> (i) ], @@ -347,5 +347,5 @@ func @generic_fun_result_0_element_type(%arg0: !linalg.view) { ^bb(%i: f32): %0 = constant 0: i1 linalg.yield %0: i1 - }: !linalg.view + }: memref(off + i)> } diff --git a/mlir/test/Dialect/Linalg/llvm.mlir b/mlir/test/Dialect/Linalg/llvm.mlir index 3d210516848..3cedbe04ef8 100644 --- a/mlir/test/Dialect/Linalg/llvm.mlir +++ b/mlir/test/Dialect/Linalg/llvm.mlir @@ -1,4 +1,9 @@ -// RUN: mlir-opt %s -linalg-lower-to-llvm-dialect | FileCheck %s +// RUN: mlir-opt %s -linalg-convert-to-llvm +// RUN: mlir-opt %s -linalg-convert-to-llvm | FileCheck %s + +#strided1D = (d0)[s0] -> (d0 + s0) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided3D = (d0, d1, d2)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2 + d2) func @buffer_size(%arg0: !linalg.buffer) { %c1 = constant 1 : index @@ -44,7 +49,7 @@ func @range(%arg0: index) { // CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> func @view(%arg0: !linalg.buffer, %arg1: !linalg.range) { - %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> !linalg.view + %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> memref return } // CHECK-LABEL: func @view @@ -64,7 +69,7 @@ func @view(%arg0: !linalg.buffer, %arg1: !linalg.range) { // CHECK-NEXT: llvm.return func @view3d(%arg0: !linalg.buffer, %arg1: !linalg.range, %arg2: !linalg.range, %arg3: !linalg.range) { - %0 = linalg.view %arg0[%arg1, %arg2, %arg3] : !linalg.buffer -> !linalg.view + %0 = linalg.view %arg0[%arg1, %arg2, %arg3] : !linalg.buffer -> memref return } // CHECK-LABEL: func @view3d @@ -78,22 +83,23 @@ func @view3d(%arg0: !linalg.buffer, %arg1: !linalg.range, %arg2: !linalg. // CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> func @slice(%arg0: !linalg.buffer, %arg1: !linalg.range) { - %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> !linalg.view - %1 = linalg.slice %0[%arg1] : !linalg.view, !linalg.range, !linalg.view + %0 = linalg.view %arg0[%arg1] : !linalg.buffer -> memref + %1 = linalg.slice %0[%arg1] : memref, !linalg.range, memref return } // CHECK-LABEL: func @slice // insert ptr for view op // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> // insert data ptr for slice op -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> // CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> // CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> // CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 // CHECK-NEXT: llvm.add %{{.*}}, %{{.*}} : !llvm.i64 // insert offset +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> // CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.mlir.constant(0 : index) // CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> // CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> // CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> @@ -112,24 +118,24 @@ func @slice(%arg0: !linalg.buffer, %arg1: !linalg.range) { // CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> // CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, i64, [1 x i64], [1 x i64] }"> -func @dot(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.dot(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +func @dot(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.dot(%arg0, %arg1, %arg2) : memref, memref, memref return } -// CHECK-LABEL: func @dot(%{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }">, %{{.*}}: !llvm<"{ float*, i64, [0 x i64], [0 x i64] }">) { +// CHECK-LABEL: func @dot(%{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, %{{.*}}: !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, %{{.*}}: !llvm<"{ float*, i64 }*">) { // CHECK-COUNT-3: llvm.mlir.constant(1 : index){{.*[[:space:]].*}}llvm.alloca{{.*[[:space:]].*}}llvm.store -// CHECK-NEXT: llvm.call @linalg_dot_viewxf32_viewxf32_viewf32(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64, [0 x i64], [0 x i64] }*">) -> () +// CHECK-NEXT: llvm.call @linalg_dot_viewsxf32_viewsxf32_viewf32(%{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64, [1 x i64], [1 x i64] }*">, !llvm<"{ float*, i64 }*">) -> () -func @dim(%arg0: !linalg.view) { - %0 = linalg.dim %arg0, 1 : !linalg.view +func @dim(%arg0: memref) { + %0 = dim %arg0, 1 : memref return } -// CHECK-LABEL: func @dim(%{{.*}}: !llvm<"{ float*, i64, [2 x i64], [2 x i64] }">) { +// CHECK-LABEL: func @dim(%{{.*}}: !llvm<"{ float*, i64, [2 x i64], [2 x i64] }*">) { // CHECK: llvm.extractvalue %{{.*}}[2, 1] : !llvm<"{ float*, i64, [2 x i64], [2 x i64] }"> -func @subview(%arg0: !linalg.view) { +func @subview(%arg0: memref) { %c0 = constant 0 : index - %0 = linalg.subview %arg0[%c0, %c0, %c0, %c0, %c0, %c0] : !linalg.view + %0 = linalg.subview %arg0[%c0, %c0, %c0, %c0, %c0, %c0] : memref return } // CHECK-LABEL: func @subview @@ -156,37 +162,37 @@ func @subview(%arg0: !linalg.view) { // CHECK-NEXT: llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 // CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 -func @view_with_range_and_index(%arg0: !linalg.view) { +func @view_with_range_and_index(%arg0: memref) { %c0 = constant 0 : index %c1 = constant 1 : index %R = linalg.range %c0:%c1:%c1 : !linalg.range loop.for %i0 = %c0 to %c1 step %c1 { - %1 = linalg.slice %arg0[%i0, %R] : !linalg.view, index, !linalg.range, !linalg.view + %1 = linalg.slice %arg0[%i0, %R] : memref, index, !linalg.range, memref } return } // CHECK-LABEL: func @view_with_range_and_index // loop-body. // CHECK: llvm.mlir.undef : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[3, 1] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ double*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.insertvalue %{{.*}}[1] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> // CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> // CHECK: llvm.insertvalue %{{.*}}[2, 0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> // CHECK: llvm.insertvalue %{{.*}}[3, 0] : !llvm<"{ double*, i64, [1 x i64], [1 x i64] }"> -func @copy(%arg0: !linalg.view, %arg1: !linalg.view) { - linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view +func @copy(%arg0: memref, %arg1: memref) { + linalg.copy(%arg0, %arg1) : memref, memref return } // CHECK-LABEL: func @copy -// CHECK: llvm.call @linalg_copy_viewxxxf32_viewxxxf32(%{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">, !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">) -> () +// CHECK: llvm.call @linalg_copy_viewsxsxsxf32_viewsxsxsxf32(%{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">, !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">) -> () -func @transpose(%arg0: !linalg.view) { - %0 = linalg.transpose %arg0 (i, j, k) -> (k, i, j) : !linalg.view +func @transpose(%arg0: memref) { + %0 = linalg.transpose %arg0 (i, j, k) -> (k, i, j) : memref return } // CHECK-LABEL: func @transpose @@ -200,10 +206,10 @@ func @transpose(%arg0: !linalg.view) { // CHECK: llvm.extractvalue {{.*}}[2, 2] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> // CHECK: llvm.insertvalue {{.*}}[2, 1] : !llvm<"{ float*, i64, [3 x i64], [3 x i64] }"> -func @copy_transpose(%arg0: !linalg.view, %arg1: !linalg.view) { +func @copy_transpose(%arg0: memref, %arg1: memref) { linalg.copy(%arg0, %arg1) {inputPermutation = (i, j, k) -> (i, k, j), outputPermutation = (i, j, k) -> (k, j, i)} - : !linalg.view, !linalg.view + : memref, memref return } // CHECK-LABEL: func @copy @@ -227,4 +233,4 @@ func @copy_transpose(%arg0: !linalg.view, %arg1: !linalg.view // Call external copy after promoting input and output structs to pointers // CHECK-COUNT-2: llvm.mlir.constant(1 : index){{.*[[:space:]].*}}llvm.alloca{{.*[[:space:]].*}}llvm.store -// CHECK: llvm.call @linalg_copy_viewxxxf32_viewxxxf32(%{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">, !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">) -> () +// CHECK: llvm.call @linalg_copy_viewsxsxsxf32_viewsxsxsxf32(%{{.*}}, %{{.*}}) : (!llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">, !llvm<"{ float*, i64, [3 x i64], [3 x i64] }*">) -> () diff --git a/mlir/test/Dialect/Linalg/loops.mlir b/mlir/test/Dialect/Linalg/loops.mlir index 83311eeabfe..518189b786d 100644 --- a/mlir/test/Dialect/Linalg/loops.mlir +++ b/mlir/test/Dialect/Linalg/loops.mlir @@ -1,8 +1,18 @@ // RUN: mlir-opt %s -linalg-lower-to-loops | FileCheck %s -// CHECK-DAG: #[[S2D1:.*]] = (d0, d1) -> (d0 * 2 + d1) -// CHECK-DAG: #[[S2D3:.*]] = (d0, d1) -> (d0 * 2 + d1 * 4) -// CHECK-DAG: #[[S3D2:.*]] = (d0, d1) -> (d0 * 3 + d1 * 5) +// CHECK-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +#strided1D = (d0)[s0] -> (d0 + s0) +// CHECK-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// CHECK-DAG: #[[strided3D:.*]] = (d0, d1, d2)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2 + d2) +#strided3D = (d0, d1, d2)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2 + d2) +// CHECK-DAG: #[[strided4D:.*]] = (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3) +#strided4D = (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3) + +// CHECK-DAG: #[[Stride2Dilation1:.*]] = (d0, d1) -> (d0 * 2 + d1) +// CHECK-DAG: #[[Stride2Dilation4:.*]] = (d0, d1) -> (d0 * 2 + d1 * 4) +// CHECK-DAG: #[[Stride3Dilation5:.*]] = (d0, d1) -> (d0 * 3 + d1 * 5) + func @matmul(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: index) { %c0 = constant 0 : index @@ -10,182 +20,189 @@ func @matmul(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: in %I = linalg.range %c0:%arg1:%c1 : !linalg.range %J = linalg.range %c0:%arg2:%c1 : !linalg.range %K = linalg.range %c0:%arg3:%c1 : !linalg.range - %A = linalg.view %arg0[%I, %K] : !linalg.buffer -> !linalg.view - %B = linalg.view %arg0[%K, %J] : !linalg.buffer -> !linalg.view - %C = linalg.view %arg0[%I, %J] : !linalg.buffer -> !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view + %A = linalg.view %arg0[%I, %K] : !linalg.buffer -> memref + %B = linalg.view %arg0[%K, %J] : !linalg.buffer -> memref + %C = linalg.view %arg0[%I, %J] : !linalg.buffer -> memref + linalg.matmul(%A, %B, %C) : memref, memref, memref return } // CHECK-LABEL: func @matmul(%{{.*}}: !linalg.buffer, %{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { -// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[C:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[M:.*]] = linalg.dim %[[A]], 0 : !linalg.view -// CHECK: %[[K:.*]] = linalg.dim %[[A]], 1 : !linalg.view -// CHECK: %[[N:.*]] = linalg.dim %[[B]], 1 : !linalg.view +// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[C:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[M:.*]] = dim %[[A]], 0 : memref +// CHECK: %[[K:.*]] = dim %[[A]], 1 : memref +// CHECK: %[[N:.*]] = dim %[[B]], 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[M]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[N]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[K]] step %{{.*}} { -// CHECK-DAG: %[[a:.*]] = linalg.load %[[A]][%{{.*}}, %{{.*}}] : !linalg.view -// CHECK-DAG: %[[b:.*]] = linalg.load %[[B]][%{{.*}}, %{{.*}}] : !linalg.view +// CHECK-DAG: %[[a:.*]] = load %[[A]][%{{.*}}, %{{.*}}] : memref +// CHECK-DAG: %[[b:.*]] = load %[[B]][%{{.*}}, %{{.*}}] : memref // CHECK-DAG: %[[inc:.*]] = mulf %[[a]], %[[b]] : f32 -// CHECK-DAG: %[[c:.*]] = linalg.load %[[C]][%{{.*}}, %{{.*}}] : !linalg.view +// CHECK-DAG: %[[c:.*]] = load %[[C]][%{{.*}}, %{{.*}}] : memref // CHECK-DAG: %[[res:.*]] = addf %[[c]], %[[inc]] : f32 -// CHECK: linalg.store %[[res]], %[[C]][%{{.*}}, %{{.*}}] : !linalg.view +// CHECK: store %[[res]], %[[C]][%{{.*}}, %{{.*}}] : memref func @matvec(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: index) { %c0 = constant 0 : index %c1 = constant 1 : index %I = linalg.range %c0:%arg1:%c1 : !linalg.range %J = linalg.range %c0:%arg2:%c1 : !linalg.range - %2 = linalg.view %arg0[%I, %J] : !linalg.buffer -> !linalg.view - %3 = linalg.view %arg0[%J] : !linalg.buffer -> !linalg.view - %4 = linalg.view %arg0[%I] : !linalg.buffer -> !linalg.view - linalg.matvec(%2, %3, %4) : !linalg.view, !linalg.view, !linalg.view + %2 = linalg.view %arg0[%I, %J] : !linalg.buffer -> memref + %3 = linalg.view %arg0[%J] : !linalg.buffer -> memref + %4 = linalg.view %arg0[%I] : !linalg.buffer -> memref + linalg.matvec(%2, %3, %4) : memref, memref, memref return } // CHECK-LABEL: func @matvec(%{{.*}}: !linalg.buffer, %{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { -// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[C:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[M:.*]] = linalg.dim %[[A]], 0 : !linalg.view -// CHECK: %[[K:.*]] = linalg.dim %[[A]], 1 : !linalg.view +// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[C:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[M:.*]] = dim %[[A]], 0 : memref +// CHECK: %[[K:.*]] = dim %[[A]], 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[M]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[K]] step %{{.*}} { -// CHECK-DAG: %[[a:.*]] = linalg.load %[[A]][%{{.*}}, %{{.*}}] : !linalg.view -// CHECK-DAG: %[[b:.*]] = linalg.load %[[B]][%{{.*}}] : !linalg.view +// CHECK-DAG: %[[a:.*]] = load %[[A]][%{{.*}}, %{{.*}}] : memref +// CHECK-DAG: %[[b:.*]] = load %[[B]][%{{.*}}] : memref // CHECK-DAG: %[[inc:.*]] = mulf %[[a]], %[[b]] : f32 -// CHECK-DAG: %[[c:.*]] = linalg.load %[[C]][%{{.*}}] : !linalg.view +// CHECK-DAG: %[[c:.*]] = load %[[C]][%{{.*}}] : memref // CHECK-DAG: %[[res:.*]] = addf %[[c]], %[[inc]] : f32 -// CHECK: linalg.store %[[res]], %[[C]][%{{.*}}] : !linalg.view +// CHECK: store %[[res]], %[[C]][%{{.*}}] : memref func @dot(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: index) { %c0 = constant 0 : index %c1 = constant 1 : index %I = linalg.range %c0:%arg1:%c1 : !linalg.range - %1 = linalg.view %arg0[%I] : !linalg.buffer -> !linalg.view - %2 = linalg.view %arg0[%I] : !linalg.buffer -> !linalg.view - %3 = linalg.view %arg0[] : !linalg.buffer -> !linalg.view - linalg.dot(%1, %2, %3) : !linalg.view, !linalg.view, !linalg.view + %1 = linalg.view %arg0[%I] : !linalg.buffer -> memref + %2 = linalg.view %arg0[%I] : !linalg.buffer -> memref + %3 = linalg.view %arg0[] : !linalg.buffer -> memref + linalg.dot(%1, %2, %3) : memref, memref, memref return } // CHECK-LABEL: func @dot(%{{.*}}: !linalg.buffer, %{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { -// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK: %[[C:.*]] = linalg.view %arg0[] : !linalg.buffer -> !linalg.view -// CHECK: %[[K:.*]] = linalg.dim %[[A]], 0 : !linalg.view +// CHECK: %[[A:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[B:.*]] = linalg.view %arg0[{{.*}}] : !linalg.buffer -> memref +// CHECK: %[[C:.*]] = linalg.view %arg0[] : !linalg.buffer -> memref +// CHECK: %[[K:.*]] = dim %[[A]], 0 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[K]] step %{{.*}} { -// CHECK-DAG: %[[a:.*]] = linalg.load %[[A]][%{{.*}}] : !linalg.view -// CHECK-DAG: %[[b:.*]] = linalg.load %[[B]][%{{.*}}] : !linalg.view +// CHECK-DAG: %[[a:.*]] = load %[[A]][%{{.*}}] : memref +// CHECK-DAG: %[[b:.*]] = load %[[B]][%{{.*}}] : memref // CHECK-DAG: %[[inc:.*]] = mulf %[[a]], %[[b]] : f32 -// CHECK-DAG: %[[c:.*]] = linalg.load %[[C]][] : !linalg.view +// CHECK-DAG: %[[c:.*]] = load %[[C]][] : memref // CHECK-DAG: %[[res:.*]] = addf %[[c]], %[[inc]] : f32 -// CHECK: linalg.store %[[res]], %[[C]][] : !linalg.view +// CHECK: store %[[res]], %[[C]][] : memref -func @dot_view(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.dot(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +func @dot_view(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.dot(%arg0, %arg1, %arg2) : memref, memref, memref return } -// CHECK-LABEL: func @dot_view(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: %[[K:.*]] = linalg.dim %arg0, 0 : !linalg.view +// CHECK-LABEL: func @dot_view( +// CHECK: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: %[[K:.*]] = dim %arg0, 0 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[K]] step %{{.*}} { -// CHECK-DAG: %[[a:.*]] = linalg.load %arg0[%{{.*}}] : !linalg.view -// CHECK-DAG: %[[b:.*]] = linalg.load %{{.*}}[%{{.*}}] : !linalg.view +// CHECK-DAG: %[[a:.*]] = load %arg0[%{{.*}}] : memref +// CHECK-DAG: %[[b:.*]] = load %{{.*}}[%{{.*}}] : memref // CHECK-DAG: %[[inc:.*]] = mulf %[[a]], %[[b]] : f32 -// CHECK-DAG: %[[c:.*]] = linalg.load %{{.*}}[] : !linalg.view +// CHECK-DAG: %[[c:.*]] = load %{{.*}}[] : memref // CHECK-DAG: %[[res:.*]] = addf %[[c]], %[[inc]] : f32 -// CHECK: linalg.store %[[res]], %{{.*}}[] : !linalg.view +// CHECK: store %[[res]], %{{.*}}[] : memref -func @fill_view(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill_view(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } -// CHECK-LABEL: func @fill_view(%{{.*}}: !linalg.view, %{{.*}}: f32) { +// CHECK-LABEL: func @fill_view( +// CHECK: %{{.*}}: memref, %{{.*}}: f32) { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { -// CHECK: linalg.store %{{.*}}, %{{.*}}[%{{.*}}] : !linalg.view +// CHECK: store %{{.*}}, %{{.*}}[%{{.*}}] : memref -func @fill_view0(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill_view0(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } -// CHECK-LABEL: func @fill_view0(%{{.*}}: !linalg.view, %{{.*}}: f32) { -// CHECK: linalg.store %{{.*}}, %{{.*}}[] : !linalg.view +// CHECK-LABEL: func @fill_view0(%{{.*}}: memref, %{{.*}}: f32) { +// CHECK: store %{{.*}}, %{{.*}}[] : memref -func @fill_view3(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill_view3(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } -// CHECK-LABEL: func @fill_view3(%{{.*}}: !linalg.view, %{{.*}}: f32) { +// CHECK-LABEL: func @fill_view3( +// CHECK: %{{.*}}: memref, %{{.*}}: f32) { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { -// CHECK: linalg.store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref -func @copy_view(%arg0: !linalg.view, %arg1: !linalg.view) { - linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view +func @copy_view(%arg0: memref, %arg1: memref) { + linalg.copy(%arg0, %arg1) : memref, memref return } -// CHECK-LABEL: func @copy_view(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { +// CHECK-LABEL: func @copy_view( +// CHECK: %{{.*}}: memref, %{{.*}}: memref) { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { -// CHECK: %[[L:.*]] = linalg.load %{{.*}}[%{{.*}}] : !linalg.view -// CHECK: linalg.store %[[L]], %{{.*}}[%{{.*}}] : !linalg.view +// CHECK: %[[L:.*]] = load %{{.*}}[%{{.*}}] : memref +// CHECK: store %[[L]], %{{.*}}[%{{.*}}] : memref -func @copy_view0(%arg0: !linalg.view, %arg1: !linalg.view) { - linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view +func @copy_view0(%arg0: memref, %arg1: memref) { + linalg.copy(%arg0, %arg1) : memref, memref return } -// CHECK-LABEL: func @copy_view0(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: %{{.*}} = linalg.load %{{.*}}[] : !linalg.view -// CHECK: linalg.store %{{.*}}, %{{.*}}[] : !linalg.view +// CHECK-LABEL: func @copy_view0(%{{.*}}: memref, %{{.*}}: memref) { +// CHECK: %{{.*}} = load %{{.*}}[] : memref +// CHECK: store %{{.*}}, %{{.*}}[] : memref -func @copy_view3(%arg0: !linalg.view, %arg1: !linalg.view) { +func @copy_view3(%arg0: memref, %arg1: memref) { linalg.copy(%arg0, %arg1) {inputPermutation = (i, j, k) -> (i, k, j), outputPermutation = (i, j, k) -> (k, j, i)} : - !linalg.view, !linalg.view + memref, memref return } -// CHECK-LABEL: func @copy_view3(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { +// CHECK-LABEL: func @copy_view3 +// CHECK: (%{{.*}}: memref, %{{.*}}: memref) { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { -// CHECK: %[[L:.*]] = linalg.load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view -// CHECK: linalg.store %[[L]], %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: %[[L:.*]] = load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref +// CHECK: store %[[L]], %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref -func @conv_view3(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.conv(%arg0, %arg1, %arg2) {strides = [2]}: !linalg.view, !linalg.view, !linalg.view +func @conv_view3(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.conv(%arg0, %arg1, %arg2) {strides = [2]}: memref, memref, memref return } -// CHECK-LABEL: func @conv_view3(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: %[[Z0:.*]] = linalg.dim %arg0, 0 : !linalg.view -// CHECK: %[[Q:.*]] = linalg.dim %arg0, 1 : !linalg.view -// CHECK: %[[K:.*]] = linalg.dim %arg0, 2 : !linalg.view -// CHECK: %[[B:.*]] = linalg.dim %arg1, 0 : !linalg.view -// CHECK: %[[X0:.*]] = linalg.dim %arg2, 1 : !linalg.view +// CHECK-LABEL: func @conv_view3( +// CHECK: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: %[[Z0:.*]] = dim %arg0, 0 : memref +// CHECK: %[[Q:.*]] = dim %arg0, 1 : memref +// CHECK: %[[K:.*]] = dim %arg0, 2 : memref +// CHECK: %[[B:.*]] = dim %arg1, 0 : memref +// CHECK: %[[X0:.*]] = dim %arg2, 1 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[B]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[X0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[K]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[Q]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[Z0]] step %{{.*}} { -// CHECK: %[[SUM:.*]] = affine.apply #[[S2D1]](%{{.*}}, %{{.*}}) -// CHECK: %{{.*}} = linalg.load %{{.*}}[%{{.*}}, %[[SUM]], %{{.*}}] : !linalg.view -// CHECK: %{{.*}} = linalg.load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: %[[SUM:.*]] = affine.apply #[[Stride2Dilation1]](%{{.*}}, %{{.*}}) +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %[[SUM]], %{{.*}}] : memref +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref // CHECK: %{{.*}} = mulf %{{.*}}, %{{.*}} : f32 -// CHECK: %{{.*}} = linalg.load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref // CHECK: %{{.*}} = addf %{{.*}}, %{{.*}} : f32 -// CHECK: linalg.store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}] : memref -func @conv_view4(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 5], strides = [2, 3]} : !linalg.view, !linalg.view, !linalg.view +func @conv_view4(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 5], strides = [2, 3]} : memref, memref, memref return } -// CHECK-LABEL: func @conv_view4(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: %[[Z0:.*]] = linalg.dim %arg0, 0 : !linalg.view -// CHECK: %[[Z1:.*]] = linalg.dim %arg0, 1 : !linalg.view -// CHECK: %[[Q:.*]] = linalg.dim %arg0, 2 : !linalg.view -// CHECK: %[[K:.*]] = linalg.dim %arg0, 3 : !linalg.view -// CHECK: %[[B:.*]] = linalg.dim %arg1, 0 : !linalg.view -// CHECK: %[[X0:.*]] = linalg.dim %arg2, 1 : !linalg.view -// CHECK: %[[X1:.*]] = linalg.dim %arg2, 2 : !linalg.view +// CHECK-LABEL: func @conv_view4( +// CHECK: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: %[[Z0:.*]] = dim %arg0, 0 : memref +// CHECK: %[[Z1:.*]] = dim %arg0, 1 : memref +// CHECK: %[[Q:.*]] = dim %arg0, 2 : memref +// CHECK: %[[K:.*]] = dim %arg0, 3 : memref +// CHECK: %[[B:.*]] = dim %arg1, 0 : memref +// CHECK: %[[X0:.*]] = dim %arg2, 1 : memref +// CHECK: %[[X1:.*]] = dim %arg2, 2 : memref // CHECK: loop.for %{{.*}} = %{{.*}} to %[[B]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[X0]] step %{{.*}} { // CHECK: loop.for %{{.*}} = %{{.*}} to %[[X1]] step %{{.*}} { @@ -193,14 +210,14 @@ func @conv_view4(%arg0: !linalg.view, %arg1: !linalg.view -// CHECK: %{{.*}} = linalg.load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: %[[SUM0:.*]] = affine.apply #[[Stride2Dilation4]](%{{.*}}, %{{.*}}) +// CHECK: %[[SUM1:.*]] = affine.apply #[[Stride3Dilation5]](%{{.*}}, %{{.*}}) +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %[[SUM0]], %[[SUM1]], %{{.*}}] : memref +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : memref // CHECK: %{{.*}} = mulf %{{.*}}, %{{.*}} : f32 -// CHECK: %{{.*}} = linalg.load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: %{{.*}} = load %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : memref // CHECK: %{{.*}} = addf %{{.*}}, %{{.*}} : f32 -// CHECK: linalg.store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view +// CHECK: store %{{.*}}, %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : memref func @foo(%0: f32, %1: f32, %2: f32) -> (f32, f32) { %f0 = constant 0.0 : f32 @@ -219,9 +236,9 @@ func @foo(%0: f32, %1: f32, %2: f32) -> (f32, f32) { library_call = "external_function_name", doc = "B(i,j,k), C(i,k,j) = foo(A(i, j), B(i,j,k), C(i,k,j))" } -func @generic_function(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { +func @generic_function(%arg0: memref, %arg1: memref, %arg2: memref) { linalg.generic #trait %arg0, %arg1, %arg2: - !linalg.view, !linalg.view, !linalg.view + memref, memref, memref return } // CHECK-LABEL: @foo @@ -229,12 +246,12 @@ func @generic_function(%arg0: !linalg.view, %arg1: !linalg.view -// CHECK: %[[b:.*]] = linalg.load %{{.*}}[%[[i]], %[[j]], %[[k]]] : !linalg.view -// CHECK: %[[c:.*]] = linalg.load %{{.*}}[%[[i]], %[[k]], %[[j]]] : !linalg.view +// CHECK: %[[a:.*]] = load %{{.*}}[%[[i]], %[[j]]] : memref +// CHECK: %[[b:.*]] = load %{{.*}}[%[[i]], %[[j]], %[[k]]] : memref +// CHECK: %[[c:.*]] = load %{{.*}}[%[[i]], %[[k]], %[[j]]] : memref // CHECK: %[[res:.*]]:2 = call @foo(%[[a]], %[[b]], %[[c]]) : (f32, f32, f32) -> (f32, f32) -// CHECK: linalg.store %[[res]]#0, %{{.*}}[%[[i]], %[[j]], %[[k]]] : !linalg.view -// CHECK: linalg.store %[[res]]#1, %{{.*}}[%[[i]], %[[k]], %[[j]]] : !linalg.view +// CHECK: store %[[res]]#0, %{{.*}}[%[[i]], %[[j]], %[[k]]] : memref +// CHECK: store %[[res]]#1, %{{.*}}[%[[i]], %[[k]], %[[j]]] : memref #trait2 = { n_views = [1, 2], @@ -243,23 +260,23 @@ func @generic_function(%arg0: !linalg.view, %arg1: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { +func @generic_region(%arg0: memref, %arg1: memref, %arg2: memref) { linalg.generic #trait2 %arg0, %arg1, %arg2 { ^bb0(%a: f32, %b: f32, %c: f32): %d = mulf %a, %b : f32 %e = addf %c, %d : f32 linalg.yield %d, %e : f32, f32 - }: !linalg.view, !linalg.view, !linalg.view + }: memref, memref, memref return } // CHECK-LABEL: @generic_region // CHECK: loop.for %[[i:.*]] = {{.*}} // CHECK: loop.for %[[j:.*]] = {{.*}} // CHECK: loop.for %[[k:.*]] = {{.*}} -// CHECK: %[[a:.*]] = linalg.load %{{.*}}[%[[i]], %[[j]]] : !linalg.view -// CHECK: %[[b:.*]] = linalg.load %{{.*}}[%[[i]], %[[j]], %[[k]]] : !linalg.view -// CHECK: %[[c:.*]] = linalg.load %{{.*}}[%[[i]], %[[k]], %[[j]]] : !linalg.view +// CHECK: %[[a:.*]] = load %{{.*}}[%[[i]], %[[j]]] : memref +// CHECK: %[[b:.*]] = load %{{.*}}[%[[i]], %[[j]], %[[k]]] : memref +// CHECK: %[[c:.*]] = load %{{.*}}[%[[i]], %[[k]], %[[j]]] : memref // CHECK: %[[d:.*]] = mulf %[[a]], %[[b]] : f32 // CHECK: %[[e:.*]] = addf %[[c]], %[[d]] : f32 -// CHECK: linalg.store %[[d]], %{{.*}}[%[[i]], %[[j]], %[[k]]] : !linalg.view -// CHECK: linalg.store %[[e]], %{{.*}}[%[[i]], %[[k]], %[[j]]] : !linalg.view +// CHECK: store %[[d]], %{{.*}}[%[[i]], %[[j]], %[[k]]] : memref +// CHECK: store %[[e]], %{{.*}}[%[[i]], %[[k]], %[[j]]] : memref diff --git a/mlir/test/Dialect/Linalg/promote.mlir b/mlir/test/Dialect/Linalg/promote.mlir index 611f1aa126f..becd95f594e 100644 --- a/mlir/test/Dialect/Linalg/promote.mlir +++ b/mlir/test/Dialect/Linalg/promote.mlir @@ -1,47 +1,51 @@ // RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true | FileCheck %s -check-prefix=TILE-1D +// TILE-1D-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// TILE-1D-DAG: #[[strided2DnoOffset:.*]] = (d0, d1)[s0] -> (d0 * s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) + func @matmul(%arg0: !linalg.buffer, %arg1: index, %arg2: index, %arg3: index) { %c0 = constant 0 : index %c1 = constant 1 : index %I = linalg.range %c0:%arg1:%c1 : !linalg.range %J = linalg.range %c0:%arg2:%c1 : !linalg.range %K = linalg.range %c0:%arg3:%c1 : !linalg.range - %A = linalg.view %arg0[%I, %K] : !linalg.buffer -> !linalg.view - %B = linalg.view %arg0[%K, %J] : !linalg.buffer -> !linalg.view - %C = linalg.view %arg0[%I, %J] : !linalg.buffer -> !linalg.view - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view + %A = linalg.view %arg0[%I, %K] : !linalg.buffer -> memref + %B = linalg.view %arg0[%K, %J] : !linalg.buffer -> memref + %C = linalg.view %arg0[%I, %J] : !linalg.buffer -> memref + linalg.matmul(%A, %B, %C) : memref, memref, memref return } // TILE-1D-LABEL: func @matmul(%{{.*}}: !linalg.buffer, %{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { // TILE-1D: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // TILE-1D: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { // TILE-1D: loop.for %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} { -// TILE-1D: %[[vA:.*]] = linalg.subview {{.*}} : !linalg.view -// TILE-1D: %[[vB:.*]] = linalg.subview {{.*}} : !linalg.view -// TILE-1D: %[[vC:.*]] = linalg.subview {{.*}} : !linalg.view +// TILE-1D: %[[vA:.*]] = linalg.subview {{.*}} : memref +// TILE-1D: %[[vB:.*]] = linalg.subview {{.*}} : memref +// TILE-1D: %[[vC:.*]] = linalg.subview {{.*}} : memref /// // TILE-1D: %[[tmpA:.*]] = linalg.buffer_alloc : !linalg.buffer<8xf32> -// TILE-1D: %[[fullA:.*]] = linalg.view %[[tmpA]][{{.*}}] : !linalg.buffer<8xf32> -> !linalg.view -// TILE-1D: %[[partialA:.*]] = linalg.slice %[[fullA]][%{{.*}}, %{{.*}}] : !linalg.view, !linalg.range, !linalg.range, !linalg.view +// TILE-1D: %[[fullA:.*]] = linalg.view %[[tmpA]][{{.*}}] : !linalg.buffer<8xf32> -> memref +// TILE-1D: %[[partialA:.*]] = linalg.slice %[[fullA]][%{{.*}}, %{{.*}}] : memref, !linalg.range, !linalg.range, memref /// // TILE-1D: %[[tmpB:.*]] = linalg.buffer_alloc : !linalg.buffer<12xf32> -// TILE-1D: %[[fullB:.*]] = linalg.view %[[tmpB]][{{.*}}] : !linalg.buffer<12xf32> -> !linalg.view -// TILE-1D: %[[partialB:.*]] = linalg.slice %[[fullB]][%{{.*}}, %{{.*}}] : !linalg.view, !linalg.range, !linalg.range, !linalg.view +// TILE-1D: %[[fullB:.*]] = linalg.view %[[tmpB]][{{.*}}] : !linalg.buffer<12xf32> -> memref +// TILE-1D: %[[partialB:.*]] = linalg.slice %[[fullB]][%{{.*}}, %{{.*}}] : memref, !linalg.range, !linalg.range, memref /// // TILE-1D: %[[tmpC:.*]] = linalg.buffer_alloc : !linalg.buffer<6xf32> -// TILE-1D: %[[fullC:.*]] = linalg.view %[[tmpC]][{{.*}}] : !linalg.buffer<6xf32> -> !linalg.view -// TILE-1D: %[[partialC:.*]] = linalg.slice %[[fullC]][%{{.*}}, %{{.*}}] : !linalg.view, !linalg.range, !linalg.range, !linalg.view +// TILE-1D: %[[fullC:.*]] = linalg.view %[[tmpC]][{{.*}}] : !linalg.buffer<6xf32> -> memref +// TILE-1D: %[[partialC:.*]] = linalg.slice %[[fullC]][%{{.*}}, %{{.*}}] : memref, !linalg.range, !linalg.range, memref -// TILE-1D: linalg.fill(%[[fullA]], {{.*}}) : !linalg.view, f32 -// TILE-1D: linalg.fill(%[[fullB]], {{.*}}) : !linalg.view, f32 -// TILE-1D: linalg.fill(%[[fullC]], {{.*}}) : !linalg.view, f32 -// TILE-1D: linalg.copy(%[[vA]], %[[partialA]]) : !linalg.view, !linalg.view -// TILE-1D: linalg.copy(%[[vB]], %[[partialB]]) : !linalg.view, !linalg.view -// TILE-1D: linalg.copy(%[[vC]], %[[partialC]]) : !linalg.view, !linalg.view +// TILE-1D: linalg.fill(%[[fullA]], {{.*}}) : memref, f32 +// TILE-1D: linalg.fill(%[[fullB]], {{.*}}) : memref, f32 +// TILE-1D: linalg.fill(%[[fullC]], {{.*}}) : memref, f32 +// TILE-1D: linalg.copy(%[[vA]], %[[partialA]]) : memref, memref +// TILE-1D: linalg.copy(%[[vB]], %[[partialB]]) : memref, memref +// TILE-1D: linalg.copy(%[[vC]], %[[partialC]]) : memref, memref // -// TILE-1D: linalg.matmul(%[[fullA]], %[[fullB]], %[[fullC]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-1D: linalg.matmul(%[[fullA]], %[[fullB]], %[[fullC]]) : memref, memref, memref // -// TILE-1D: linalg.copy(%[[partialC]], %[[vC]]) : !linalg.view, !linalg.view +// TILE-1D: linalg.copy(%[[partialC]], %[[vC]]) : memref, memref // // TILE-1D: linalg.buffer_dealloc %[[tmpA]] : !linalg.buffer<8xf32> // TILE-1D: linalg.buffer_dealloc %[[tmpB]] : !linalg.buffer<12xf32> diff --git a/mlir/test/Dialect/Linalg/roundtrip.mlir b/mlir/test/Dialect/Linalg/roundtrip.mlir index eefa409e2fc..58aa805d743 100644 --- a/mlir/test/Dialect/Linalg/roundtrip.mlir +++ b/mlir/test/Dialect/Linalg/roundtrip.mlir @@ -1,5 +1,14 @@ // RUN: mlir-opt %s | mlir-opt | FileCheck %s +// CHECK-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +#strided1D = (d0)[s0] -> (d0 + s0) +// CHECK-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// CHECK-DAG: #[[strided3D:.*]] = (d0, d1, d2)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2 + d2) +#strided3D = (d0, d1, d2)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2 + d2) +// CHECK-DAG: #[[strided6D:.*]] = (d0, d1, d2, d3, d4, d5)[s0, s1, s2, s3, s4, s5, s6] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3 * s4 + d4 * s5 + d5 * s6) +#strided6D = (d0, d1, d2, d3, d4, d5)[s0, s1, s2, s3, s4, s5, s6] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3 * s4 + d4 * s5 + d5 * s6) + // CHECK-DAG: #[[map0:.*]] = (d0, d1, d2) -> (d0, d2, d1) // CHECK-DAG: #[[map1:.*]] = (d0, d1, d2) -> (d2, d1, d0) @@ -40,21 +49,16 @@ func @buffer(%arg0: index, %arg1: index) { // CHECK-NEXT: linalg.buffer_dealloc %{{.*}} : !linalg.buffer> // CHECK-NEXT: linalg.buffer_dealloc %{{.*}} : !linalg.buffer> -func @view_fun(%arg0: !linalg.view>) { - return -} -// CHECK-LABEL: func @view_fun(%{{.*}}: !linalg.view>) { - func @views(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4: index) { %0 = muli %arg0, %arg0 : index %1 = linalg.buffer_alloc %0 : !linalg.buffer %2 = linalg.range %arg2:%arg3:%arg4 : !linalg.range - %3 = linalg.view %1[%2, %2] : !linalg.buffer -> !linalg.view - %4 = linalg.slice %3[%2, %2] : !linalg.view, !linalg.range, !linalg.range, !linalg.view - %5 = linalg.slice %3[%2, %arg2] : !linalg.view, !linalg.range, index, !linalg.view - %6 = linalg.slice %3[%arg2, %2] : !linalg.view, index, !linalg.range, !linalg.view - %7 = linalg.slice %3[%arg2, %arg3] : !linalg.view, index, index, !linalg.view - %8 = linalg.view %1[%2, %2] : !linalg.buffer -> !linalg.view> + %3 = linalg.view %1[%2, %2] : !linalg.buffer -> memref + %4 = linalg.slice %3[%2, %2] : memref, !linalg.range, !linalg.range, memref + %5 = linalg.slice %3[%2, %arg2] : memref, !linalg.range, index, memref + %6 = linalg.slice %3[%arg2, %2] : memref, index, !linalg.range, memref + %7 = linalg.slice %3[%arg2, %arg3] : memref, index, index, memref + %8 = linalg.view %1[%2, %2] : !linalg.buffer -> memref, #strided2D> linalg.buffer_dealloc %1 : !linalg.buffer return } @@ -62,33 +66,35 @@ func @views(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4: index // CHECK-NEXT: muli %{{.*}}, %{{.*}} : index // CHECK-NEXT: linalg.buffer_alloc %{{.*}} : !linalg.buffer // CHECK-NEXT: linalg.range %{{.*}}:%{{.*}}:%{{.*}} : !linalg.range -// CHECK-NEXT: linalg.view %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.buffer -> !linalg.view -// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.view, !linalg.range, !linalg.range, !linalg.view -// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.view, !linalg.range, index, !linalg.view -// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.view, index, !linalg.range, !linalg.view -// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.view, index, index, !linalg.view -// CHECK-NEXT: linalg.view %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.buffer -> !linalg.view> +// CHECK-NEXT: linalg.view %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.buffer -> memref +// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : memref, !linalg.range, !linalg.range, memref +// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : memref, !linalg.range, index, memref +// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : memref, index, !linalg.range, memref +// CHECK-NEXT: linalg.slice %{{.*}}[%{{.*}}, %{{.*}}] : memref, index, index, memref +// CHECK-NEXT: linalg.view %{{.*}}[%{{.*}}, %{{.*}}] : !linalg.buffer -> memref, #[[strided2D]]> // CHECK-NEXT: linalg.buffer_dealloc %{{.*}} : !linalg.buffer -func @ops(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view, %arg3: !linalg.view) { - linalg.matmul(%arg0, %arg0, %arg0) : !linalg.view, !linalg.view, !linalg.view - linalg.matvec(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view - linalg.dot(%arg1, %arg2, %arg3) : !linalg.view, !linalg.view, !linalg.view +func @ops(%arg0: memref, %arg1: memref, %arg2: memref, %arg3: memref) { + linalg.matmul(%arg0, %arg0, %arg0) : memref, memref, memref + linalg.matvec(%arg0, %arg1, %arg2) : memref, memref, memref + linalg.dot(%arg1, %arg2, %arg3) : memref, memref, memref return } -// CHECK-LABEL: func @ops(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK-NEXT: linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : !linalg.view, !linalg.view, !linalg.view -// CHECK-NEXT: linalg.matvec(%{{.*}}, %{{.*}}, %{{.*}}) : !linalg.view, !linalg.view, !linalg.view -// CHECK-NEXT: linalg.dot(%{{.*}}, %{{.*}}, %{{.*}}) : !linalg.view, !linalg.view, !linalg.view +// CHECK-LABEL: func @ops(% +// CHECK: {{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK-NEXT: linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref +// CHECK-NEXT: linalg.matvec(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref +// CHECK-NEXT: linalg.dot(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref -func @dim(%arg0: !linalg.view) { - %0 = linalg.dim %arg0, 1 : !linalg.view +func @dim(%arg0: memref) { + %0 = dim %arg0, 1 : memref %1 = linalg.buffer_alloc %0 : !linalg.buffer linalg.buffer_dealloc %1 : !linalg.buffer return } -// CHECK-LABEL: func @dim(%{{.*}}: !linalg.view) { -// CHECK-NEXT: linalg.dim %{{.*}}, 1 : !linalg.view +// CHECK-LABEL: func @dim( +// CHECK: %{{.*}}: memref) { +// CHECK-NEXT: dim %{{.*}}, 1 : memref // CHECK-NEXT: linalg.buffer_alloc %{{.*}} : !linalg.buffer // CHECK-NEXT: linalg.buffer_dealloc %{{.*}} : !linalg.buffer @@ -105,7 +111,8 @@ func @linalg_for(%arg0 : index, %arg1 : index, %arg2 : index) { } return } -// CHECK-LABEL: func @linalg_for(%{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { +// CHECK-LABEL: func @linalg_for( +// CHECK: %{{.*}}: index, %{{.*}}: index, %{{.*}}: index) { // CHECK-NEXT: loop.for %{{.*}} to %{{.*}} step %{{.*}} { // CHECK-NEXT: loop.for %{{.*}} to %{{.*}} step %{{.*}} { // CHECK-NEXT: cmpi "slt", %{{.*}}, %{{.*}} : index @@ -114,70 +121,77 @@ func @linalg_for(%arg0 : index, %arg1 : index, %arg2 : index) { // CHECK-NEXT: select %{{.*}}, %{{.*}}, %{{.*}} : index // CHECK-NEXT: loop.for %{{.*}} to %{{.*}} step %{{.*}} { -func @fill_view(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill_view(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } -// CHECK-LABEL: func @fill_view(%{{.*}}: !linalg.view, %{{.*}}: f32) { -// CHECK: linalg.fill(%{{.*}}, %{{.*}}) : !linalg.view, f32 +// CHECK-LABEL: func @fill_view( +// CHECK: %{{.*}}: memref, %{{.*}}: f32) { +// CHECK: linalg.fill(%{{.*}}, %{{.*}}) : memref, f32 -func @transpose(%arg0: !linalg.view) { - %0 = linalg.transpose %arg0 (i, j, k) -> (k, j, i) : !linalg.view +func @transpose(%arg0: memref) { + %0 = linalg.transpose %arg0 (i, j, k) -> (k, j, i) : memref return } // CHECK-LABEL: func @transpose -// CHECK: linalg.transpose %{{.*}} ([[i:.*]], [[j:.*]], [[k:.*]]) -> ([[k]], [[j]], [[i]]) : !linalg.view +// CHECK: linalg.transpose %{{.*}} ([[i:.*]], [[j:.*]], [[k:.*]]) -> ([[k]], [[j]], [[i]]) : memref -func @fill_view3(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill_view3(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } -// CHECK-LABEL: func @fill_view3(%{{.*}}: !linalg.view, %{{.*}}: f32) { -// CHECK: linalg.fill(%{{.*}}, %{{.*}}) : !linalg.view, f32 +// CHECK-LABEL: func @fill_view3( +// CHECK: %{{.*}}: memref, %{{.*}}: f32) { +// CHECK: linalg.fill(%{{.*}}, %{{.*}}) : memref, f32 -func @copy_view(%arg0: !linalg.view, %arg1: !linalg.view) { - linalg.copy(%arg0, %arg1) : !linalg.view, !linalg.view +func @copy_view(%arg0: memref, %arg1: memref) { + linalg.copy(%arg0, %arg1) : memref, memref return } -// CHECK-LABEL: func @copy_view(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: linalg.copy(%{{.*}}, %{{.*}}) : !linalg.view, !linalg.view +// CHECK-LABEL: func @copy_view( +// CHECK: %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: linalg.copy(%{{.*}}, %{{.*}}) : memref, memref -func @copy_view3(%arg0: !linalg.view, %arg1: !linalg.view) { +func @copy_view3(%arg0: memref, %arg1: memref) { linalg.copy(%arg0, %arg1) {inputPermutation = (i, j, k) -> (i, k, j), outputPermutation = (i, j, k) -> (k, j, i)} : - !linalg.view, !linalg.view + memref, memref return } -// CHECK-LABEL: func @copy_view3(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: linalg.copy(%{{.*}}, %{{.*}}) {inputPermutation = #[[map0]], outputPermutation = #[[map1]]} : !linalg.view, !linalg.view +// CHECK-LABEL: func @copy_view3( +// CHECK: %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: linalg.copy(%{{.*}}, %{{.*}}) {inputPermutation = #[[map0]], outputPermutation = #[[map1]]} : memref, memref -func @conv_view3(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.conv(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +func @conv_view3(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.conv(%arg0, %arg1, %arg2) : memref, memref, memref return } -// CHECK-LABEL: func @conv_view3(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: linalg.conv(%{{.*}}, %{{.*}}, %{{.*}}) : !linalg.view, !linalg.view, !linalg.view +// CHECK-LABEL: func @conv_view3( +// CHECK: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: linalg.conv(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref -func @conv_view6(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : !linalg.view, !linalg.view, !linalg.view +func @conv_view6(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : memref, memref, memref return } -// CHECK-LABEL: func @conv_view6(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// CHECK: linalg.conv(%{{.*}}, %{{.*}}, %{{.*}}) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : !linalg.view, !linalg.view, !linalg.view +// CHECK-LABEL: func @conv_view6( +// CHECK: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// CHECK: linalg.conv(%{{.*}}, %{{.*}}, %{{.*}}) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : memref, memref, memref -func @subview(%arg0: !linalg.view>) { +func @subview(%arg0: memref, #strided2D>) { %c0 = constant 0 : index - %0 = linalg.subview %arg0[%c0, %c0, %c0, %c0, %c0, %c0] : !linalg.view> + %0 = linalg.subview %arg0[%c0, %c0, %c0, %c0, %c0, %c0] : memref, #strided2D> return } -// CHECK-LABEL: func @subview(%{{.*}}: !linalg.view>) { +// CHECK-LABEL: func @subview( +// CHECK: %{{.*}}: memref, #[[strided2D]]>) { // CHECK: constant 0 : index -// CHECK: linalg.subview %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : !linalg.view> +// CHECK: linalg.subview %{{.*}}[%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}] : memref, #[[strided2D]]> func @const_buffer_view(%arg0: index, %arg1: index, %arg2: index) { %c0 = linalg.buffer_alloc : !linalg.buffer<17xf32> %c1 = linalg.range %arg0:%arg1:%arg2 : !linalg.range - %c2 = linalg.view %c0[%c1] : !linalg.buffer<17xf32> -> !linalg.view + %c2 = linalg.view %c0[%c1] : !linalg.buffer<17xf32> -> memref return } @@ -196,13 +210,13 @@ func @foo(%0: vector<3x4xi4>, %1: f32) -> f32 { %f0 = constant 0.0 : f32 return %f0 : f32 } -func @generic(%arg0: !linalg.view>, %arg1: !linalg.view) { - linalg.generic #trait %arg0, %arg1 {foo = 1} : !linalg.view>, !linalg.view +func @generic(%arg0: memref, #strided2D>, %arg1: memref) { + linalg.generic #trait %arg0, %arg1 {foo = 1} : memref, #strided2D>, memref return } // CHECK-LABEL: func @foo // CHECK-LABEL: func @generic -// CHECK: linalg.generic {fun = @foo, indexing_maps = [#map2, #map3], library_call = "external_function_name", n_loop_types = [3, 0, 0], n_views = [1, 1]} %{{.*}}, %{{.*}} {foo = 1 : i64}: !linalg.view>, !linalg.view +// CHECK: linalg.generic {fun = @foo, indexing_maps = [#{{.*}}, #{{.*}}], library_call = "external_function_name", n_loop_types = [3, 0, 0], n_views = [1, 1]} %{{.*}}, %{{.*}} {foo = 1 : i64}: memref, #[[strided2D]]>, memref #trait2 = { indexing_maps = #accesses, @@ -210,15 +224,15 @@ func @generic(%arg0: !linalg.view>, %arg1: !linalg.view>, %arg1: !linalg.view) { +func @generic_region(%arg0: memref, #strided2D>, %arg1: memref) { linalg.generic #trait2 %arg0, %arg1 { ^bb(%a: vector<3x4xi4>, %b: f32) : linalg.yield %b : f32 - } {foo = 1}: !linalg.view>, !linalg.view + } {foo = 1}: memref, #strided2D>, memref return } // CHECK-LABEL: func @generic_region -// CHECK: linalg.generic {indexing_maps = [#map2, #map3], library_call = "external_function_name", n_loop_types = [3, 0, 0], n_views = [1, 1]} %{{.*}}, %{{.*}} { +// CHECK: linalg.generic {indexing_maps = [#{{.*}}, #{{.*}}], library_call = "external_function_name", n_loop_types = [3, 0, 0], n_views = [1, 1]} %{{.*}}, %{{.*}} { // CHECK: ^{{.*}}(%{{.*}}: vector<3x4xi4>, %{{.*}}: f32): // no predecessors // CHECK: linalg.yield %{{.*}} : f32 -// CHECK: } {foo = 1 : i64}: !linalg.view>, !linalg.view \ No newline at end of file +// CHECK: } {foo = 1 : i64}: memref, #[[strided2D]]>, memref diff --git a/mlir/test/Dialect/Linalg/tile.mlir b/mlir/test/Dialect/Linalg/tile.mlir index c3d6826aa40..6ace5831ae3 100644 --- a/mlir/test/Dialect/Linalg/tile.mlir +++ b/mlir/test/Dialect/Linalg/tile.mlir @@ -10,134 +10,146 @@ // TILE-234-DAG: #[[UB1:.*]] = (d0) -> (d0 + 3) // TILE-234-DAG: #[[UB2:.*]] = (d0) -> (d0 + 4) -func @matmul(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.matmul(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +// TILE-2-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +// TILE-02-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +// TILE-002-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +// TILE-234-DAG: #[[strided1D:.*]] = (d0)[s0] -> (d0 + s0) +#strided1D = (d0)[s0] -> (d0 + s0) +// CHECK-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// TILE-2-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// TILE-02-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// TILE-002-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +// TILE-234-DAG: #[[strided2D:.*]] = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) + +func @matmul(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.matmul(%arg0, %arg1, %arg2) : memref, memref, memref return } -// TILE-2-LABEL: func @matmul(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-2: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-2-LABEL: func @matmul( +// TILE-2: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-2: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[M]] step %{{.*}} { // TILE-2: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[K:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}, %{{.*}}, %[[K]], %{{.*}}] : !linalg.view +// TILE-2: %[[K:.*]] = dim %{{.*}}, 1 : memref +// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}, %{{.*}}, %[[K]], %{{.*}}] : memref // TILE-2: %[[c:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[N:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-2: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[c]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : !linalg.view -// TILE-2: linalg.matmul(%[[sAi]], %{{.*}}, %[[sCi]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-2: %[[N:.*]] = dim %{{.*}}, 1 : memref +// TILE-2: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[c]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : memref +// TILE-2: linalg.matmul(%[[sAi]], %{{.*}}, %[[sCi]]) : memref, memref, memref -// TILE-02-LABEL: func @matmul(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-02: %[[N:.*]] = linalg.dim %arg1, 1 : !linalg.view +// TILE-02-LABEL: func @matmul( +// TILE-02: %[[N:.*]] = dim %arg1, 1 : memref // TILE-02: loop.for %{{.*}} = %{{.*}} to %[[N]] step %{{.*}} { -// TILE-02: %[[K:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-02: %[[K:.*]] = dim %{{.*}}, 0 : memref // TILE-02: %[[b:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-02: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[K]], %{{.*}}, %{{.*}}, %[[b]], %{{.*}}] : !linalg.view -// TILE-02: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-02: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[K]], %{{.*}}, %{{.*}}, %[[b]], %{{.*}}] : memref +// TILE-02: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-02: %[[c:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-02: %[[sCj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[c]], %{{.*}}] : !linalg.view -// TILE-02: linalg.matmul(%{{.*}}, %[[sBj]], %[[sCj]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-02: %[[sCj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[c]], %{{.*}}] : memref +// TILE-02: linalg.matmul(%{{.*}}, %[[sBj]], %[[sCj]]) : memref, memref, memref -// TILE-002-LABEL: func @matmul(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-002: %[[K:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-002-LABEL: func @matmul( +// TILE-002: %[[K:.*]] = dim %{{.*}}, 1 : memref // TILE-002: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[K]] step %{{.*}} { -// TILE-002: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-002: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-002: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-002: %[[sAj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[a]], %{{.*}}] : !linalg.view +// TILE-002: %[[sAj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[a]], %{{.*}}] : memref // TILE-002: %[[b:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-002: %[[N:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-002: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : !linalg.view -// TILE-002: linalg.matmul(%[[sAj]], %[[sBj]], %{{.*}}) : !linalg.view, !linalg.view, !linalg.view - -// TILE-234-LABEL: func @matmul(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-234: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view -// TILE-234: %[[K:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-234: %[[N:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-002: %[[N:.*]] = dim %{{.*}}, 1 : memref +// TILE-002: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : memref +// TILE-002: linalg.matmul(%[[sAj]], %[[sBj]], %{{.*}}) : memref, memref, memref + +// TILE-234-LABEL: func @matmul( +// TILE-234: %[[M:.*]] = dim %{{.*}}, 0 : memref +// TILE-234: %[[K:.*]] = dim %{{.*}}, 1 : memref +// TILE-234: %[[N:.*]] = dim %{{.*}}, 1 : memref // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[M]] step %{{.*}} { // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[N]] step %{{.*}} { // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[K]] step %{{.*}} { // TILE-234: %[[ai:.*]] = affine.apply #[[UB0]](%{{.*}}) // TILE-234: %[[ak:.*]] = affine.apply #[[UB2]](%{{.*}}) -// TILE-234: %[[sAik:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ai]], %{{.*}}, %{{.*}}, %[[ak]], %{{.*}}] : !linalg.view +// TILE-234: %[[sAik:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ai]], %{{.*}}, %{{.*}}, %[[ak]], %{{.*}}] : memref // TILE-234: %[[bk:.*]] = affine.apply #[[UB2]](%{{.*}}) // TILE-234: %[[bj:.*]] = affine.apply #[[UB1]](%{{.*}}) -// TILE-234: %[[sBkj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[bk]], %{{.*}}, %{{.*}}, %[[bj]], %{{.*}}] : !linalg.view +// TILE-234: %[[sBkj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[bk]], %{{.*}}, %{{.*}}, %[[bj]], %{{.*}}] : memref // TILE-234: %[[ci:.*]] = affine.apply #[[UB0]](%{{.*}}) // TILE-234: %[[cj:.*]] = affine.apply #[[UB1]](%{{.*}}) -// TILE-234: %[[sCij:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ci]], %{{.*}}, %{{.*}}, %[[cj]], %{{.*}}] : !linalg.view +// TILE-234: %[[sCij:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ci]], %{{.*}}, %{{.*}}, %[[cj]], %{{.*}}] : memref // -// TILE-234: linalg.matmul(%[[sAik]], %[[sBkj]], %[[sCij]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-234: linalg.matmul(%[[sAik]], %[[sBkj]], %[[sCij]]) : memref, memref, memref -func @matvec(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.matvec(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +func @matvec(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.matvec(%arg0, %arg1, %arg2) : memref, memref, memref return } -// TILE-2-LABEL: func @matvec(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-2: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-2-LABEL: func @matvec( +// TILE-2: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-2: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[M]] step %{{.*}} { // TILE-2: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[N:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : !linalg.view +// TILE-2: %[[N:.*]] = dim %{{.*}}, 1 : memref +// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}, %{{.*}}, %[[N]], %{{.*}}] : memref // TILE-2: %[[c:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[c]], %{{.*}}] : !linalg.view -// TILE-2: linalg.matvec(%[[sAi]], %{{.*}}, %[[sCi]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-2: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[c]], %{{.*}}] : memref +// TILE-2: linalg.matvec(%[[sAi]], %{{.*}}, %[[sCi]]) : memref, memref, memref -// TILE-02-LABEL: func @matvec(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-02: %[[K:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-02-LABEL: func @matvec( +// TILE-02: %[[K:.*]] = dim %{{.*}}, 1 : memref // TILE-02: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[K]] step %{{.*}} { -// TILE-02: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-02: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-02: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-02: %[[sAj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[a]], %{{.*}}] : !linalg.view +// TILE-02: %[[sAj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[M]], %{{.*}}, %{{.*}}, %[[a]], %{{.*}}] : memref // TILE-02: %[[b:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-02: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : !linalg.view -// TILE-02: linalg.matvec(%[[sAj]], %[[sBj]], %{{.*}}) : !linalg.view, !linalg.view, !linalg.view +// TILE-02: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : memref +// TILE-02: linalg.matvec(%[[sAj]], %[[sBj]], %{{.*}}) : memref, memref, memref -// TILE-002-LABEL: func @matvec(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { +// TILE-002-LABEL: func @matvec( // TILE-002-NOT: loop.for -// TILE-234-LABEL: func @matvec(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-234: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view -// TILE-234: %[[K:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-234-LABEL: func @matvec( +// TILE-234: %[[M:.*]] = dim %{{.*}}, 0 : memref +// TILE-234: %[[K:.*]] = dim %{{.*}}, 1 : memref // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[M]] step %{{.*}} { // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[K]] step %{{.*}} { // TILE-234: %[[ai:.*]] = affine.apply #[[UB0]](%{{.*}}) // TILE-234: %[[aj:.*]] = affine.apply #[[UB1]](%{{.*}}) -// TILE-234: %[[sAij:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ai]], %{{.*}}, %{{.*}}, %[[aj]], %{{.*}}] : !linalg.view +// TILE-234: %[[sAij:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ai]], %{{.*}}, %{{.*}}, %[[aj]], %{{.*}}] : memref // TILE-234: %[[bj:.*]] = affine.apply #[[UB1]](%{{.*}}) -// TILE-234: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[bj]], %{{.*}}] : !linalg.view +// TILE-234: %[[sBj:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[bj]], %{{.*}}] : memref // TILE-234: %[[ci:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-234: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ci]], %{{.*}}] : !linalg.view +// TILE-234: %[[sCi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[ci]], %{{.*}}] : memref // -// TILE-234: linalg.matvec(%[[sAij]], %[[sBj]], %[[sCi]]) : !linalg.view, !linalg.view, !linalg.view +// TILE-234: linalg.matvec(%[[sAij]], %[[sBj]], %[[sCi]]) : memref, memref, memref -func @dot(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.dot(%arg0, %arg1, %arg2) : !linalg.view, !linalg.view, !linalg.view +func @dot(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.dot(%arg0, %arg1, %arg2) : memref, memref, memref return } -// TILE-2-LABEL: func @dot(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-2: %[[M:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-2-LABEL: func @dot( +// TILE-2: %[[M:.*]] = dim %{{.*}}, 0 : memref // TILE-2: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[M]] step %{{.*}} { // TILE-2: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}] : !linalg.view +// TILE-2: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}] : memref // TILE-2: %[[b:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-2: %[[sBi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : !linalg.view -// TILE-2: linalg.dot(%[[sAi]], %[[sBi]], {{.*}}) : !linalg.view, !linalg.view, !linalg.view +// TILE-2: %[[sBi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : memref +// TILE-2: linalg.dot(%[[sAi]], %[[sBi]], {{.*}}) : memref, memref, memref -// TILE-02-LABEL: func @dot(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { +// TILE-02-LABEL: func @dot( // TILE-02-NOT: loop.for -// TILE-002-LABEL: func @dot(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { +// TILE-002-LABEL: func @dot( // TILE-002-NOT: loop.for -// TILE-234-LABEL: func @dot(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-234: %[[K:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view +// TILE-234-LABEL: func @dot( +// TILE-234: %[[K:.*]] = dim %{{.*}}, 0 : memref // TILE-234: loop.for %{{.*}} = %{{.*}}{{.*}} to %[[K]] step %{{.*}} { // TILE-234: %[[a:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-234: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}] : !linalg.view +// TILE-234: %[[sAi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[a]], %{{.*}}] : memref // TILE-234: %[[b:.*]] = affine.apply #[[UB0]](%{{.*}}) -// TILE-234: %[[sBi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : !linalg.view -// TILE-234: linalg.dot(%[[sAi]], %[[sBi]], %{{.*}}) : !linalg.view, !linalg.view, !linalg.view +// TILE-234: %[[sBi:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[b]], %{{.*}}] : memref +// TILE-234: linalg.dot(%[[sAi]], %[[sBi]], %{{.*}}) : memref, memref, memref -func @fill(%arg0: !linalg.view, %arg1: f32) { - linalg.fill(%arg0, %arg1) : !linalg.view, f32 +func @fill(%arg0: memref, %arg1: f32) { + linalg.fill(%arg0, %arg1) : memref, f32 return } // TILE-2-LABEL: func @fill @@ -167,13 +179,13 @@ func @fill(%arg0: !linalg.view, %arg1: f32) { n_views = [2, 1] } -func @pointwise(%arg0: !linalg.view, %arg1: !linalg.view, - %arg2: !linalg.view) { +func @pointwise(%arg0: memref, %arg1: memref, + %arg2: memref) { linalg.generic #pointwise_2d_trait %arg0, %arg1, %arg2 { ^bb0(%arg4: f32, %arg5: f32, %arg6: f32): // no predecessors %4 = addf %arg4, %arg5 : f32 linalg.yield %4 : f32 - }: !linalg.view, !linalg.view, !linalg.view + }: memref, memref, memref return } // TILE-2-LABEL: func @pointwise diff --git a/mlir/test/Dialect/Linalg/tile_conv.mlir b/mlir/test/Dialect/Linalg/tile_conv.mlir index 128161e8888..a06b9f1812d 100644 --- a/mlir/test/Dialect/Linalg/tile_conv.mlir +++ b/mlir/test/Dialect/Linalg/tile_conv.mlir @@ -5,35 +5,39 @@ // TILE-23004-DAG: #[[UB2:.*]] = (d0) -> (d0 + 4) // TILE-23004-DAG: #[[D0x30pS0x10:.*]] = (d0) -> (d0 * 30) // TILE-23004-DAG: #[[D0x30pS0x10p90:.*]] = (d0)[s0] -> (d0 * 30 + s0 * 10 + 90) -func @conv(%arg0: !linalg.view, %arg1: !linalg.view, %arg2: !linalg.view) { - linalg.conv(%arg0, %arg1, %arg2) {dilations = [10, 20], strides = [30, 40]} : !linalg.view, !linalg.view, !linalg.view +// TILE-23004-DAG: #[[strided4D:.*]] = (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3) +#strided4D = (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 * s1 + s0 + d1 * s2 + d2 * s3 + d3) + +func @conv(%arg0: memref, %arg1: memref, %arg2: memref) { + linalg.conv(%arg0, %arg1, %arg2) {dilations = [10, 20], strides = [30, 40]} : memref, memref, memref return } -// TILE-23004-LABEL: func @conv(%{{.*}}: !linalg.view, %{{.*}}: !linalg.view, %{{.*}}: !linalg.view) { -// TILE-23004: %[[Q:.*]] = linalg.dim %{{.*}}, 2 : !linalg.view -// TILE-23004: %[[B:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view -// TILE-23004: %[[PaddedInput0:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view -// TILE-23004: %[[X0:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-23004-LABEL: func @conv( +// TILE-23004: %{{.*}}: memref, %{{.*}}: memref, %{{.*}}: memref) { +// TILE-23004: %[[Q:.*]] = dim %{{.*}}, 2 : memref +// TILE-23004: %[[B:.*]] = dim %{{.*}}, 0 : memref +// TILE-23004: %[[PaddedInput0:.*]] = dim %{{.*}}, 1 : memref +// TILE-23004: %[[X0:.*]] = dim %{{.*}}, 1 : memref // TILE-23004: loop.for %{{.*}} = %{{.*}} to %[[B]] step %{{.*}} { // TILE-23004: loop.for %{{.*}} = %{{.*}} to %[[X0]] step %{{.*}} { // TILE-23004: loop.for %{{.*}} = %{{.*}} to %[[Q]] step %{{.*}} { -// TILE-23004: %[[Z0:.*]] = linalg.dim %{{.*}}, 0 : !linalg.view -// TILE-23004: %[[Z1:.*]] = linalg.dim %{{.*}}, 1 : !linalg.view +// TILE-23004: %[[Z0:.*]] = dim %{{.*}}, 0 : memref +// TILE-23004: %[[Z1:.*]] = dim %{{.*}}, 1 : memref // TILE-23004: %[[I2p4:.*]] = affine.apply #[[UB2]](%{{.*}}) -// TILE-23004: %[[K:.*]] = linalg.dim %{{.*}}, 3 : !linalg.view -// TILE-23004: %[[FilterView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[Z0]], %{{.*}}, %{{.*}}, %[[Z1]], %{{.*}}, %{{.*}}, %[[I2p4]], %{{.*}}, %{{.*}}, %[[K]], %{{.*}}] : !linalg.view +// TILE-23004: %[[K:.*]] = dim %{{.*}}, 3 : memref +// TILE-23004: %[[FilterView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[Z0]], %{{.*}}, %{{.*}}, %[[Z1]], %{{.*}}, %{{.*}}, %[[I2p4]], %{{.*}}, %{{.*}}, %[[K]], %{{.*}}] : memref // // TILE-23004: %[[I0p3:.*]] = affine.apply #[[UB0]](%{{.*}}) // TILE-23004: %[[I1:.*]] = affine.apply #[[D0x30pS0x10]](%{{.*}}) // TILE-23004: %[[I1pStep:.*]] = affine.apply #[[D0x30pS0x10p90]](%{{.*}})[%[[PaddedInput0]]] -// TILE-23004: %[[SZ2:.*]] = linalg.dim %{{.*}}, 2 : !linalg.view +// TILE-23004: %[[SZ2:.*]] = dim %{{.*}}, 2 : memref // TILE-23004: %[[I2p2:.*]] = affine.apply #[[UB2]](%{{.*}}) -// TILE-23004: %[[InputView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[I0p3]], %{{.*}}, %[[I1]], %[[I1pStep]], %{{.*}}, %{{.*}}, %[[SZ2]], %{{.*}}, %{{.*}}, %[[I2p2]], %{{.*}}] : !linalg.view +// TILE-23004: %[[InputView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[I0p3]], %{{.*}}, %[[I1]], %[[I1pStep]], %{{.*}}, %{{.*}}, %[[SZ2]], %{{.*}}, %{{.*}}, %[[I2p2]], %{{.*}}] : memref // // TILE-23004: %[[B:.*]] = affine.apply #[[UB0]](%{{.*}}) // TILE-23004: %[[I1p3:.*]] = affine.apply #[[UB1]](%{{.*}}) -// TILE-23004: %[[X0:.*]] = linalg.dim %{{.*}}, 2 : !linalg.view -// TILE-23004: %[[X1:.*]] = linalg.dim %{{.*}}, 3 : !linalg.view -// TILE-23004: %[[OutputView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[B]], %{{.*}}, %{{.*}}, %[[I1p3]], %{{.*}}, %{{.*}}, %[[X0]], %{{.*}}, %{{.*}}, %[[X1]], %{{.*}}] : !linalg.view +// TILE-23004: %[[X0:.*]] = dim %{{.*}}, 2 : memref +// TILE-23004: %[[X1:.*]] = dim %{{.*}}, 3 : memref +// TILE-23004: %[[OutputView:.*]] = linalg.subview %{{.*}}[%{{.*}}, %[[B]], %{{.*}}, %{{.*}}, %[[I1p3]], %{{.*}}, %{{.*}}, %[[X0]], %{{.*}}, %{{.*}}, %[[X1]], %{{.*}}] : memref // -// TILE-23004: linalg.conv(%[[FilterView]], %[[InputView]], %[[OutputView]]) {dilations = [10, 20], strides = [30, 40]} : !linalg.view, !linalg.view, !linalg.view +// TILE-23004: linalg.conv(%[[FilterView]], %[[InputView]], %[[OutputView]]) {dilations = [10, 20], strides = [30, 40]} : memref, memref, memref diff --git a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp index 6efaec30be8..01dfdeeb0c8 100644 --- a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp +++ b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp @@ -35,15 +35,13 @@ void TestMemRefStrideCalculation::runOnFunction() { llvm::outs() << "Testing: " << getFunction().getName() << "\n"; getFunction().walk([&](AllocOp allocOp) { auto memrefType = allocOp.getResult()->getType().cast(); - SmallVector strideVector; - if (failed(memrefType.getStridesAndOffset(strideVector))) { + int64_t offset; + SmallVector strides; + if (failed(memrefType.getStridesAndOffset(strides, offset))) { llvm::outs() << "MemRefType " << memrefType << " cannot be converted to " << "strided form\n"; return; } - ArrayRef strides(strideVector); - auto offset = strides.back(); - strides = strides.drop_back(); llvm::outs() << "MemRefType offset: "; if (offset == MemRefType::kDynamicStrideOrOffset) llvm::outs() << "?"; diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index 514d5229d73..aae3112276e 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -29,23 +29,21 @@ template struct ViewType { unsigned long strides[N]; }; -// This is separated out to avoid `unsigned long sizes[0]` which triggers: -// warning: ISO C++ forbids zero-size array [-Wpedantic] template struct ViewType { T *data; unsigned long offset; }; extern "C" void linalg_fill_viewf32_f32(ViewType *X, float f) { - *(X->data + X->offset) = f; + X->data[X->offset] = f; } -extern "C" void linalg_fill_viewxf32_f32(ViewType *X, float f) { +extern "C" void linalg_fill_viewsxf32_f32(ViewType *X, float f) { for (unsigned i = 0; i < X->sizes[0]; ++i) *(X->data + X->offset + i * X->strides[0]) = f; } -extern "C" void linalg_fill_viewxxf32_f32(ViewType *X, float f) { +extern "C" void linalg_fill_viewsxsxf32_f32(ViewType *X, float f) { for (unsigned i = 0; i < X->sizes[0]; ++i) for (unsigned j = 0; j < X->sizes[1]; ++j) *(X->data + X->offset + i * X->strides[0] + j * X->strides[1]) = f; @@ -56,16 +54,16 @@ extern "C" void linalg_copy_viewf32_viewf32(ViewType *I, O->data[O->offset] = I->data[I->offset]; } -extern "C" void linalg_copy_viewxf32_viewxf32(ViewType *I, - ViewType *O) { +extern "C" void linalg_copy_viewsxf32_viewsxf32(ViewType *I, + ViewType *O) { assert(I->sizes[0] == O->sizes[0]); for (unsigned i = 0; i < I->sizes[0]; ++i) O->data[O->offset + i * O->strides[0]] = I->data[I->offset + i * I->strides[0]]; } -extern "C" void linalg_copy_viewxxf32_viewxxf32(ViewType *I, - ViewType *O) { +extern "C" void linalg_copy_viewsxsxf32_viewsxsxf32(ViewType *I, + ViewType *O) { assert(I->sizes[0] == O->sizes[0]); assert(I->sizes[1] == O->sizes[1]); auto so0 = O->strides[0], so1 = O->strides[1]; @@ -76,18 +74,18 @@ extern "C" void linalg_copy_viewxxf32_viewxxf32(ViewType *I, I->data[I->offset + i * si0 + j * si1]; } -extern "C" void linalg_dot_viewxf32_viewxf32_viewf32(ViewType *X, - ViewType *Y, - ViewType *Z) { +extern "C" void linalg_dot_viewsxf32_viewsxf32_viewf32(ViewType *X, + ViewType *Y, + ViewType *Z) { assert(X->strides[0] == 1); assert(Y->strides[0] == 1); assert(X->sizes[0] == Y->sizes[0] && "Expected X and Y of same size"); - *(Z->data + Z->offset) += + Z->data[Z->offset] += cblas_sdot(X->sizes[0], X->data + X->offset, X->strides[0], Y->data + Y->offset, Y->strides[0]); } -extern "C" void linalg_matmul_viewxxf32_viewxxf32_viewxxf32( +extern "C" void linalg_matmul_viewsxsxf32_viewsxsxf32_viewsxsxf32( ViewType *A, ViewType *B, ViewType *C) { assert(A->strides[1] == B->strides[1]); assert(A->strides[1] == C->strides[1]); diff --git a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir index 9c5d9aa282d..9fdd6b9dbd0 100644 --- a/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir +++ b/mlir/test/mlir-cpu-runner/linalg_integration_test.mlir @@ -1,9 +1,12 @@ -// RUN: mlir-opt %s -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e dot -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e dot -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -// RUN: mlir-opt %s -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-lower-to-loops -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s -// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-lower-to-llvm-dialect | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-convert-to-llvm | mlir-cpu-runner -e dot -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e dot -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-convert-to-llvm | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s +// RUN: mlir-opt %s -linalg-tile -linalg-tile-sizes=2,3,4 -linalg-tile-promote-full-tile-views=true -linalg-convert-to-llvm | mlir-cpu-runner -e matmul -entry-point-result=f32 -shared-libs=%linalg_test_lib_dir/libcblas%shlibext,%linalg_test_lib_dir/libcblas_interface%shlibext | FileCheck %s + +#strided1D = (d0)[s0] -> (d0 + s0) +#strided2D = (d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1) // Creates and returns a 1-D buffer of size %s filled with the value %f func @alloc_filled_f32(%s : index, %f : f32) -> !linalg.buffer { @@ -11,8 +14,8 @@ func @alloc_filled_f32(%s : index, %f : f32) -> !linalg.buffer { %c1 = constant 1 : index %buf = linalg.buffer_alloc %s {alignment = 256} : !linalg.buffer %R = linalg.range %c0:%s:%c1 : !linalg.range - %V = linalg.view %buf[%R] : !linalg.buffer -> !linalg.view - linalg.fill(%V, %f) : !linalg.view, f32 + %V = linalg.view %buf[%R] : !linalg.buffer -> memref + linalg.fill(%V, %f) : memref, f32 return %buf : !linalg.buffer } @@ -30,12 +33,12 @@ func @dot() -> f32 { %bC = call @alloc_filled_f32(%c1, %f10) : (index, f32) -> (!linalg.buffer) %R = linalg.range %c0:%c16:%c1 : !linalg.range - %A = linalg.view %bA[%R] : !linalg.buffer -> !linalg.view - %B = linalg.view %bB[%R] : !linalg.buffer -> !linalg.view - %C = linalg.view %bC[] : !linalg.buffer -> !linalg.view + %A = linalg.view %bA[%R] : !linalg.buffer -> memref + %B = linalg.view %bB[%R] : !linalg.buffer -> memref + %C = linalg.view %bC[] : !linalg.buffer -> memref - linalg.dot(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - %res = linalg.load %C[] : !linalg.view + linalg.dot(%A, %B, %C) : memref, memref, memref + %res = load %C[] : memref linalg.buffer_dealloc %bC : !linalg.buffer linalg.buffer_dealloc %bB : !linalg.buffer @@ -65,12 +68,12 @@ func @matmul() -> f32 { %M = linalg.range %c0:%c10:%c1 : !linalg.range %N = linalg.range %c0:%c10:%c1 : !linalg.range %K = linalg.range %c0:%c16:%c1 : !linalg.range - %A = linalg.view %bA[%M, %K] : !linalg.buffer -> !linalg.view - %B = linalg.view %bB[%K, %N] : !linalg.buffer -> !linalg.view - %C = linalg.view %bC[%M, %N] : !linalg.buffer -> !linalg.view + %A = linalg.view %bA[%M, %K] : !linalg.buffer -> memref + %B = linalg.view %bB[%K, %N] : !linalg.buffer -> memref + %C = linalg.view %bC[%M, %N] : !linalg.buffer -> memref - linalg.matmul(%A, %B, %C) : !linalg.view, !linalg.view, !linalg.view - %res = linalg.load %C[%c6, %c7] : !linalg.view + linalg.matmul(%A, %B, %C) : memref, memref, memref + %res = load %C[%c6, %c7] : memref linalg.buffer_dealloc %bC : !linalg.buffer linalg.buffer_dealloc %bB : !linalg.buffer -- cgit v1.2.3 From 3b4f133fb70b635dff8077c77296941a109a0303 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Mon, 7 Oct 2019 09:06:08 -0700 Subject: Start a minimal mlir_utils runtime library for testing debugging purposes Now that MLIR has a standardized StridedMemRef descriptor, it becomes very easy to interact with external library functions and build utilities directly in C++. This CL introduces basic printing support in a libmlir_utils.so. Unit tests are rewritten using this feature and also to improve coverage. For now, C mandates that we have a unique function for each MemRef element type and rank. In a future a simple unranked descriptor can be introduced to only require uniqu'ing by element type. PiperOrigin-RevId: 273304741 --- mlir/test/CMakeLists.txt | 1 + mlir/test/mlir-cpu-runner/CMakeLists.txt | 5 + mlir/test/mlir-cpu-runner/cblas_interface.cpp | 90 +++++++++------- mlir/test/mlir-cpu-runner/include/cblas.h | 2 + .../mlir-cpu-runner/include/mlir_runner_utils.h | 80 ++++++++++++++ mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp | 118 +++++++++++++++++++++ mlir/test/mlir-cpu-runner/utils.mlir | 53 +++++++++ 7 files changed, 309 insertions(+), 40 deletions(-) create mode 100644 mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h create mode 100644 mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp create mode 100644 mlir/test/mlir-cpu-runner/utils.mlir (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt index 93170e4f0c6..468b1e72e94 100644 --- a/mlir/test/CMakeLists.txt +++ b/mlir/test/CMakeLists.txt @@ -39,6 +39,7 @@ set(MLIR_TEST_DEPENDS mlir-translate cblas cblas_interface + mlir_runner_utils ) if(LLVM_BUILD_EXAMPLES) diff --git a/mlir/test/mlir-cpu-runner/CMakeLists.txt b/mlir/test/mlir-cpu-runner/CMakeLists.txt index 8c1005b596b..94f50a4a611 100644 --- a/mlir/test/mlir-cpu-runner/CMakeLists.txt +++ b/mlir/test/mlir-cpu-runner/CMakeLists.txt @@ -1,10 +1,15 @@ set(LLVM_OPTIONAL_SOURCES cblas.cpp cblas_interface.cpp + mlir_runner_utils.cpp ) add_llvm_library(cblas SHARED cblas.cpp) target_compile_definitions(cblas PRIVATE cblas_EXPORTS) + add_llvm_library(cblas_interface SHARED cblas_interface.cpp) target_link_libraries(cblas_interface PRIVATE cblas) +add_llvm_library(mlir_runner_utils SHARED mlir_runner_utils.cpp) +target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS) + diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index aae3112276e..831702f594e 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -21,51 +21,54 @@ #include "include/cblas.h" #include +#include -template struct ViewType { - T *data; - unsigned long offset; - unsigned long sizes[N]; - unsigned long strides[N]; -}; - -template struct ViewType { - T *data; - unsigned long offset; -}; - -extern "C" void linalg_fill_viewf32_f32(ViewType *X, float f) { +extern "C" void linalg_fill_viewf32_f32(StridedMemRefType *X, + float f) { X->data[X->offset] = f; } -extern "C" void linalg_fill_viewsxf32_f32(ViewType *X, float f) { +extern "C" void linalg_fill_viewsxf32_f32(StridedMemRefType *X, + float f) { for (unsigned i = 0; i < X->sizes[0]; ++i) *(X->data + X->offset + i * X->strides[0]) = f; } -extern "C" void linalg_fill_viewsxsxf32_f32(ViewType *X, float f) { +extern "C" void linalg_fill_viewsxsxf32_f32(StridedMemRefType *X, + float f) { for (unsigned i = 0; i < X->sizes[0]; ++i) for (unsigned j = 0; j < X->sizes[1]; ++j) *(X->data + X->offset + i * X->strides[0] + j * X->strides[1]) = f; } -extern "C" void linalg_copy_viewf32_viewf32(ViewType *I, - ViewType *O) { +extern "C" void linalg_copy_viewf32_viewf32(StridedMemRefType *I, + StridedMemRefType *O) { O->data[O->offset] = I->data[I->offset]; } -extern "C" void linalg_copy_viewsxf32_viewsxf32(ViewType *I, - ViewType *O) { - assert(I->sizes[0] == O->sizes[0]); +extern "C" void +linalg_copy_viewsxf32_viewsxf32(StridedMemRefType *I, + StridedMemRefType *O) { + if (I->sizes[0] != O->sizes[0]) { + std::cerr << "Incompatible strided memrefs\n"; + printMemRefMetaData(std::cerr, *I); + printMemRefMetaData(std::cerr, *O); + return; + } for (unsigned i = 0; i < I->sizes[0]; ++i) O->data[O->offset + i * O->strides[0]] = I->data[I->offset + i * I->strides[0]]; } -extern "C" void linalg_copy_viewsxsxf32_viewsxsxf32(ViewType *I, - ViewType *O) { - assert(I->sizes[0] == O->sizes[0]); - assert(I->sizes[1] == O->sizes[1]); +extern "C" void +linalg_copy_viewsxsxf32_viewsxsxf32(StridedMemRefType *I, + StridedMemRefType *O) { + if (I->sizes[0] != O->sizes[0] || I->sizes[1] != O->sizes[1]) { + std::cerr << "Incompatible strided memrefs\n"; + printMemRefMetaData(std::cerr, *I); + printMemRefMetaData(std::cerr, *O); + return; + } auto so0 = O->strides[0], so1 = O->strides[1]; auto si0 = I->strides[0], si1 = I->strides[1]; for (unsigned i = 0; i < I->sizes[0]; ++i) @@ -74,28 +77,35 @@ extern "C" void linalg_copy_viewsxsxf32_viewsxsxf32(ViewType *I, I->data[I->offset + i * si0 + j * si1]; } -extern "C" void linalg_dot_viewsxf32_viewsxf32_viewf32(ViewType *X, - ViewType *Y, - ViewType *Z) { - assert(X->strides[0] == 1); - assert(Y->strides[0] == 1); - assert(X->sizes[0] == Y->sizes[0] && "Expected X and Y of same size"); +extern "C" void +linalg_dot_viewsxf32_viewsxf32_viewf32(StridedMemRefType *X, + StridedMemRefType *Y, + StridedMemRefType *Z) { + if (X->strides[0] != 1 || Y->strides[0] != 1 || X->sizes[0] != Y->sizes[0]) { + std::cerr << "Incompatible strided memrefs\n"; + printMemRefMetaData(std::cerr, *X); + printMemRefMetaData(std::cerr, *Y); + printMemRefMetaData(std::cerr, *Z); + return; + } Z->data[Z->offset] += cblas_sdot(X->sizes[0], X->data + X->offset, X->strides[0], Y->data + Y->offset, Y->strides[0]); } extern "C" void linalg_matmul_viewsxsxf32_viewsxsxf32_viewsxsxf32( - ViewType *A, ViewType *B, ViewType *C) { - assert(A->strides[1] == B->strides[1]); - assert(A->strides[1] == C->strides[1]); - assert(A->strides[1] == 1); - assert(A->sizes[0] >= A->strides[1]); - assert(B->sizes[0] >= B->strides[1]); - assert(C->sizes[0] >= C->strides[1]); - assert(C->sizes[0] == A->sizes[0]); - assert(C->sizes[1] == B->sizes[1]); - assert(A->sizes[1] == B->sizes[0]); + StridedMemRefType *A, StridedMemRefType *B, + StridedMemRefType *C) { + if (A->strides[1] != B->strides[1] || A->strides[1] != C->strides[1] || + A->strides[1] != 1 || A->sizes[0] < A->strides[1] || + B->sizes[0] < B->strides[1] || C->sizes[0] < C->strides[1] || + C->sizes[0] != A->sizes[0] || C->sizes[1] != B->sizes[1] || + A->sizes[1] != B->sizes[0]) { + printMemRefMetaData(std::cerr, *A); + printMemRefMetaData(std::cerr, *B); + printMemRefMetaData(std::cerr, *C); + return; + } cblas_sgemm(CBLAS_ORDER::CblasRowMajor, CBLAS_TRANSPOSE::CblasNoTrans, CBLAS_TRANSPOSE::CblasNoTrans, C->sizes[0], C->sizes[1], A->sizes[1], 1.0f, A->data + A->offset, A->strides[0], diff --git a/mlir/test/mlir-cpu-runner/include/cblas.h b/mlir/test/mlir-cpu-runner/include/cblas.h index 18b6aeb93b3..522ac8380b9 100644 --- a/mlir/test/mlir-cpu-runner/include/cblas.h +++ b/mlir/test/mlir-cpu-runner/include/cblas.h @@ -17,6 +17,8 @@ #ifndef MLIR_CPU_RUNNER_CBLAS_H_ #define MLIR_CPU_RUNNER_CBLAS_H_ +#include "mlir_runner_utils.h" + #ifdef _WIN32 #ifndef MLIR_CBLAS_EXPORT #ifdef cblas_EXPORTS diff --git a/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h b/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h new file mode 100644 index 00000000000..637a52a34d4 --- /dev/null +++ b/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h @@ -0,0 +1,80 @@ +//===- mlir_runner_utils.h - Utils for debugging MLIR CPU execution -------===// +// +// Copyright 2019 The MLIR Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= +#ifndef MLIR_CPU_RUNNER_MLIRUTILS_H_ +#define MLIR_CPU_RUNNER_MLIRUTILS_H_ + +#include + +#ifdef _WIN32 +#ifndef MLIR_CBLAS_EXPORT +#ifdef cblas_EXPORTS +/* We are building this library */ +#define MLIR_CBLAS_EXPORT __declspec(dllexport) +#else +/* We are using this library */ +#define MLIR_CBLAS_EXPORT __declspec(dllimport) +#endif +#endif +#else +#define MLIR_CBLAS_EXPORT +#endif + +/// StridedMemRef descriptor type with static rank. +template struct StridedMemRefType { + T *data; + int64_t offset; + int64_t sizes[N]; + int64_t strides[N]; +}; + +/// StridedMemRef descriptor type specialized for rank 0. +template struct StridedMemRefType { + T *data; + int64_t offset; +}; + +template +void printMemRefMetaData(StreamType &os, StridedMemRefType &V) { + static_assert(N > 0, "Expected N > 0"); + os << "Memref base@ = " << V.data << " rank = " << N + << " offset = " << V.offset << " sizes = [" << V.sizes[0]; + for (unsigned i = 1; i < N; ++i) + os << ", " << V.sizes[i]; + os << "] strides = [" << V.strides[0]; + for (unsigned i = 1; i < N; ++i) + os << ", " << V.strides[i]; + os << "]"; +} + +template +void printMemRefMetaData(StreamType &os, StridedMemRefType &V) { + os << "Memref base@ = " << V.data << " rank = 0" + << " offset = " << V.offset; +} + +extern "C" MLIR_CBLAS_EXPORT void +print_memref_0d_f32(StridedMemRefType *M); +extern "C" MLIR_CBLAS_EXPORT void +print_memref_1d_f32(StridedMemRefType *M); +extern "C" MLIR_CBLAS_EXPORT void +print_memref_2d_f32(StridedMemRefType *M); +extern "C" MLIR_CBLAS_EXPORT void +print_memref_3d_f32(StridedMemRefType *M); +extern "C" MLIR_CBLAS_EXPORT void +print_memref_4d_f32(StridedMemRefType *M); + +#endif // MLIR_CPU_RUNNER_MLIRUTILS_H_ diff --git a/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp b/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp new file mode 100644 index 00000000000..0dd6bb4691e --- /dev/null +++ b/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp @@ -0,0 +1,118 @@ +//===- mlir_runner_utils.cpp - Utils for MLIR CPU execution ---------------===// +// +// Copyright 2019 The MLIR Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= +// +// Utilities for interfacing MLIR types with C code as well as printing, +// debugging etc. +// +//===----------------------------------------------------------------------===// + +#include "include/mlir_runner_utils.h" +#include +#include + +template struct MemRefDataPrinter { + static void print(T *base, int64_t rank, int64_t offset, int64_t *sizes, + int64_t *strides); + static void printFirst(T *base, int64_t rank, int64_t offset, int64_t *sizes, + int64_t *strides); + static void printLast(T *base, int64_t rank, int64_t offset, int64_t *sizes, + int64_t *strides); +}; + +template struct MemRefDataPrinter { + static void print(T *base, int64_t rank, int64_t offset, + int64_t *sizes = nullptr, int64_t *strides = nullptr); +}; + +static void printSpace(int count) { + for (int i = 0; i < count; ++i) { + std::cout << " "; + } +} + +template +void MemRefDataPrinter::printFirst(T *base, int64_t rank, int64_t offset, + int64_t *sizes, int64_t *strides) { + std::cout << "["; + MemRefDataPrinter::print(base, rank, offset, sizes + 1, + strides + 1); + if (sizes[0] > 0) + std::cout << ", "; + if (N > 1) + std::cout << "\n"; +} + +template +void MemRefDataPrinter::printLast(T *base, int64_t rank, int64_t offset, + int64_t *sizes, int64_t *strides) { + printSpace(rank - N + 1); + MemRefDataPrinter::print( + base, rank, offset + (sizes[0] - 1) * (*strides), sizes + 1, strides + 1); + std::cout << "]"; +} + +template +void MemRefDataPrinter::print(T *base, int64_t rank, int64_t offset, + int64_t *sizes, int64_t *strides) { + printFirst(base, rank, offset, sizes, strides); + for (unsigned i = 1; i + 1 < sizes[0]; ++i) { + printSpace(rank - N + 1); + MemRefDataPrinter::print(base, rank, offset + i * (*strides), + sizes + 1, strides + 1); + std::cout << ", "; + if (N > 1) + std::cout << "\n"; + } + printLast(base, rank, offset, sizes, strides); +} + +template +void MemRefDataPrinter::print(T *base, int64_t rank, int64_t offset, + int64_t *sizes, int64_t *strides) { + std::cout << base[offset]; +} + +template void printMemRef(StridedMemRefType &M) { + static_assert(N > 0, "Expected N > 0"); + printMemRefMetaData(std::cout, M); + std::cout << " data = " << std::endl; + MemRefDataPrinter::print(M.data, N, M.offset, M.sizes, M.strides); + std::cout << std::endl; +} + +template void printZeroDMemRef(StridedMemRefType &M) { + std::cout << "\nMemref base@ = " << M.data << " rank = " << 0 + << " offset = " << M.offset << " data = ["; + MemRefDataPrinter::print(M.data, 0, M.offset); + std::cout << "]" << std::endl; +} + +extern "C" void print_memref_0d_f32(StridedMemRefType *M) { + printZeroDMemRef(*M); +} +extern "C" void print_memref_1d_f32(StridedMemRefType *M) { + printMemRef(*M); +} +extern "C" void print_memref_2d_f32(StridedMemRefType *M) { + printMemRef(*M); +} +extern "C" void print_memref_3d_f32(StridedMemRefType *M) { + printMemRef(*M); +} +extern "C" void print_memref_4d_f32(StridedMemRefType *M) { + printMemRef(*M); +} diff --git a/mlir/test/mlir-cpu-runner/utils.mlir b/mlir/test/mlir-cpu-runner/utils.mlir new file mode 100644 index 00000000000..38d5df6cd6e --- /dev/null +++ b/mlir/test/mlir-cpu-runner/utils.mlir @@ -0,0 +1,53 @@ +// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e print_0d -entry-point-result=void -shared-libs=%linalg_test_lib_dir/libmlir_runner_utils%shlibext | FileCheck %s --check-prefix=PRINT-0D +// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e print_1d -entry-point-result=void -shared-libs=%linalg_test_lib_dir/libmlir_runner_utils%shlibext | FileCheck %s --check-prefix=PRINT-1D +// RUN: mlir-opt %s -linalg-lower-to-loops -linalg-convert-to-llvm | mlir-cpu-runner -e print_3d -entry-point-result=void -shared-libs=%linalg_test_lib_dir/libmlir_runner_utils%shlibext | FileCheck %s --check-prefix=PRINT-3D + +func @print_0d() { + %f = constant 2.00000e+00 : f32 + %A = alloc() : memref + store %f, %A[]: memref + call @print_memref_0d_f32(%A): (memref) -> () + dealloc %A : memref + return +} + +func @print_1d() { + %f = constant 2.00000e+00 : f32 + %A = alloc() : memref<16xf32> + %B = memref_cast %A: memref<16xf32> to memref + linalg.fill(%B, %f) : memref, f32 + call @print_memref_1d_f32(%B): (memref) -> () + dealloc %A : memref<16xf32> + return +} + +func @print_3d() { + %f = constant 2.00000e+00 : f32 + %f4 = constant 4.00000e+00 : f32 + %A = alloc() : memref<3x4x5xf32> + %B = memref_cast %A: memref<3x4x5xf32> to memref + linalg.fill(%B, %f) : memref, f32 + + %c2 = constant 2 : index + store %f4, %B[%c2, %c2, %c2]: memref + + call @print_memref_3d_f32(%B): (memref) -> () + dealloc %A : memref<3x4x5xf32> + return +} + +func @print_memref_0d_f32(memref) +func @print_memref_1d_f32(memref) +func @print_memref_3d_f32(memref) + +// PRINT-0D: Memref base@ = {{.*}} rank = 0 offset = 0 data = [2] + +// PRINT-1D: Memref base@ = {{.*}} rank = 1 offset = 0 sizes = [16] strides = [1] data = +// PRINT-1D-NEXT: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] + +// PRINT-3D: Memref base@ = {{.*}} rank = 3 offset = 0 sizes = [3, 4, 5] strides = [20, 5, 1] data = +// PRINT-3D-COUNT-4: {{.*[[:space:]].*}}2, 2, 2, 2, 2 +// PRINT-3D-COUNT-4: {{.*[[:space:]].*}}2, 2, 2, 2, 2 +// PRINT-3D-COUNT-2: {{.*[[:space:]].*}}2, 2, 2, 2, 2 +// PRINT-3D-NEXT: 2, 2, 4, 2, 2 +// PRINT-3D-NEXT: 2, 2, 2, 2, 2 -- cgit v1.2.3 From 56222a0694e4caf35e892d70591417c39fef1185 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 23 Dec 2019 09:35:36 -0800 Subject: Adjust License.txt file to use the LLVM license PiperOrigin-RevId: 286906740 --- mlir/LICENSE.TXT | 128 ++++++++++++++++----- mlir/bindings/python/pybind.cpp | 17 +-- mlir/examples/toy/Ch1/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch1/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch1/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch1/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch1/toyc.cpp | 17 +-- mlir/examples/toy/Ch2/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch2/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch2/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch2/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch2/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch2/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch2/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch2/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch2/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch2/toyc.cpp | 17 +-- mlir/examples/toy/Ch3/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch3/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch3/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch3/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch3/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch3/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch3/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch3/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch3/mlir/ToyCombine.cpp | 17 +-- mlir/examples/toy/Ch3/mlir/ToyCombine.td | 17 +-- mlir/examples/toy/Ch3/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch3/toyc.cpp | 17 +-- mlir/examples/toy/Ch4/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch4/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch4/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch4/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch4/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch4/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch4/include/toy/Passes.h | 17 +-- .../toy/Ch4/include/toy/ShapeInferenceInterface.h | 17 +-- .../toy/Ch4/include/toy/ShapeInferenceInterface.td | 17 +-- .../toy/Ch4/mlir/DeadFunctionEliminationPass.cpp | 17 +-- mlir/examples/toy/Ch4/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch4/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp | 17 +-- mlir/examples/toy/Ch4/mlir/ToyCombine.cpp | 17 +-- mlir/examples/toy/Ch4/mlir/ToyCombine.td | 17 +-- mlir/examples/toy/Ch4/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch4/toyc.cpp | 17 +-- mlir/examples/toy/Ch5/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch5/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch5/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch5/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch5/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch5/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch5/include/toy/Passes.h | 17 +-- .../toy/Ch5/include/toy/ShapeInferenceInterface.h | 17 +-- .../toy/Ch5/include/toy/ShapeInferenceInterface.td | 17 +-- .../toy/Ch5/mlir/DeadFunctionEliminationPass.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/ToyCombine.cpp | 17 +-- mlir/examples/toy/Ch5/mlir/ToyCombine.td | 17 +-- mlir/examples/toy/Ch5/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch5/toyc.cpp | 17 +-- mlir/examples/toy/Ch6/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch6/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch6/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch6/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch6/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch6/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch6/include/toy/Passes.h | 17 +-- .../toy/Ch6/include/toy/ShapeInferenceInterface.h | 17 +-- .../toy/Ch6/include/toy/ShapeInferenceInterface.td | 17 +-- .../toy/Ch6/mlir/DeadFunctionEliminationPass.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/ToyCombine.cpp | 17 +-- mlir/examples/toy/Ch6/mlir/ToyCombine.td | 17 +-- mlir/examples/toy/Ch6/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch6/toyc.cpp | 17 +-- mlir/examples/toy/Ch7/include/toy/AST.h | 17 +-- mlir/examples/toy/Ch7/include/toy/Dialect.h | 17 +-- mlir/examples/toy/Ch7/include/toy/Lexer.h | 17 +-- mlir/examples/toy/Ch7/include/toy/MLIRGen.h | 17 +-- mlir/examples/toy/Ch7/include/toy/Ops.td | 17 +-- mlir/examples/toy/Ch7/include/toy/Parser.h | 17 +-- mlir/examples/toy/Ch7/include/toy/Passes.h | 17 +-- .../toy/Ch7/include/toy/ShapeInferenceInterface.h | 17 +-- .../toy/Ch7/include/toy/ShapeInferenceInterface.td | 17 +-- .../toy/Ch7/mlir/DeadFunctionEliminationPass.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/Dialect.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/MLIRGen.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/ToyCombine.cpp | 17 +-- mlir/examples/toy/Ch7/mlir/ToyCombine.td | 17 +-- mlir/examples/toy/Ch7/parser/AST.cpp | 17 +-- mlir/examples/toy/Ch7/toyc.cpp | 17 +-- mlir/include/mlir-c/Core.h | 17 +-- mlir/include/mlir/ADT/TypeSwitch.h | 17 +-- mlir/include/mlir/Analysis/AffineAnalysis.h | 17 +-- mlir/include/mlir/Analysis/AffineStructures.h | 17 +-- mlir/include/mlir/Analysis/CallGraph.h | 17 +-- mlir/include/mlir/Analysis/CallInterfaces.h | 17 +-- mlir/include/mlir/Analysis/CallInterfaces.td | 17 +-- mlir/include/mlir/Analysis/Dominance.h | 17 +-- mlir/include/mlir/Analysis/InferTypeOpInterface.h | 17 +-- mlir/include/mlir/Analysis/InferTypeOpInterface.td | 17 +-- mlir/include/mlir/Analysis/Liveness.h | 17 +-- mlir/include/mlir/Analysis/LoopAnalysis.h | 17 +-- mlir/include/mlir/Analysis/NestedMatcher.h | 17 +-- mlir/include/mlir/Analysis/Passes.h | 17 +-- mlir/include/mlir/Analysis/SliceAnalysis.h | 17 +-- mlir/include/mlir/Analysis/Utils.h | 17 +-- mlir/include/mlir/Analysis/Verifier.h | 17 +-- .../Conversion/AffineToStandard/AffineToStandard.h | 17 +-- .../mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h | 17 +-- .../mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h | 17 +-- .../mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h | 17 +-- .../mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h | 17 +-- .../Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h | 17 +-- .../mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h | 17 +-- .../LoopToStandard/ConvertLoopToStandard.h | 17 +-- .../mlir/Conversion/LoopsToGPU/LoopsToGPU.h | 17 +-- .../mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h | 17 +-- .../StandardToLLVM/ConvertStandardToLLVM.h | 17 +-- .../StandardToLLVM/ConvertStandardToLLVMPass.h | 17 +-- .../StandardToSPIRV/ConvertStandardToSPIRV.h | 17 +-- .../StandardToSPIRV/ConvertStandardToSPIRVPass.h | 17 +-- .../Conversion/VectorToLLVM/ConvertVectorToLLVM.h | 17 +-- .../VectorToLoops/ConvertVectorToLoops.h | 17 +-- mlir/include/mlir/Dialect/AffineOps/AffineOps.h | 17 +-- mlir/include/mlir/Dialect/AffineOps/AffineOps.td | 17 +-- .../mlir/Dialect/AffineOps/AffineOpsBase.td | 17 +-- mlir/include/mlir/Dialect/CommonFolders.h | 17 +-- mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.h | 17 +-- mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td | 17 +-- mlir/include/mlir/Dialect/FxpMathOps/Passes.h | 17 +-- mlir/include/mlir/Dialect/GPU/GPUDialect.h | 17 +-- mlir/include/mlir/Dialect/GPU/GPUOps.td | 17 +-- mlir/include/mlir/Dialect/GPU/Passes.h | 17 +-- mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h | 17 +-- mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td | 17 +-- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 17 +-- mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h | 17 +-- mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td | 17 +-- mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h | 17 +-- mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td | 17 +-- .../Dialect/Linalg/Analysis/DependenceAnalysis.h | 17 +-- mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h | 17 +-- mlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgDoc.td | 17 +-- .../mlir/Dialect/Linalg/IR/LinalgLibraryOps.td | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td | 17 +-- .../mlir/Dialect/Linalg/IR/LinalgStructuredOps.td | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h | 17 +-- mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h | 17 +-- mlir/include/mlir/Dialect/Linalg/Passes.h | 17 +-- .../Linalg/Transforms/LinalgTransformPatterns.td | 17 +-- .../Dialect/Linalg/Transforms/LinalgTransforms.h | 17 +-- .../include/mlir/Dialect/Linalg/Utils/Intrinsics.h | 17 +-- mlir/include/mlir/Dialect/Linalg/Utils/Utils.h | 17 +-- mlir/include/mlir/Dialect/LoopOps/LoopOps.h | 17 +-- mlir/include/mlir/Dialect/LoopOps/LoopOps.td | 17 +-- .../mlir/Dialect/QuantOps/FakeQuantSupport.h | 17 +-- mlir/include/mlir/Dialect/QuantOps/Passes.h | 17 +-- mlir/include/mlir/Dialect/QuantOps/QuantOps.h | 17 +-- mlir/include/mlir/Dialect/QuantOps/QuantOps.td | 17 +-- .../mlir/Dialect/QuantOps/QuantPredicates.td | 17 +-- mlir/include/mlir/Dialect/QuantOps/QuantTypes.h | 17 +-- mlir/include/mlir/Dialect/QuantOps/QuantizeUtils.h | 17 +-- .../include/mlir/Dialect/QuantOps/UniformSupport.h | 17 +-- mlir/include/mlir/Dialect/SDBM/SDBM.h | 17 +-- mlir/include/mlir/Dialect/SDBM/SDBMDialect.h | 17 +-- mlir/include/mlir/Dialect/SDBM/SDBMExpr.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/Passes.h | 17 +-- .../mlir/Dialect/SPIRV/SPIRVArithmeticOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td | 17 +-- .../mlir/Dialect/SPIRV/SPIRVCompositeOps.td | 17 +-- .../mlir/Dialect/SPIRV/SPIRVControlFlowOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.td | 17 +-- .../mlir/Dialect/SPIRV/SPIRVNonUniformOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td | 17 +-- .../mlir/Dialect/SPIRV/SPIRVStructureOps.td | 17 +-- mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h | 17 +-- mlir/include/mlir/Dialect/SPIRV/Serialization.h | 17 +-- mlir/include/mlir/Dialect/StandardOps/Ops.h | 17 +-- mlir/include/mlir/Dialect/StandardOps/Ops.td | 17 +-- mlir/include/mlir/Dialect/Traits.h | 17 +-- .../mlir/Dialect/Utils/StructuredOpsUtils.h | 17 +-- mlir/include/mlir/Dialect/VectorOps/Utils.h | 17 +-- mlir/include/mlir/Dialect/VectorOps/VectorOps.h | 17 +-- mlir/include/mlir/Dialect/VectorOps/VectorOps.td | 17 +-- .../Dialect/VectorOps/VectorTransformPatterns.td | 17 +-- .../mlir/Dialect/VectorOps/VectorTransforms.h | 17 +-- mlir/include/mlir/EDSC/Builders.h | 17 +-- mlir/include/mlir/EDSC/Helpers.h | 17 +-- mlir/include/mlir/EDSC/Intrinsics.h | 17 +-- .../include/mlir/ExecutionEngine/ExecutionEngine.h | 17 +-- mlir/include/mlir/ExecutionEngine/OptUtils.h | 17 +-- mlir/include/mlir/IR/AffineExpr.h | 17 +-- mlir/include/mlir/IR/AffineExprVisitor.h | 17 +-- mlir/include/mlir/IR/AffineMap.h | 17 +-- mlir/include/mlir/IR/AttributeSupport.h | 17 +-- mlir/include/mlir/IR/Attributes.h | 17 +-- mlir/include/mlir/IR/Block.h | 17 +-- mlir/include/mlir/IR/BlockAndValueMapping.h | 17 +-- mlir/include/mlir/IR/BlockSupport.h | 17 +-- mlir/include/mlir/IR/Builders.h | 17 +-- mlir/include/mlir/IR/Diagnostics.h | 17 +-- mlir/include/mlir/IR/Dialect.h | 17 +-- mlir/include/mlir/IR/DialectHooks.h | 17 +-- mlir/include/mlir/IR/DialectImplementation.h | 17 +-- mlir/include/mlir/IR/DialectInterface.h | 17 +-- mlir/include/mlir/IR/DialectSymbolRegistry.def | 17 +-- mlir/include/mlir/IR/Function.h | 17 +-- mlir/include/mlir/IR/FunctionImplementation.h | 17 +-- mlir/include/mlir/IR/FunctionSupport.h | 17 +-- mlir/include/mlir/IR/Identifier.h | 17 +-- mlir/include/mlir/IR/IntegerSet.h | 17 +-- mlir/include/mlir/IR/Location.h | 17 +-- mlir/include/mlir/IR/MLIRContext.h | 17 +-- mlir/include/mlir/IR/Matchers.h | 17 +-- mlir/include/mlir/IR/Module.h | 17 +-- mlir/include/mlir/IR/OpAsmInterface.td | 17 +-- mlir/include/mlir/IR/OpBase.td | 17 +-- mlir/include/mlir/IR/OpDefinition.h | 17 +-- mlir/include/mlir/IR/OpImplementation.h | 17 +-- mlir/include/mlir/IR/Operation.h | 17 +-- mlir/include/mlir/IR/OperationSupport.h | 17 +-- mlir/include/mlir/IR/PatternMatch.h | 17 +-- mlir/include/mlir/IR/Region.h | 17 +-- mlir/include/mlir/IR/RegionGraphTraits.h | 17 +-- mlir/include/mlir/IR/StandardTypes.h | 17 +-- mlir/include/mlir/IR/StorageUniquerSupport.h | 17 +-- mlir/include/mlir/IR/SymbolTable.h | 17 +-- mlir/include/mlir/IR/TypeSupport.h | 17 +-- mlir/include/mlir/IR/TypeUtilities.h | 17 +-- mlir/include/mlir/IR/Types.h | 17 +-- mlir/include/mlir/IR/UseDefLists.h | 17 +-- mlir/include/mlir/IR/Value.h | 17 +-- mlir/include/mlir/IR/Visitors.h | 17 +-- mlir/include/mlir/Parser.h | 17 +-- mlir/include/mlir/Pass/AnalysisManager.h | 17 +-- mlir/include/mlir/Pass/Pass.h | 17 +-- mlir/include/mlir/Pass/PassInstrumentation.h | 17 +-- mlir/include/mlir/Pass/PassManager.h | 17 +-- mlir/include/mlir/Pass/PassOptions.h | 17 +-- mlir/include/mlir/Pass/PassRegistry.h | 17 +-- .../mlir/Quantizer/Configurations/FxpMathConfig.h | 17 +-- .../include/mlir/Quantizer/Support/Configuration.h | 17 +-- .../Quantizer/Support/ConstraintAnalysisGraph.h | 17 +-- .../Support/ConstraintAnalysisGraphTraits.h | 17 +-- mlir/include/mlir/Quantizer/Support/Metadata.h | 17 +-- mlir/include/mlir/Quantizer/Support/Rules.h | 17 +-- mlir/include/mlir/Quantizer/Support/Statistics.h | 17 +-- mlir/include/mlir/Quantizer/Support/TypeUtils.h | 17 +-- .../mlir/Quantizer/Support/UniformConstraints.h | 17 +-- .../mlir/Quantizer/Support/UniformSolvers.h | 17 +-- mlir/include/mlir/Quantizer/Transforms/Passes.h | 17 +-- mlir/include/mlir/Support/DebugStringHelper.h | 17 +-- mlir/include/mlir/Support/FileUtilities.h | 17 +-- mlir/include/mlir/Support/Functional.h | 17 +-- mlir/include/mlir/Support/JitRunner.h | 17 +-- mlir/include/mlir/Support/LLVM.h | 17 +-- mlir/include/mlir/Support/LogicalResult.h | 17 +-- mlir/include/mlir/Support/MathExtras.h | 17 +-- mlir/include/mlir/Support/MlirOptMain.h | 17 +-- mlir/include/mlir/Support/STLExtras.h | 17 +-- mlir/include/mlir/Support/StorageUniquer.h | 17 +-- mlir/include/mlir/Support/StringExtras.h | 17 +-- mlir/include/mlir/Support/ToolUtilities.h | 17 +-- mlir/include/mlir/Support/TranslateClParser.h | 17 +-- mlir/include/mlir/TableGen/Argument.h | 17 +-- mlir/include/mlir/TableGen/Attribute.h | 17 +-- mlir/include/mlir/TableGen/Constraint.h | 17 +-- mlir/include/mlir/TableGen/Dialect.h | 17 +-- mlir/include/mlir/TableGen/Format.h | 17 +-- mlir/include/mlir/TableGen/GenInfo.h | 17 +-- mlir/include/mlir/TableGen/GenNameParser.h | 17 +-- mlir/include/mlir/TableGen/OpInterfaces.h | 17 +-- mlir/include/mlir/TableGen/OpTrait.h | 17 +-- mlir/include/mlir/TableGen/Operator.h | 17 +-- mlir/include/mlir/TableGen/Pattern.h | 17 +-- mlir/include/mlir/TableGen/Predicate.h | 17 +-- mlir/include/mlir/TableGen/Region.h | 17 +-- mlir/include/mlir/TableGen/Type.h | 17 +-- mlir/include/mlir/Target/LLVMIR.h | 17 +-- .../include/mlir/Target/LLVMIR/ModuleTranslation.h | 17 +-- mlir/include/mlir/Target/NVVMIR.h | 17 +-- mlir/include/mlir/Target/ROCDLIR.h | 17 +-- mlir/include/mlir/Transforms/DialectConversion.h | 17 +-- mlir/include/mlir/Transforms/FoldUtils.h | 17 +-- mlir/include/mlir/Transforms/InliningUtils.h | 17 +-- mlir/include/mlir/Transforms/LoopFusionUtils.h | 17 +-- mlir/include/mlir/Transforms/LoopLikeInterface.h | 17 +-- mlir/include/mlir/Transforms/LoopLikeInterface.td | 17 +-- mlir/include/mlir/Transforms/LoopUtils.h | 17 +-- mlir/include/mlir/Transforms/Passes.h | 17 +-- mlir/include/mlir/Transforms/RegionUtils.h | 17 +-- .../include/mlir/Transforms/SideEffectsInterface.h | 17 +-- mlir/include/mlir/Transforms/Utils.h | 17 +-- mlir/include/mlir/Transforms/ViewOpGraph.h | 17 +-- mlir/include/mlir/Transforms/ViewRegionGraph.h | 17 +-- mlir/include/mlir/Translation.h | 17 +-- mlir/lib/Analysis/AffineAnalysis.cpp | 17 +-- mlir/lib/Analysis/AffineStructures.cpp | 17 +-- mlir/lib/Analysis/CallGraph.cpp | 17 +-- mlir/lib/Analysis/Dominance.cpp | 17 +-- mlir/lib/Analysis/InferTypeOpInterface.cpp | 17 +-- mlir/lib/Analysis/Liveness.cpp | 17 +-- mlir/lib/Analysis/LoopAnalysis.cpp | 17 +-- mlir/lib/Analysis/MemRefBoundCheck.cpp | 17 +-- mlir/lib/Analysis/NestedMatcher.cpp | 17 +-- mlir/lib/Analysis/OpStats.cpp | 17 +-- mlir/lib/Analysis/SliceAnalysis.cpp | 17 +-- mlir/lib/Analysis/TestMemRefDependenceCheck.cpp | 17 +-- mlir/lib/Analysis/TestParallelismDetection.cpp | 17 +-- mlir/lib/Analysis/Utils.cpp | 17 +-- mlir/lib/Analysis/VectorAnalysis.cpp | 17 +-- mlir/lib/Analysis/Verifier.cpp | 17 +-- .../AffineToStandard/AffineToStandard.cpp | 17 +-- .../GPUCommon/IndexIntrinsicsOpLowering.h | 17 +-- .../Conversion/GPUCommon/OpToFuncCallLowering.h | 17 +-- .../GPUToCUDA/ConvertKernelFuncToCubin.cpp | 17 +-- .../GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp | 17 +-- mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td | 17 +-- .../Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp | 17 +-- .../GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | 17 +-- .../Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp | 17 +-- .../GPUToSPIRV/ConvertGPUToSPIRVPass.cpp | 17 +-- mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp | 17 +-- .../LoopToStandard/ConvertLoopToStandard.cpp | 17 +-- mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp | 17 +-- mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp | 17 +-- .../StandardToLLVM/ConvertStandardToLLVM.cpp | 17 +-- .../StandardToSPIRV/ConvertStandardToSPIRV.cpp | 17 +-- .../StandardToSPIRV/ConvertStandardToSPIRVPass.cpp | 17 +-- .../StandardToSPIRV/LegalizeStandardForSPIRV.cpp | 17 +-- .../VectorToLLVM/ConvertVectorToLLVM.cpp | 17 +-- .../VectorToLoops/ConvertVectorToLoops.cpp | 17 +-- mlir/lib/Dialect/AffineOps/AffineOps.cpp | 17 +-- mlir/lib/Dialect/AffineOps/DialectRegistration.cpp | 17 +-- .../Dialect/FxpMathOps/IR/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/FxpMathOps/IR/FxpMathOps.cpp | 17 +-- .../FxpMathOps/Transforms/LowerUniformRealMath.cpp | 17 +-- .../FxpMathOps/Transforms/UniformKernelUtils.h | 17 +-- mlir/lib/Dialect/GPU/IR/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | 17 +-- .../lib/Dialect/GPU/Transforms/KernelOutlining.cpp | 17 +-- mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | 17 +-- mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp | 17 +-- mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp | 17 +-- .../Dialect/Linalg/Analysis/DependenceAnalysis.cpp | 17 +-- mlir/lib/Dialect/Linalg/EDSC/Builders.cpp | 17 +-- mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | 17 +-- mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp | 17 +-- mlir/lib/Dialect/Linalg/LinalgRegistration.cpp | 17 +-- mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp | 17 +-- .../Dialect/Linalg/Transforms/LinalgToLoops.cpp | 17 +-- .../Dialect/Linalg/Transforms/LinalgTransforms.cpp | 17 +-- mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp | 17 +-- mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp | 17 +-- mlir/lib/Dialect/Linalg/Utils/Utils.cpp | 17 +-- mlir/lib/Dialect/LoopOps/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/LoopOps/LoopOps.cpp | 17 +-- .../Dialect/QuantOps/IR/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/QuantOps/IR/QuantOps.cpp | 17 +-- mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp | 17 +-- mlir/lib/Dialect/QuantOps/IR/TypeDetail.h | 17 +-- mlir/lib/Dialect/QuantOps/IR/TypeParser.cpp | 17 +-- .../Dialect/QuantOps/Transforms/ConvertConst.cpp | 17 +-- .../QuantOps/Transforms/ConvertSimQuant.cpp | 17 +-- .../Dialect/QuantOps/Utils/FakeQuantSupport.cpp | 17 +-- mlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp | 17 +-- mlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp | 17 +-- mlir/lib/Dialect/SDBM/SDBM.cpp | 17 +-- mlir/lib/Dialect/SDBM/SDBMDialect.cpp | 17 +-- mlir/lib/Dialect/SDBM/SDBMExpr.cpp | 17 +-- mlir/lib/Dialect/SDBM/SDBMExprDetail.h | 17 +-- mlir/lib/Dialect/SPIRV/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/SPIRV/LayoutUtils.cpp | 17 +-- mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp | 17 +-- mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | 17 +-- mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp | 17 +-- .../Dialect/SPIRV/Serialization/Deserializer.cpp | 17 +-- .../SPIRV/Serialization/SPIRVBinaryUtils.cpp | 17 +-- .../lib/Dialect/SPIRV/Serialization/Serializer.cpp | 17 +-- .../SPIRV/Serialization/TranslateRegistration.cpp | 17 +-- .../DecorateSPIRVCompositeTypeLayoutPass.cpp | 17 +-- .../SPIRV/Transforms/LowerABIAttributesPass.cpp | 17 +-- .../Dialect/StandardOps/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/StandardOps/Ops.cpp | 17 +-- mlir/lib/Dialect/Traits.cpp | 17 +-- mlir/lib/Dialect/VectorOps/DialectRegistration.cpp | 17 +-- mlir/lib/Dialect/VectorOps/VectorOps.cpp | 17 +-- mlir/lib/Dialect/VectorOps/VectorTransforms.cpp | 17 +-- mlir/lib/EDSC/Builders.cpp | 17 +-- mlir/lib/EDSC/CoreAPIs.cpp | 17 +-- mlir/lib/EDSC/Helpers.cpp | 17 +-- mlir/lib/EDSC/Intrinsics.cpp | 17 +-- mlir/lib/ExecutionEngine/ExecutionEngine.cpp | 17 +-- mlir/lib/ExecutionEngine/OptUtils.cpp | 17 +-- mlir/lib/IR/AffineExpr.cpp | 17 +-- mlir/lib/IR/AffineExprDetail.h | 17 +-- mlir/lib/IR/AffineMap.cpp | 17 +-- mlir/lib/IR/AffineMapDetail.h | 17 +-- mlir/lib/IR/AsmPrinter.cpp | 17 +-- mlir/lib/IR/AttributeDetail.h | 17 +-- mlir/lib/IR/Attributes.cpp | 17 +-- mlir/lib/IR/Block.cpp | 17 +-- mlir/lib/IR/Builders.cpp | 17 +-- mlir/lib/IR/Diagnostics.cpp | 17 +-- mlir/lib/IR/Dialect.cpp | 17 +-- mlir/lib/IR/Function.cpp | 17 +-- mlir/lib/IR/FunctionImplementation.cpp | 17 +-- mlir/lib/IR/IntegerSet.cpp | 17 +-- mlir/lib/IR/IntegerSetDetail.h | 17 +-- mlir/lib/IR/Location.cpp | 17 +-- mlir/lib/IR/LocationDetail.h | 17 +-- mlir/lib/IR/MLIRContext.cpp | 17 +-- mlir/lib/IR/Module.cpp | 17 +-- mlir/lib/IR/Operation.cpp | 17 +-- mlir/lib/IR/OperationSupport.cpp | 17 +-- mlir/lib/IR/PatternMatch.cpp | 17 +-- mlir/lib/IR/Region.cpp | 17 +-- mlir/lib/IR/StandardTypes.cpp | 17 +-- mlir/lib/IR/SymbolTable.cpp | 17 +-- mlir/lib/IR/TypeDetail.h | 17 +-- mlir/lib/IR/TypeUtilities.cpp | 17 +-- mlir/lib/IR/Types.cpp | 17 +-- mlir/lib/IR/Value.cpp | 17 +-- mlir/lib/IR/Visitors.cpp | 17 +-- mlir/lib/Parser/Lexer.cpp | 17 +-- mlir/lib/Parser/Lexer.h | 17 +-- mlir/lib/Parser/Parser.cpp | 17 +-- mlir/lib/Parser/Token.cpp | 17 +-- mlir/lib/Parser/Token.h | 17 +-- mlir/lib/Parser/TokenKinds.def | 17 +-- mlir/lib/Pass/IRPrinting.cpp | 17 +-- mlir/lib/Pass/Pass.cpp | 17 +-- mlir/lib/Pass/PassDetail.h | 17 +-- mlir/lib/Pass/PassManagerOptions.cpp | 17 +-- mlir/lib/Pass/PassRegistry.cpp | 17 +-- mlir/lib/Pass/PassStatistics.cpp | 17 +-- mlir/lib/Pass/PassTiming.cpp | 17 +-- .../lib/Quantizer/Configurations/FxpMathConfig.cpp | 17 +-- mlir/lib/Quantizer/Support/Configuration.cpp | 17 +-- .../Quantizer/Support/ConstraintAnalysisGraph.cpp | 17 +-- mlir/lib/Quantizer/Support/Metadata.cpp | 17 +-- mlir/lib/Quantizer/Support/Statistics.cpp | 17 +-- mlir/lib/Quantizer/Support/TypeUtils.cpp | 17 +-- mlir/lib/Quantizer/Support/UniformConstraints.cpp | 17 +-- mlir/lib/Quantizer/Support/UniformSolvers.cpp | 17 +-- .../Transforms/AddDefaultStatsTestPass.cpp | 17 +-- .../Transforms/InferQuantizedTypesPass.cpp | 17 +-- .../Transforms/RemoveInstrumentationPass.cpp | 17 +-- mlir/lib/Support/FileUtilities.cpp | 17 +-- mlir/lib/Support/JitRunner.cpp | 17 +-- mlir/lib/Support/MlirOptMain.cpp | 17 +-- mlir/lib/Support/StorageUniquer.cpp | 17 +-- mlir/lib/Support/ToolUtilities.cpp | 17 +-- mlir/lib/Support/TranslateClParser.cpp | 17 +-- mlir/lib/TableGen/Argument.cpp | 17 +-- mlir/lib/TableGen/Attribute.cpp | 17 +-- mlir/lib/TableGen/Constraint.cpp | 17 +-- mlir/lib/TableGen/Dialect.cpp | 17 +-- mlir/lib/TableGen/Format.cpp | 17 +-- mlir/lib/TableGen/OpInterfaces.cpp | 17 +-- mlir/lib/TableGen/OpTrait.cpp | 17 +-- mlir/lib/TableGen/Operator.cpp | 17 +-- mlir/lib/TableGen/Pattern.cpp | 17 +-- mlir/lib/TableGen/Predicate.cpp | 17 +-- mlir/lib/TableGen/Type.cpp | 17 +-- mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp | 17 +-- mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp | 17 +-- mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp | 17 +-- mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp | 17 +-- mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 17 +-- mlir/lib/Transforms/AffineDataCopyGeneration.cpp | 17 +-- .../Transforms/AffineLoopInvariantCodeMotion.cpp | 17 +-- mlir/lib/Transforms/CSE.cpp | 17 +-- mlir/lib/Transforms/Canonicalizer.cpp | 17 +-- mlir/lib/Transforms/DialectConversion.cpp | 17 +-- mlir/lib/Transforms/Inliner.cpp | 17 +-- mlir/lib/Transforms/LoopCoalescing.cpp | 17 +-- mlir/lib/Transforms/LoopFusion.cpp | 17 +-- mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | 17 +-- mlir/lib/Transforms/LoopTiling.cpp | 17 +-- mlir/lib/Transforms/LoopUnroll.cpp | 17 +-- mlir/lib/Transforms/LoopUnrollAndJam.cpp | 17 +-- mlir/lib/Transforms/MemRefDataFlowOpt.cpp | 17 +-- mlir/lib/Transforms/PipelineDataTransfer.cpp | 17 +-- mlir/lib/Transforms/SimplifyAffineStructures.cpp | 17 +-- mlir/lib/Transforms/StripDebugInfo.cpp | 17 +-- mlir/lib/Transforms/Utils/FoldUtils.cpp | 17 +-- .../Utils/GreedyPatternRewriteDriver.cpp | 17 +-- mlir/lib/Transforms/Utils/InliningUtils.cpp | 17 +-- mlir/lib/Transforms/Utils/LoopFusionUtils.cpp | 17 +-- mlir/lib/Transforms/Utils/LoopUtils.cpp | 17 +-- mlir/lib/Transforms/Utils/RegionUtils.cpp | 17 +-- mlir/lib/Transforms/Utils/Utils.cpp | 17 +-- mlir/lib/Transforms/Vectorize.cpp | 17 +-- mlir/lib/Transforms/ViewOpGraph.cpp | 17 +-- mlir/lib/Transforms/ViewRegionGraph.cpp | 17 +-- mlir/lib/Translation/Translation.cpp | 17 +-- mlir/test/APITest.h | 17 +-- mlir/test/EDSC/builder-api-test.cpp | 17 +-- mlir/test/SDBM/sdbm-api-test.cpp | 17 +-- .../TestLinalgTransformPatterns.td | 17 +-- .../TestVectorTransformPatterns.td | 17 +-- mlir/test/lib/IR/TestFunc.cpp | 17 +-- mlir/test/lib/IR/TestMatchers.cpp | 17 +-- mlir/test/lib/IR/TestSymbolUses.cpp | 17 +-- mlir/test/lib/Pass/TestPassManager.cpp | 17 +-- mlir/test/lib/TestDialect/TestDialect.cpp | 17 +-- mlir/test/lib/TestDialect/TestDialect.h | 17 +-- mlir/test/lib/TestDialect/TestOps.td | 17 +-- mlir/test/lib/TestDialect/TestPatterns.cpp | 17 +-- mlir/test/lib/Transforms/TestCallGraph.cpp | 17 +-- mlir/test/lib/Transforms/TestConstantFold.cpp | 17 +-- mlir/test/lib/Transforms/TestInlining.cpp | 17 +-- mlir/test/lib/Transforms/TestLinalgTransforms.cpp | 17 +-- mlir/test/lib/Transforms/TestLiveness.cpp | 17 +-- mlir/test/lib/Transforms/TestLoopFusion.cpp | 17 +-- mlir/test/lib/Transforms/TestLoopMapping.cpp | 17 +-- .../lib/Transforms/TestLoopParametricTiling.cpp | 17 +-- .../lib/Transforms/TestMemRefStrideCalculation.cpp | 17 +-- mlir/test/lib/Transforms/TestOpaqueLoc.cpp | 17 +-- .../lib/Transforms/TestVectorToLoopsConversion.cpp | 17 +-- mlir/test/lib/Transforms/TestVectorTransforms.cpp | 17 +-- .../test/lib/Transforms/TestVectorizationUtils.cpp | 17 +-- mlir/test/mlir-cpu-runner/cblas.cpp | 17 +-- mlir/test/mlir-cpu-runner/cblas_interface.cpp | 17 +-- mlir/test/mlir-cpu-runner/include/cblas.h | 17 +-- .../mlir-cpu-runner/include/mlir_runner_utils.h | 17 +-- mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp | 17 +-- mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp | 17 +-- .../mlir-cuda-runner/cuda-runtime-wrappers.cpp | 17 +-- mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp | 17 +-- mlir/tools/mlir-opt/mlir-opt.cpp | 17 +-- mlir/tools/mlir-tblgen/DocGenUtilities.h | 17 +-- mlir/tools/mlir-tblgen/EnumsGen.cpp | 17 +-- mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp | 17 +-- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | 17 +-- mlir/tools/mlir-tblgen/OpDocGen.cpp | 17 +-- mlir/tools/mlir-tblgen/OpInterfacesGen.cpp | 17 +-- mlir/tools/mlir-tblgen/ReferenceImplGen.cpp | 17 +-- mlir/tools/mlir-tblgen/RewriterGen.cpp | 17 +-- mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp | 17 +-- mlir/tools/mlir-tblgen/StructsGen.cpp | 17 +-- mlir/tools/mlir-tblgen/mlir-tblgen.cpp | 17 +-- mlir/tools/mlir-translate/mlir-translate.cpp | 17 +-- mlir/unittests/ADT/TypeSwitchTest.cpp | 17 +-- mlir/unittests/Dialect/BroadcastShapeTest.cpp | 17 +-- .../Dialect/QuantOps/QuantizationUtilsTest.cpp | 17 +-- .../Dialect/SPIRV/DeserializationTest.cpp | 17 +-- mlir/unittests/Dialect/SPIRV/SerializationTest.cpp | 17 +-- mlir/unittests/IR/AttributeTest.cpp | 17 +-- mlir/unittests/IR/DialectTest.cpp | 17 +-- mlir/unittests/IR/OperationSupportTest.cpp | 17 +-- mlir/unittests/IR/StringExtrasTest.cpp | 17 +-- mlir/unittests/Pass/AnalysisManagerTest.cpp | 17 +-- mlir/unittests/Quantizer/Support/RulesTest.cpp | 17 +-- .../Quantizer/Support/UniformSolversTest.cpp | 17 +-- mlir/unittests/SDBM/SDBMTest.cpp | 17 +-- mlir/unittests/TableGen/EnumsGenTest.cpp | 17 +-- mlir/unittests/TableGen/FormatTest.cpp | 17 +-- mlir/unittests/TableGen/StructsGenTest.cpp | 17 +-- mlir/unittests/TableGen/enums.td | 17 +-- mlir/unittests/TableGen/structs.td | 17 +-- mlir/utils/generate-test-checks.py | 16 +-- mlir/utils/spirv/define_enum.sh | 16 +-- mlir/utils/spirv/define_inst.sh | 16 +-- mlir/utils/spirv/define_opcodes.sh | 16 +-- mlir/utils/spirv/gen_spirv_dialect.py | 16 +-- 593 files changed, 2464 insertions(+), 7723 deletions(-) (limited to 'mlir/test/mlir-cpu-runner/cblas_interface.cpp') diff --git a/mlir/LICENSE.TXT b/mlir/LICENSE.TXT index a4b160b6e33..fa6ac540007 100644 --- a/mlir/LICENSE.TXT +++ b/mlir/LICENSE.TXT @@ -1,12 +1,14 @@ -Copyright 2019 The MLIR Authors. +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 1. Definitions. + 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. @@ -65,14 +67,14 @@ Copyright 2019 The MLIR Authors. on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - 2. Grant of Copyright License. Subject to the terms and conditions of + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - 3. Grant of Patent License. Subject to the terms and conditions of + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, @@ -88,7 +90,7 @@ Copyright 2019 The MLIR Authors. granted to You under this License for that Work shall terminate as of the date such litigation is filed. - 4. Redistribution. You may reproduce and distribute copies of the + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: @@ -129,7 +131,7 @@ Copyright 2019 The MLIR Authors. reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - 5. Submission of Contributions. Unless You explicitly state otherwise, + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. @@ -137,12 +139,12 @@ Copyright 2019 The MLIR Authors. the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - 6. Trademarks. This License does not grant permission to use the trade + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - 7. Disclaimer of Warranty. Unless required by applicable law or + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or @@ -152,7 +154,7 @@ Copyright 2019 The MLIR Authors. appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - 8. Limitation of Liability. In no event and under no legal theory, + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be @@ -164,7 +166,7 @@ Copyright 2019 The MLIR Authors. other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - 9. Accepting Warranty or Additional Liability. While redistributing + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this @@ -175,9 +177,9 @@ Copyright 2019 The MLIR Authors. incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. + APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" @@ -188,18 +190,90 @@ Copyright 2019 The MLIR Authors. same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. diff --git a/mlir/bindings/python/pybind.cpp b/mlir/bindings/python/pybind.cpp index 54646cbe800..10445edaf12 100644 --- a/mlir/bindings/python/pybind.cpp +++ b/mlir/bindings/python/pybind.cpp @@ -1,19 +1,10 @@ //===- pybind.cpp - MLIR Python bindings ----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" diff --git a/mlir/examples/toy/Ch1/include/toy/AST.h b/mlir/examples/toy/Ch1/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch1/include/toy/AST.h +++ b/mlir/examples/toy/Ch1/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch1/include/toy/Lexer.h b/mlir/examples/toy/Ch1/include/toy/Lexer.h index 2e19cd09b20..a77a91bb564 100644 --- a/mlir/examples/toy/Ch1/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch1/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch1/include/toy/Parser.h b/mlir/examples/toy/Ch1/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch1/include/toy/Parser.h +++ b/mlir/examples/toy/Ch1/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch1/parser/AST.cpp b/mlir/examples/toy/Ch1/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch1/parser/AST.cpp +++ b/mlir/examples/toy/Ch1/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch1/toyc.cpp b/mlir/examples/toy/Ch1/toyc.cpp index 37794d5c4d9..48863fa931c 100644 --- a/mlir/examples/toy/Ch1/toyc.cpp +++ b/mlir/examples/toy/Ch1/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch2/include/toy/AST.h b/mlir/examples/toy/Ch2/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch2/include/toy/AST.h +++ b/mlir/examples/toy/Ch2/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch2/include/toy/Dialect.h b/mlir/examples/toy/Ch2/include/toy/Dialect.h index 91dd631d2ff..385d6ddb95a 100644 --- a/mlir/examples/toy/Ch2/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch2/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch2/include/toy/Lexer.h b/mlir/examples/toy/Ch2/include/toy/Lexer.h index 144388c460c..6eff64ee5f0 100644 --- a/mlir/examples/toy/Ch2/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch2/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch2/include/toy/MLIRGen.h b/mlir/examples/toy/Ch2/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch2/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch2/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch2/include/toy/Ops.td b/mlir/examples/toy/Ch2/include/toy/Ops.td index dd88b097ab1..20c4a7463d9 100644 --- a/mlir/examples/toy/Ch2/include/toy/Ops.td +++ b/mlir/examples/toy/Ch2/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch2/include/toy/Parser.h b/mlir/examples/toy/Ch2/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch2/include/toy/Parser.h +++ b/mlir/examples/toy/Ch2/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch2/mlir/Dialect.cpp b/mlir/examples/toy/Ch2/mlir/Dialect.cpp index 4a3232dabe3..b33cb5cbfe9 100644 --- a/mlir/examples/toy/Ch2/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch2/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp index 902c634a954..e9987ff2c77 100644 --- a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch2/parser/AST.cpp b/mlir/examples/toy/Ch2/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch2/parser/AST.cpp +++ b/mlir/examples/toy/Ch2/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch2/toyc.cpp b/mlir/examples/toy/Ch2/toyc.cpp index 19def702589..3e3db97b4ae 100644 --- a/mlir/examples/toy/Ch2/toyc.cpp +++ b/mlir/examples/toy/Ch2/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch3/include/toy/AST.h b/mlir/examples/toy/Ch3/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch3/include/toy/AST.h +++ b/mlir/examples/toy/Ch3/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch3/include/toy/Dialect.h b/mlir/examples/toy/Ch3/include/toy/Dialect.h index 91dd631d2ff..385d6ddb95a 100644 --- a/mlir/examples/toy/Ch3/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch3/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch3/include/toy/Lexer.h b/mlir/examples/toy/Ch3/include/toy/Lexer.h index 144388c460c..6eff64ee5f0 100644 --- a/mlir/examples/toy/Ch3/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch3/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch3/include/toy/MLIRGen.h b/mlir/examples/toy/Ch3/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch3/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch3/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch3/include/toy/Ops.td b/mlir/examples/toy/Ch3/include/toy/Ops.td index 6c400169da2..a6c93ccba10 100644 --- a/mlir/examples/toy/Ch3/include/toy/Ops.td +++ b/mlir/examples/toy/Ch3/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch3/include/toy/Parser.h b/mlir/examples/toy/Ch3/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch3/include/toy/Parser.h +++ b/mlir/examples/toy/Ch3/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch3/mlir/Dialect.cpp b/mlir/examples/toy/Ch3/mlir/Dialect.cpp index 4a3232dabe3..b33cb5cbfe9 100644 --- a/mlir/examples/toy/Ch3/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch3/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp index 902c634a954..e9987ff2c77 100644 --- a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp index 42a10397513..d52a2c173c1 100644 --- a/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp +++ b/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp @@ -1,19 +1,10 @@ //===- ToyCombine.cpp - Toy High Level Optimizer --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a set of simple combiners for optimizing operations in // the Toy dialect. diff --git a/mlir/examples/toy/Ch3/mlir/ToyCombine.td b/mlir/examples/toy/Ch3/mlir/ToyCombine.td index 1ca143a913c..e6e33e84d7e 100644 --- a/mlir/examples/toy/Ch3/mlir/ToyCombine.td +++ b/mlir/examples/toy/Ch3/mlir/ToyCombine.td @@ -1,19 +1,10 @@ //===- ToyCombine.td - Pattern Match Optimizations for Toy -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines language-specific pattern match optimizations for Toy using // Declarative Rewrite Rules (DRR) specified using TableGen records. diff --git a/mlir/examples/toy/Ch3/parser/AST.cpp b/mlir/examples/toy/Ch3/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch3/parser/AST.cpp +++ b/mlir/examples/toy/Ch3/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch3/toyc.cpp b/mlir/examples/toy/Ch3/toyc.cpp index 410a9d677e8..e8b6e94786b 100644 --- a/mlir/examples/toy/Ch3/toyc.cpp +++ b/mlir/examples/toy/Ch3/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch4/include/toy/AST.h b/mlir/examples/toy/Ch4/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch4/include/toy/AST.h +++ b/mlir/examples/toy/Ch4/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch4/include/toy/Dialect.h b/mlir/examples/toy/Ch4/include/toy/Dialect.h index 556ae972b84..5e8b91dcf48 100644 --- a/mlir/examples/toy/Ch4/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch4/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch4/include/toy/Lexer.h b/mlir/examples/toy/Ch4/include/toy/Lexer.h index 144388c460c..6eff64ee5f0 100644 --- a/mlir/examples/toy/Ch4/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch4/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch4/include/toy/MLIRGen.h b/mlir/examples/toy/Ch4/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch4/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch4/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td index ef5b30a862b..71167664bbc 100644 --- a/mlir/examples/toy/Ch4/include/toy/Ops.td +++ b/mlir/examples/toy/Ch4/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch4/include/toy/Parser.h b/mlir/examples/toy/Ch4/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch4/include/toy/Parser.h +++ b/mlir/examples/toy/Ch4/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch4/include/toy/Passes.h b/mlir/examples/toy/Ch4/include/toy/Passes.h index 8c8365d6882..93c51309008 100644 --- a/mlir/examples/toy/Ch4/include/toy/Passes.h +++ b/mlir/examples/toy/Ch4/include/toy/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Toy Passes Definition -----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file exposes the entry points to create compiler passes for Toy. // diff --git a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.h b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.h index fc36b5b100d..da0fb66018e 100644 --- a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.h +++ b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.h @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.h - Interface definitions for ShapeInference -=// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the declarations of the shape inference interfaces defined // in ShapeInferenceInterface.td. diff --git a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td index 6974575a63c..1b38ada1622 100644 --- a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td +++ b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.td - Shape Inference Interface -*- tablegen -==// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Shape Inference Op Interface. // diff --git a/mlir/examples/toy/Ch4/mlir/DeadFunctionEliminationPass.cpp b/mlir/examples/toy/Ch4/mlir/DeadFunctionEliminationPass.cpp index b58adb5d52f..1ee34547860 100644 --- a/mlir/examples/toy/Ch4/mlir/DeadFunctionEliminationPass.cpp +++ b/mlir/examples/toy/Ch4/mlir/DeadFunctionEliminationPass.cpp @@ -1,19 +1,10 @@ //===- DeadFunctionEliminationPass.cpp - Eliminate inlined functions ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Module level pass performing dead function // elimination. This is required as a post-processing step after function diff --git a/mlir/examples/toy/Ch4/mlir/Dialect.cpp b/mlir/examples/toy/Ch4/mlir/Dialect.cpp index 8be1094cf15..50116b14bea 100644 --- a/mlir/examples/toy/Ch4/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch4/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp index 902c634a954..e9987ff2c77 100644 --- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp index 1f572015c39..517a1f07530 100644 --- a/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp +++ b/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp @@ -1,19 +1,10 @@ //===- ShapeInferencePass.cpp - Shape Inference ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Function level pass performing interprocedural // propagation of array shapes through function specialization. diff --git a/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp index 604e9fa6c83..2cbf8bdac9b 100644 --- a/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp +++ b/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp @@ -1,19 +1,10 @@ //===- ToyCombine.cpp - Toy High Level Optimizer --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a set of simple combiners for optimizing operations in // the Toy dialect. diff --git a/mlir/examples/toy/Ch4/mlir/ToyCombine.td b/mlir/examples/toy/Ch4/mlir/ToyCombine.td index 1ca143a913c..e6e33e84d7e 100644 --- a/mlir/examples/toy/Ch4/mlir/ToyCombine.td +++ b/mlir/examples/toy/Ch4/mlir/ToyCombine.td @@ -1,19 +1,10 @@ //===- ToyCombine.td - Pattern Match Optimizations for Toy -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines language-specific pattern match optimizations for Toy using // Declarative Rewrite Rules (DRR) specified using TableGen records. diff --git a/mlir/examples/toy/Ch4/parser/AST.cpp b/mlir/examples/toy/Ch4/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch4/parser/AST.cpp +++ b/mlir/examples/toy/Ch4/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch4/toyc.cpp b/mlir/examples/toy/Ch4/toyc.cpp index 5ec514ac5b9..e7b584407f6 100644 --- a/mlir/examples/toy/Ch4/toyc.cpp +++ b/mlir/examples/toy/Ch4/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch5/include/toy/AST.h b/mlir/examples/toy/Ch5/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch5/include/toy/AST.h +++ b/mlir/examples/toy/Ch5/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch5/include/toy/Dialect.h b/mlir/examples/toy/Ch5/include/toy/Dialect.h index 556ae972b84..5e8b91dcf48 100644 --- a/mlir/examples/toy/Ch5/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch5/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch5/include/toy/Lexer.h b/mlir/examples/toy/Ch5/include/toy/Lexer.h index 144388c460c..6eff64ee5f0 100644 --- a/mlir/examples/toy/Ch5/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch5/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch5/include/toy/MLIRGen.h b/mlir/examples/toy/Ch5/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch5/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch5/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td index b3bda1d647b..bb98ae19a09 100644 --- a/mlir/examples/toy/Ch5/include/toy/Ops.td +++ b/mlir/examples/toy/Ch5/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch5/include/toy/Parser.h b/mlir/examples/toy/Ch5/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch5/include/toy/Parser.h +++ b/mlir/examples/toy/Ch5/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch5/include/toy/Passes.h b/mlir/examples/toy/Ch5/include/toy/Passes.h index b6a79eda176..97a5d0db46c 100644 --- a/mlir/examples/toy/Ch5/include/toy/Passes.h +++ b/mlir/examples/toy/Ch5/include/toy/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Toy Passes Definition -----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file exposes the entry points to create compiler passes for Toy. // diff --git a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.h b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.h index fc36b5b100d..da0fb66018e 100644 --- a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.h +++ b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.h @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.h - Interface definitions for ShapeInference -=// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the declarations of the shape inference interfaces defined // in ShapeInferenceInterface.td. diff --git a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td index 6974575a63c..1b38ada1622 100644 --- a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td +++ b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.td - Shape Inference Interface -*- tablegen -==// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Shape Inference Op Interface. // diff --git a/mlir/examples/toy/Ch5/mlir/DeadFunctionEliminationPass.cpp b/mlir/examples/toy/Ch5/mlir/DeadFunctionEliminationPass.cpp index b58adb5d52f..1ee34547860 100644 --- a/mlir/examples/toy/Ch5/mlir/DeadFunctionEliminationPass.cpp +++ b/mlir/examples/toy/Ch5/mlir/DeadFunctionEliminationPass.cpp @@ -1,19 +1,10 @@ //===- DeadFunctionEliminationPass.cpp - Eliminate inlined functions ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Module level pass performing dead function // elimination. This is required as a post-processing step after function diff --git a/mlir/examples/toy/Ch5/mlir/Dialect.cpp b/mlir/examples/toy/Ch5/mlir/Dialect.cpp index 8be1094cf15..50116b14bea 100644 --- a/mlir/examples/toy/Ch5/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch5/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp index 3fa761c7404..cba838a2928 100644 --- a/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp +++ b/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp @@ -1,19 +1,10 @@ //====- LowerToAffineLoops.cpp - Partial lowering from Toy to Affine+Std --===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a partial lowering of Toy operations to a combination of // affine loops and standard operations. This lowering expects that all calls diff --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp index 902c634a954..e9987ff2c77 100644 --- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp index 1f572015c39..517a1f07530 100644 --- a/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp +++ b/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp @@ -1,19 +1,10 @@ //===- ShapeInferencePass.cpp - Shape Inference ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Function level pass performing interprocedural // propagation of array shapes through function specialization. diff --git a/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp index 604e9fa6c83..2cbf8bdac9b 100644 --- a/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp +++ b/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp @@ -1,19 +1,10 @@ //===- ToyCombine.cpp - Toy High Level Optimizer --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a set of simple combiners for optimizing operations in // the Toy dialect. diff --git a/mlir/examples/toy/Ch5/mlir/ToyCombine.td b/mlir/examples/toy/Ch5/mlir/ToyCombine.td index 1ca143a913c..e6e33e84d7e 100644 --- a/mlir/examples/toy/Ch5/mlir/ToyCombine.td +++ b/mlir/examples/toy/Ch5/mlir/ToyCombine.td @@ -1,19 +1,10 @@ //===- ToyCombine.td - Pattern Match Optimizations for Toy -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines language-specific pattern match optimizations for Toy using // Declarative Rewrite Rules (DRR) specified using TableGen records. diff --git a/mlir/examples/toy/Ch5/parser/AST.cpp b/mlir/examples/toy/Ch5/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch5/parser/AST.cpp +++ b/mlir/examples/toy/Ch5/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch5/toyc.cpp b/mlir/examples/toy/Ch5/toyc.cpp index e1ab8c0ce55..836968e2188 100644 --- a/mlir/examples/toy/Ch5/toyc.cpp +++ b/mlir/examples/toy/Ch5/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch6/include/toy/AST.h b/mlir/examples/toy/Ch6/include/toy/AST.h index 901164b0f39..820600b5b1c 100644 --- a/mlir/examples/toy/Ch6/include/toy/AST.h +++ b/mlir/examples/toy/Ch6/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch6/include/toy/Dialect.h b/mlir/examples/toy/Ch6/include/toy/Dialect.h index 556ae972b84..5e8b91dcf48 100644 --- a/mlir/examples/toy/Ch6/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch6/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch6/include/toy/Lexer.h b/mlir/examples/toy/Ch6/include/toy/Lexer.h index 144388c460c..6eff64ee5f0 100644 --- a/mlir/examples/toy/Ch6/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch6/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch6/include/toy/MLIRGen.h b/mlir/examples/toy/Ch6/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch6/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch6/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td index b3bda1d647b..bb98ae19a09 100644 --- a/mlir/examples/toy/Ch6/include/toy/Ops.td +++ b/mlir/examples/toy/Ch6/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch6/include/toy/Parser.h b/mlir/examples/toy/Ch6/include/toy/Parser.h index 9e219e56551..4557ea26859 100644 --- a/mlir/examples/toy/Ch6/include/toy/Parser.h +++ b/mlir/examples/toy/Ch6/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch6/include/toy/Passes.h b/mlir/examples/toy/Ch6/include/toy/Passes.h index 00fe4ffe49b..33c2021c8db 100644 --- a/mlir/examples/toy/Ch6/include/toy/Passes.h +++ b/mlir/examples/toy/Ch6/include/toy/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Toy Passes Definition -----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file exposes the entry points to create compiler passes for Toy. // diff --git a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.h b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.h index fc36b5b100d..da0fb66018e 100644 --- a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.h +++ b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.h @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.h - Interface definitions for ShapeInference -=// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the declarations of the shape inference interfaces defined // in ShapeInferenceInterface.td. diff --git a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td index 6974575a63c..1b38ada1622 100644 --- a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td +++ b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.td - Shape Inference Interface -*- tablegen -==// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Shape Inference Op Interface. // diff --git a/mlir/examples/toy/Ch6/mlir/DeadFunctionEliminationPass.cpp b/mlir/examples/toy/Ch6/mlir/DeadFunctionEliminationPass.cpp index b58adb5d52f..1ee34547860 100644 --- a/mlir/examples/toy/Ch6/mlir/DeadFunctionEliminationPass.cpp +++ b/mlir/examples/toy/Ch6/mlir/DeadFunctionEliminationPass.cpp @@ -1,19 +1,10 @@ //===- DeadFunctionEliminationPass.cpp - Eliminate inlined functions ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Module level pass performing dead function // elimination. This is required as a post-processing step after function diff --git a/mlir/examples/toy/Ch6/mlir/Dialect.cpp b/mlir/examples/toy/Ch6/mlir/Dialect.cpp index 8be1094cf15..50116b14bea 100644 --- a/mlir/examples/toy/Ch6/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch6/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp index 3fa761c7404..cba838a2928 100644 --- a/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp +++ b/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp @@ -1,19 +1,10 @@ //====- LowerToAffineLoops.cpp - Partial lowering from Toy to Affine+Std --===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a partial lowering of Toy operations to a combination of // affine loops and standard operations. This lowering expects that all calls diff --git a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp index c3180b4a92d..377bc11dd27 100644 --- a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp @@ -1,19 +1,10 @@ //====- LowerToLLVM.cpp - Lowering from Toy+Affine+Std to LLVM ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a partial lowering of Toy operations to a combination of // affine loops and standard operations. This lowering expects that all calls diff --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp index 902c634a954..e9987ff2c77 100644 --- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp index 1f572015c39..517a1f07530 100644 --- a/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp +++ b/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp @@ -1,19 +1,10 @@ //===- ShapeInferencePass.cpp - Shape Inference ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Function level pass performing interprocedural // propagation of array shapes through function specialization. diff --git a/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp index 604e9fa6c83..2cbf8bdac9b 100644 --- a/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp +++ b/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp @@ -1,19 +1,10 @@ //===- ToyCombine.cpp - Toy High Level Optimizer --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a set of simple combiners for optimizing operations in // the Toy dialect. diff --git a/mlir/examples/toy/Ch6/mlir/ToyCombine.td b/mlir/examples/toy/Ch6/mlir/ToyCombine.td index 1ca143a913c..e6e33e84d7e 100644 --- a/mlir/examples/toy/Ch6/mlir/ToyCombine.td +++ b/mlir/examples/toy/Ch6/mlir/ToyCombine.td @@ -1,19 +1,10 @@ //===- ToyCombine.td - Pattern Match Optimizations for Toy -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines language-specific pattern match optimizations for Toy using // Declarative Rewrite Rules (DRR) specified using TableGen records. diff --git a/mlir/examples/toy/Ch6/parser/AST.cpp b/mlir/examples/toy/Ch6/parser/AST.cpp index 3ec91a4300d..0d6d9359529 100644 --- a/mlir/examples/toy/Ch6/parser/AST.cpp +++ b/mlir/examples/toy/Ch6/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp index 60e3d0f9791..4e5b2afb7c6 100644 --- a/mlir/examples/toy/Ch6/toyc.cpp +++ b/mlir/examples/toy/Ch6/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/examples/toy/Ch7/include/toy/AST.h b/mlir/examples/toy/Ch7/include/toy/AST.h index 558d9deab8e..3d3ae89dbeb 100644 --- a/mlir/examples/toy/Ch7/include/toy/AST.h +++ b/mlir/examples/toy/Ch7/include/toy/AST.h @@ -1,19 +1,10 @@ //===- AST.h - Node definition for the Toy AST ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST for the Toy language. It is optimized for // simplicity, not efficiency. The AST forms a tree structure where each node diff --git a/mlir/examples/toy/Ch7/include/toy/Dialect.h b/mlir/examples/toy/Ch7/include/toy/Dialect.h index b96ff99a5b6..77481b1884f 100644 --- a/mlir/examples/toy/Ch7/include/toy/Dialect.h +++ b/mlir/examples/toy/Ch7/include/toy/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - Dialect definition for the Toy IR ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the IR Dialect for the Toy language. // See g3doc/Tutorials/Toy/Ch-2.md for more information. diff --git a/mlir/examples/toy/Ch7/include/toy/Lexer.h b/mlir/examples/toy/Ch7/include/toy/Lexer.h index 89dc6cba9ff..b41b82f2a0a 100644 --- a/mlir/examples/toy/Ch7/include/toy/Lexer.h +++ b/mlir/examples/toy/Ch7/include/toy/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - Lexer for the Toy language -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple Lexer for the Toy language. // diff --git a/mlir/examples/toy/Ch7/include/toy/MLIRGen.h b/mlir/examples/toy/Ch7/include/toy/MLIRGen.h index 287f432c847..e1c8ca1201d 100644 --- a/mlir/examples/toy/Ch7/include/toy/MLIRGen.h +++ b/mlir/examples/toy/Ch7/include/toy/MLIRGen.h @@ -1,19 +1,10 @@ //===- MLIRGen.h - MLIR Generation from a Toy AST -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a simple interface to perform IR generation targeting MLIR // from a Module AST for the Toy language. diff --git a/mlir/examples/toy/Ch7/include/toy/Ops.td b/mlir/examples/toy/Ch7/include/toy/Ops.td index 94f1bcf3e82..801aef06934 100644 --- a/mlir/examples/toy/Ch7/include/toy/Ops.td +++ b/mlir/examples/toy/Ch7/include/toy/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Toy dialect operation definitions ----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Toy dialect. // diff --git a/mlir/examples/toy/Ch7/include/toy/Parser.h b/mlir/examples/toy/Ch7/include/toy/Parser.h index df6c4fb2f60..d2659e04dac 100644 --- a/mlir/examples/toy/Ch7/include/toy/Parser.h +++ b/mlir/examples/toy/Ch7/include/toy/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - Toy Language Parser -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the Toy language. It processes the Token // provided by the Lexer and returns an AST. diff --git a/mlir/examples/toy/Ch7/include/toy/Passes.h b/mlir/examples/toy/Ch7/include/toy/Passes.h index 00fe4ffe49b..33c2021c8db 100644 --- a/mlir/examples/toy/Ch7/include/toy/Passes.h +++ b/mlir/examples/toy/Ch7/include/toy/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Toy Passes Definition -----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file exposes the entry points to create compiler passes for Toy. // diff --git a/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.h b/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.h index fc36b5b100d..da0fb66018e 100644 --- a/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.h +++ b/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.h @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.h - Interface definitions for ShapeInference -=// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the declarations of the shape inference interfaces defined // in ShapeInferenceInterface.td. diff --git a/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.td index 6974575a63c..1b38ada1622 100644 --- a/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.td +++ b/mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.td @@ -1,19 +1,10 @@ //===- ShapeInferenceInterface.td - Shape Inference Interface -*- tablegen -==// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the operations of the Shape Inference Op Interface. // diff --git a/mlir/examples/toy/Ch7/mlir/DeadFunctionEliminationPass.cpp b/mlir/examples/toy/Ch7/mlir/DeadFunctionEliminationPass.cpp index b58adb5d52f..1ee34547860 100644 --- a/mlir/examples/toy/Ch7/mlir/DeadFunctionEliminationPass.cpp +++ b/mlir/examples/toy/Ch7/mlir/DeadFunctionEliminationPass.cpp @@ -1,19 +1,10 @@ //===- DeadFunctionEliminationPass.cpp - Eliminate inlined functions ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Module level pass performing dead function // elimination. This is required as a post-processing step after function diff --git a/mlir/examples/toy/Ch7/mlir/Dialect.cpp b/mlir/examples/toy/Ch7/mlir/Dialect.cpp index 0ce896db5de..4f4cbdf2f0f 100644 --- a/mlir/examples/toy/Ch7/mlir/Dialect.cpp +++ b/mlir/examples/toy/Ch7/mlir/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Toy IR Dialect registration in MLIR ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the dialect for the Toy IR: custom type parsing and // operation verification. diff --git a/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp index 3fa761c7404..cba838a2928 100644 --- a/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp +++ b/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp @@ -1,19 +1,10 @@ //====- LowerToAffineLoops.cpp - Partial lowering from Toy to Affine+Std --===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a partial lowering of Toy operations to a combination of // affine loops and standard operations. This lowering expects that all calls diff --git a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp index c3180b4a92d..377bc11dd27 100644 --- a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp @@ -1,19 +1,10 @@ //====- LowerToLLVM.cpp - Lowering from Toy+Affine+Std to LLVM ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a partial lowering of Toy operations to a combination of // affine loops and standard operations. This lowering expects that all calls diff --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp index 590b21e53a1..62e8c553709 100644 --- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp @@ -1,19 +1,10 @@ //===- MLIRGen.cpp - MLIR Generation from a Toy AST -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple IR generation targeting MLIR from a Module AST // for the Toy language. diff --git a/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp index 1f572015c39..517a1f07530 100644 --- a/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp +++ b/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp @@ -1,19 +1,10 @@ //===- ShapeInferencePass.cpp - Shape Inference ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a Function level pass performing interprocedural // propagation of array shapes through function specialization. diff --git a/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp index d18396c63bb..2fb0a1c5b69 100644 --- a/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp +++ b/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp @@ -1,19 +1,10 @@ //===- ToyCombine.cpp - Toy High Level Optimizer --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a set of simple combiners for optimizing operations in // the Toy dialect. diff --git a/mlir/examples/toy/Ch7/mlir/ToyCombine.td b/mlir/examples/toy/Ch7/mlir/ToyCombine.td index 1ca143a913c..e6e33e84d7e 100644 --- a/mlir/examples/toy/Ch7/mlir/ToyCombine.td +++ b/mlir/examples/toy/Ch7/mlir/ToyCombine.td @@ -1,19 +1,10 @@ //===- ToyCombine.td - Pattern Match Optimizations for Toy -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines language-specific pattern match optimizations for Toy using // Declarative Rewrite Rules (DRR) specified using TableGen records. diff --git a/mlir/examples/toy/Ch7/parser/AST.cpp b/mlir/examples/toy/Ch7/parser/AST.cpp index 391757f711f..669bc9dbec2 100644 --- a/mlir/examples/toy/Ch7/parser/AST.cpp +++ b/mlir/examples/toy/Ch7/parser/AST.cpp @@ -1,19 +1,10 @@ //===- AST.cpp - Helper for printing out the Toy AST ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the AST dump for the Toy language. // diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp index ec5a4f8056b..c6afab594e1 100644 --- a/mlir/examples/toy/Ch7/toyc.cpp +++ b/mlir/examples/toy/Ch7/toyc.cpp @@ -1,19 +1,10 @@ //===- toyc.cpp - The Toy Compiler ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the entry point for the Toy compiler. // diff --git a/mlir/include/mlir-c/Core.h b/mlir/include/mlir-c/Core.h index c205e898901..5e3e2087f8b 100644 --- a/mlir/include/mlir-c/Core.h +++ b/mlir/include/mlir-c/Core.h @@ -1,18 +1,9 @@ /*===-- mlir-c/Core.h - Core Library C Interface ------------------*- C -*-===*\ |* *| -|* Copyright 2019 The MLIR Authors. *| -|* *| -|* Licensed under the Apache License, Version 2.0 (the "License"); *| -|* you may not use this file except in compliance with the License. *| -|* You may obtain a copy of the License at *| -|* *| -|* http://www.apache.org/licenses/LICENSE-2.0 *| -|* *| -|* Unless required by applicable law or agreed to in writing, software *| -|* distributed under the License is distributed on an "AS IS" BASIS, *| -|* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *| -|* See the License for the specific language governing permissions and *| -|* limitations under the License. *| +|* Part of the MLIR 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 *| |* *| |*===----------------------------------------------------------------------===*| |* *| diff --git a/mlir/include/mlir/ADT/TypeSwitch.h b/mlir/include/mlir/ADT/TypeSwitch.h index 75051b6a539..2dbc611f557 100644 --- a/mlir/include/mlir/ADT/TypeSwitch.h +++ b/mlir/include/mlir/ADT/TypeSwitch.h @@ -1,19 +1,10 @@ //===- TypeSwitch.h - Switch functionality for RTTI casting -*- C++ -*-----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the TypeSwitch template, which mimics a switch() // statement whose cases are type names. diff --git a/mlir/include/mlir/Analysis/AffineAnalysis.h b/mlir/include/mlir/Analysis/AffineAnalysis.h index f506470f36a..5d9422883c1 100644 --- a/mlir/include/mlir/Analysis/AffineAnalysis.h +++ b/mlir/include/mlir/Analysis/AffineAnalysis.h @@ -1,19 +1,10 @@ //===- AffineAnalysis.h - analyses for affine structures --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for methods that perform analysis // involving affine structures (AffineExprStorage, AffineMap, IntegerSet, etc.) diff --git a/mlir/include/mlir/Analysis/AffineStructures.h b/mlir/include/mlir/Analysis/AffineStructures.h index 65cf13a0ce6..770bf686f50 100644 --- a/mlir/include/mlir/Analysis/AffineStructures.h +++ b/mlir/include/mlir/Analysis/AffineStructures.h @@ -1,19 +1,10 @@ //===- AffineStructures.h - MLIR Affine Structures Class --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Structures for affine/polyhedral analysis of ML functions. // diff --git a/mlir/include/mlir/Analysis/CallGraph.h b/mlir/include/mlir/Analysis/CallGraph.h index 700a016e836..8f954161921 100644 --- a/mlir/include/mlir/Analysis/CallGraph.h +++ b/mlir/include/mlir/Analysis/CallGraph.h @@ -1,19 +1,10 @@ //===- CallGraph.h - CallGraph analysis for MLIR ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains an analysis for computing the multi-level callgraph from a // given top-level operation. This nodes within this callgraph are defined by diff --git a/mlir/include/mlir/Analysis/CallInterfaces.h b/mlir/include/mlir/Analysis/CallInterfaces.h index a18cfa7aba4..a9806bfb8c6 100644 --- a/mlir/include/mlir/Analysis/CallInterfaces.h +++ b/mlir/include/mlir/Analysis/CallInterfaces.h @@ -1,19 +1,10 @@ //===- CallInterfaces.h - Call Interfaces for MLIR --------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the definitions of the call interfaces defined in // `CallInterfaces.td`. diff --git a/mlir/include/mlir/Analysis/CallInterfaces.td b/mlir/include/mlir/Analysis/CallInterfaces.td index 043f009a8e2..3e5b599baf8 100644 --- a/mlir/include/mlir/Analysis/CallInterfaces.td +++ b/mlir/include/mlir/Analysis/CallInterfaces.td @@ -1,19 +1,10 @@ //===- CallInterfaces.td - Call Interfaces for ops -*- tablegen ---------*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains a set of interfaces that can be used to define information // related to call-like and callable operations. Each of which are defined along diff --git a/mlir/include/mlir/Analysis/Dominance.h b/mlir/include/mlir/Analysis/Dominance.h index f46241e2af0..5c42dbe12c2 100644 --- a/mlir/include/mlir/Analysis/Dominance.h +++ b/mlir/include/mlir/Analysis/Dominance.h @@ -1,19 +1,10 @@ //===- Dominance.h - Dominator analysis for CFGs ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_ANALYSIS_DOMINANCE_H #define MLIR_ANALYSIS_DOMINANCE_H diff --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.h b/mlir/include/mlir/Analysis/InferTypeOpInterface.h index 2d68ada0d13..baf16162a0b 100644 --- a/mlir/include/mlir/Analysis/InferTypeOpInterface.h +++ b/mlir/include/mlir/Analysis/InferTypeOpInterface.h @@ -1,19 +1,10 @@ //===- InferTypeOpInterface.h - Infer Type Interfaces -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the definitions of the infer op interfaces defined in // `InferTypeOpInterface.td`. diff --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.td b/mlir/include/mlir/Analysis/InferTypeOpInterface.td index 14d580962e1..bbcea6be7eb 100644 --- a/mlir/include/mlir/Analysis/InferTypeOpInterface.td +++ b/mlir/include/mlir/Analysis/InferTypeOpInterface.td @@ -1,19 +1,10 @@ //===- InferTypeOpInterface.td - Infer Type interfaces -----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains a set of interfaces that can be used to define information // related to type inference. diff --git a/mlir/include/mlir/Analysis/Liveness.h b/mlir/include/mlir/Analysis/Liveness.h index 0aa9d9693e4..791c164c7d2 100644 --- a/mlir/include/mlir/Analysis/Liveness.h +++ b/mlir/include/mlir/Analysis/Liveness.h @@ -1,19 +1,10 @@ //===- Liveness.h - Liveness analysis for MLIR ------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains an analysis for computing liveness information from a // given top-level operation. The current version of the analysis uses a diff --git a/mlir/include/mlir/Analysis/LoopAnalysis.h b/mlir/include/mlir/Analysis/LoopAnalysis.h index ad7dc6d6092..66f0033bf2f 100644 --- a/mlir/include/mlir/Analysis/LoopAnalysis.h +++ b/mlir/include/mlir/Analysis/LoopAnalysis.h @@ -1,19 +1,10 @@ //===- LoopAnalysis.h - loop analysis methods -------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for methods to analyze loops. // diff --git a/mlir/include/mlir/Analysis/NestedMatcher.h b/mlir/include/mlir/Analysis/NestedMatcher.h index 9af26e8842a..2da64e88e14 100644 --- a/mlir/include/mlir/Analysis/NestedMatcher.h +++ b/mlir/include/mlir/Analysis/NestedMatcher.h @@ -1,19 +1,10 @@ //===- NestedMacher.h - Nested matcher for Function -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_ #define MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_ diff --git a/mlir/include/mlir/Analysis/Passes.h b/mlir/include/mlir/Analysis/Passes.h index b233ab5f209..0bbc850e6c9 100644 --- a/mlir/include/mlir/Analysis/Passes.h +++ b/mlir/include/mlir/Analysis/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Pass Entrypoints ------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes that expose pass constructors in the // analysis library. diff --git a/mlir/include/mlir/Analysis/SliceAnalysis.h b/mlir/include/mlir/Analysis/SliceAnalysis.h index ad6b65387be..d7b6e957014 100644 --- a/mlir/include/mlir/Analysis/SliceAnalysis.h +++ b/mlir/include/mlir/Analysis/SliceAnalysis.h @@ -1,19 +1,10 @@ //===- SliceAnalysis.h - Analysis for Transitive UseDef chains --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_ANALYSIS_SLICEANALYSIS_H_ #define MLIR_ANALYSIS_SLICEANALYSIS_H_ diff --git a/mlir/include/mlir/Analysis/Utils.h b/mlir/include/mlir/Analysis/Utils.h index ea0987df3fe..d06e003faae 100644 --- a/mlir/include/mlir/Analysis/Utils.h +++ b/mlir/include/mlir/Analysis/Utils.h @@ -1,19 +1,10 @@ //===- Utils.h - General analysis utilities ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for various transformation utilities for // memref's and non-loop IR structures. These are not passes by themselves but diff --git a/mlir/include/mlir/Analysis/Verifier.h b/mlir/include/mlir/Analysis/Verifier.h index daaff57683e..b7075b4f157 100644 --- a/mlir/include/mlir/Analysis/Verifier.h +++ b/mlir/include/mlir/Analysis/Verifier.h @@ -1,19 +1,10 @@ //===- Verifier.h - Verifier analysis for MLIR structures -------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_ANALYSIS_VERIFIER_H #define MLIR_ANALYSIS_VERIFIER_H diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h index 4bbe6610e31..8e873bfb1c3 100644 --- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h +++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h @@ -1,19 +1,10 @@ //===- AffineToStandard.h - Convert Affine to Standard dialect --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H #define MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H diff --git a/mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h b/mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h index 6b9b08ed7d5..4eb6379adf6 100644 --- a/mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h +++ b/mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h @@ -1,19 +1,10 @@ //===- GPUToCUDAPass.h - MLIR CUDA runtime support --------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_GPUTOCUDA_GPUTOCUDAPASS_H_ #define MLIR_CONVERSION_GPUTOCUDA_GPUTOCUDAPASS_H_ diff --git a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h index 635d4366e83..75e4f7e374c 100644 --- a/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h +++ b/mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h @@ -1,19 +1,10 @@ //===- GPUToNVVMPass.h - Convert GPU kernel to NVVM dialect -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_ #define MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_ diff --git a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h index 54cda41afa1..e913c2e1131 100644 --- a/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h +++ b/mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h @@ -1,19 +1,10 @@ //===- GPUToROCDLPass.h - Convert GPU kernel to ROCDL dialect ---*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_GPUTOROCDL_GPUTOROCDLPASS_H_ #define MLIR_CONVERSION_GPUTOROCDL_GPUTOROCDLPASS_H_ diff --git a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h b/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h index 134dbf40b4d..762a6e502d4 100644 --- a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h +++ b/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h @@ -1,19 +1,10 @@ //===- ConvertGPUToSPIRV.h - GPU Ops to SPIR-V dialect patterns ----C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides patterns for lowering GPU Ops to SPIR-V dialect. // diff --git a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h b/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h index 8f0a910c74d..37230f4c0e1 100644 --- a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h +++ b/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h @@ -1,19 +1,10 @@ //===- ConvertGPUToSPIRVPass.h - GPU to SPIR-V conversion pass --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides a pass to convert GPU ops to SPIRV ops. // diff --git a/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h b/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h index 6bae08e13be..27950177c1d 100644 --- a/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h +++ b/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h @@ -1,19 +1,10 @@ //===- LinalgToLLVM.h - Utils to convert from the linalg dialect ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_LINALGTOLLVM_LINALGTOLLVM_H_ #define MLIR_CONVERSION_LINALGTOLLVM_LINALGTOLLVM_H_ diff --git a/mlir/include/mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h b/mlir/include/mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h index 095c9f470b3..5cb8f59e6f7 100644 --- a/mlir/include/mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h +++ b/mlir/include/mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h @@ -1,19 +1,10 @@ //===- ConvertLoopToStandard.h - Pass entrypoint ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_LOOPTOSTANDARD_CONVERTLOOPTOSTANDARD_H_ #define MLIR_CONVERSION_LOOPTOSTANDARD_CONVERTLOOPTOSTANDARD_H_ diff --git a/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPU.h b/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPU.h index 58d49a13391..5f3ea87f3cc 100644 --- a/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPU.h +++ b/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPU.h @@ -1,19 +1,10 @@ //===- LoopsToGPU.h - Convert loop nests to GPU kernels ---------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPU_H_ #define MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPU_H_ diff --git a/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h b/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h index a42320c9bdf..a3d663ae3d7 100644 --- a/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h +++ b/mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h @@ -1,19 +1,10 @@ //===- LoopsToGPUPass.h - Pass converting loops to GPU kernels --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPUPASS_H_ #define MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPUPASS_H_ diff --git a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h index 6f41fb68633..5c8a8e6e494 100644 --- a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h +++ b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h @@ -1,19 +1,10 @@ //===- ConvertStandardToLLVM.h - Convert to the LLVM dialect ----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides a dialect conversion targeting the LLVM IR dialect. By default, it // converts Standard ops and types and provides hooks for dialect-specific diff --git a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h index d49c1c22530..a4d95da6a75 100644 --- a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h +++ b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h @@ -1,19 +1,10 @@ //===- ConvertStandardToLLVMPass.h - Pass entrypoint ------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_STANDARDTOLLVM_CONVERTSTANDARDTOLLVMPASS_H_ #define MLIR_CONVERSION_STANDARDTOLLVM_CONVERTSTANDARDTOLLVMPASS_H_ diff --git a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h b/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h index 4caa6d9de77..e0e874027bf 100644 --- a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h +++ b/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h @@ -1,19 +1,10 @@ //===- ConvertStandardToSPIRV.h - Convert to SPIR-V dialect -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides patterns to lower StandardOps to SPIR-V dialect. // diff --git a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h b/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h index e8a71feb8b2..7dbaf1c0418 100644 --- a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h +++ b/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h @@ -1,19 +1,10 @@ //===- ConvertStandardToSPIRVPass.h - StdOps to SPIR-V pass -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides a pass to lower from StandardOps to SPIR-V dialect. // diff --git a/mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h b/mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h index a87e1c658a6..b8b97c21a3e 100644 --- a/mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h +++ b/mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h @@ -1,19 +1,10 @@ //===- ConvertVectorToLLVM.h - Utils to convert from the vector dialect ---===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLLVM_H_ #define MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLLVM_H_ diff --git a/mlir/include/mlir/Conversion/VectorToLoops/ConvertVectorToLoops.h b/mlir/include/mlir/Conversion/VectorToLoops/ConvertVectorToLoops.h index 198eaceda41..4f7d0843b73 100644 --- a/mlir/include/mlir/Conversion/VectorToLoops/ConvertVectorToLoops.h +++ b/mlir/include/mlir/Conversion/VectorToLoops/ConvertVectorToLoops.h @@ -1,19 +1,10 @@ //===- ConvertVectorToLoops.h - Utils to convert from the vector dialect --===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLOOPS_H_ #define MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLOOPS_H_ diff --git a/mlir/include/mlir/Dialect/AffineOps/AffineOps.h b/mlir/include/mlir/Dialect/AffineOps/AffineOps.h index 764f439e020..09408d2efc8 100644 --- a/mlir/include/mlir/Dialect/AffineOps/AffineOps.h +++ b/mlir/include/mlir/Dialect/AffineOps/AffineOps.h @@ -1,19 +1,10 @@ //===- AffineOps.h - MLIR Affine Operations -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines convenience types for working with Affine operations // in the MLIR operation set. diff --git a/mlir/include/mlir/Dialect/AffineOps/AffineOps.td b/mlir/include/mlir/Dialect/AffineOps/AffineOps.td index befdc2f6237..715e3807a95 100644 --- a/mlir/include/mlir/Dialect/AffineOps/AffineOps.td +++ b/mlir/include/mlir/Dialect/AffineOps/AffineOps.td @@ -1,19 +1,10 @@ //===- AffineOps.td - Affine operation definitions ---------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines MLIR affine operations. // diff --git a/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td b/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td index 755f65c338e..6aee5f3cd4a 100644 --- a/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td +++ b/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td @@ -1,19 +1,10 @@ //===- AffineOpsBase.td - Affine operation definitions -----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines base support for MLIR affine operations. // diff --git a/mlir/include/mlir/Dialect/CommonFolders.h b/mlir/include/mlir/Dialect/CommonFolders.h index 45552945f0d..d667de73d41 100644 --- a/mlir/include/mlir/Dialect/CommonFolders.h +++ b/mlir/include/mlir/Dialect/CommonFolders.h @@ -1,19 +1,10 @@ //===- CommonFolders.h - Common Operation Folders----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file declares various common operation folders. These folders // are intended to be used by dialects to support common folding behavior diff --git a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.h b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.h index 88a42344c3b..8c0e7aa1aad 100644 --- a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.h +++ b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.h @@ -1,19 +1,10 @@ //===- FxpMathOps.h - Fixed point ops ---------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_FXPMATHOPS_FXPMATHOPS_H_ #define MLIR_DIALECT_FXPMATHOPS_FXPMATHOPS_H_ diff --git a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td index b1bfb2706cf..d527b759a10 100644 --- a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td +++ b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td @@ -1,19 +1,10 @@ //===- FxpMathOps.td - Fixed point ops --------------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the operation definition file for fixed point ops (and real // equivalents). diff --git a/mlir/include/mlir/Dialect/FxpMathOps/Passes.h b/mlir/include/mlir/Dialect/FxpMathOps/Passes.h index 415b1c0b253..aec21c4c186 100644 --- a/mlir/include/mlir/Dialect/FxpMathOps/Passes.h +++ b/mlir/include/mlir/Dialect/FxpMathOps/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Fixed point math passes -----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines all of the passes owned by the FxpMathOps dialect. // diff --git a/mlir/include/mlir/Dialect/GPU/GPUDialect.h b/mlir/include/mlir/Dialect/GPU/GPUDialect.h index 12c2aa1bbd1..c3ab6ec5729 100644 --- a/mlir/include/mlir/Dialect/GPU/GPUDialect.h +++ b/mlir/include/mlir/Dialect/GPU/GPUDialect.h @@ -1,19 +1,10 @@ //===- GPUDialect.h - MLIR Dialect for GPU Kernels --------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the GPU kernel-related operations and puts them in the // corresponding dialect. diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td index def1ff2b8a1..037664d0d9b 100644 --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -1,19 +1,10 @@ //===-- GPUOps.td - GPU dialect operation definitions ------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines some operations of the GPU dialect. // diff --git a/mlir/include/mlir/Dialect/GPU/Passes.h b/mlir/include/mlir/Dialect/GPU/Passes.h index 7c8ce02db90..daf6d28d452 100644 --- a/mlir/include/mlir/Dialect/GPU/Passes.h +++ b/mlir/include/mlir/Dialect/GPU/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Pass Entrypoints ------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes that expose pass constructors. // diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h index a599d51b31f..bef1f2dbf20 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h @@ -1,19 +1,10 @@ //===- LLVMDialect.h - MLIR LLVM IR dialect ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the LLVM IR dialect in MLIR, containing LLVM operations and // LLVM type system. diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td index 6257b4a51d9..ed935d5b7f7 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td @@ -1,19 +1,10 @@ //===-- LLVMOpBase.td - LLVM IR dialect shared definitions -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains shared definitions for the LLVM IR dialect and its // subdialects. diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td index cfbbf7da65d..46f63206ef5 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -1,19 +1,10 @@ //===-- LLVMOps.td - LLVM IR dialect op definition file ----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the LLVM IR operation definition file. // diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h b/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h index 0328cf4ba94..afb6d4ab627 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h +++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h @@ -1,19 +1,10 @@ //===- NVVMDialect.h - MLIR NVVM IR dialect ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the NVVM IR dialect in MLIR, containing NVVM operations and // NVVM specific extensions to the LLVM type system. diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td index bc6887da8e4..f35b7798149 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td @@ -1,19 +1,10 @@ //===-- NVVMOps.td - NVVM IR dialect op definition file ----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the NVVM IR operation definition file. // diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h b/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h index a34c11223f3..dab32d30e8f 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h +++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h @@ -1,19 +1,10 @@ //===- ROCDLDialect.h - MLIR ROCDL IR dialect -------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the ROCDL dialect in MLIR, containing ROCDL operations // and ROCDL specific extensions to the LLVM type system. diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td index 79d4136d6f5..697ff9740a8 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td @@ -1,19 +1,10 @@ //===-- ROCDLOps.td - ROCDL IR dialect op definition file --*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the ROCDL IR operation definition file. // diff --git a/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h b/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h index 426708b14a8..1a2d6b9b3ba 100644 --- a/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h +++ b/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h @@ -1,19 +1,10 @@ //===- DependenceAnalysis.h - Dependence analysis on SSA views --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_ANALYSIS_DEPENDENCEANALYSIS_H_ #define MLIR_DIALECT_LINALG_ANALYSIS_DEPENDENCEANALYSIS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h b/mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h index 8375e750a5c..d0f6c942b95 100644 --- a/mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h +++ b/mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h @@ -1,19 +1,10 @@ //===- Builders.h - MLIR Declarative Linalg Builders ------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides intuitive composable interfaces for building structured MLIR // snippets in a declarative fashion. diff --git a/mlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h b/mlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h index f1acab69a4d..b04c11f22bb 100644 --- a/mlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h +++ b/mlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h @@ -1,19 +1,10 @@ //===- Intrinsics.h - MLIR EDSC Intrinsics for Linalg -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_EDSC_INTRINSICS_H_ #define MLIR_DIALECT_LINALG_EDSC_INTRINSICS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td index 4e77b0ac0a8..c1adc8b4d05 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td @@ -1,19 +1,10 @@ //===- LinalgBase.td - Linalg dialect base support ---------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the definition file for base linear algebra support. // diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgDoc.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgDoc.td index a3163f50476..819d02d396d 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgDoc.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgDoc.td @@ -1,19 +1,10 @@ //===- LinalgDoc.td - Linalg documentation -----------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This documentation files exists to circumvent limitations on mixing different // .td files in cases one does not want to have all ops belong to the same diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td index 18ca31cc376..e52019d7992 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td @@ -1,19 +1,10 @@ //===- LinalgLibraryOps.td - Linalg dialect library ops -*- tablegen ----*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the operation definition file for linear algebra operations that // correspond to underlying library calls (e.g. BLAS). diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h index c5f1f01d0c7..3249edb48e0 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h @@ -1,19 +1,10 @@ //===- LinalgOps.h - Linalg Operations --------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_LINALGOPS_H_ #define MLIR_DIALECT_LINALG_LINALGOPS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td index 5d402a9ded9..728fa619dbe 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -1,19 +1,10 @@ //===- LinalgOps.td - Linalg dialect ops -------------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the operation definition file for linear algebra operations. // diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td index 774be6616cd..8674c277e4a 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -1,19 +1,10 @@ //===- LinalgStructuredOps.td - Linalg dialect library ops -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the operation definition file for structured operations on buffers // that correspond to underlying library calls (e.g. BLAS). diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h index d196e6ccf94..7399aad6663 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h @@ -1,19 +1,10 @@ //===- LinalgTraits.h - Linalg Traits ---------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_LINALGTRAITS_H_ #define MLIR_DIALECT_LINALG_LINALGTRAITS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h index f779c3de6ae..abeda3e0552 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h @@ -1,19 +1,10 @@ //===- LinalgTypes.h - Linalg Types ---------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_LINALGTYPES_H_ #define MLIR_DIALECT_LINALG_LINALGTYPES_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.h b/mlir/include/mlir/Dialect/Linalg/Passes.h index 7ae3877f01e..86cf6fdd027 100644 --- a/mlir/include/mlir/Dialect/Linalg/Passes.h +++ b/mlir/include/mlir/Dialect/Linalg/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Linalg pass entry points ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes that expose pass constructors. // diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td index dbc162f4132..448ffdf7d4b 100644 --- a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td +++ b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td @@ -1,19 +1,10 @@ //===- LinalgPatterns.td - Linalg transformation patterns --*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the pattern definition file for declarative Linalg transformation. // diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransforms.h index a1a7458ae7f..a88dc4105e2 100644 --- a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransforms.h +++ b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransforms.h @@ -1,19 +1,10 @@ //===- LinalgTransforms.h - Linalg transformations as patterns --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef DIALECT_LINALG_TRANSFORMS_LINALGTRANSFORMS_H_ #define DIALECT_LINALG_TRANSFORMS_LINALGTRANSFORMS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h b/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h index 5a815ba158e..778d853aeef 100644 --- a/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h +++ b/mlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h @@ -1,19 +1,10 @@ //===- Intrinsics.h - Linalg intrinsics definitions -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_INTRINSICS_H_ #define MLIR_DIALECT_LINALG_INTRINSICS_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h index 50039dd9336..1b45179bc9e 100644 --- a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h +++ b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h @@ -1,19 +1,10 @@ //===- Utils.h - Utilities to support the Linalg dialect --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_LINALG_UTILS_H_ #define MLIR_DIALECT_LINALG_UTILS_H_ diff --git a/mlir/include/mlir/Dialect/LoopOps/LoopOps.h b/mlir/include/mlir/Dialect/LoopOps/LoopOps.h index e7ff6f84977..dba5e819986 100644 --- a/mlir/include/mlir/Dialect/LoopOps/LoopOps.h +++ b/mlir/include/mlir/Dialect/LoopOps/LoopOps.h @@ -1,19 +1,10 @@ //===- Ops.h - Loop MLIR Operations -----------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines convenience types for working with loop operations. // diff --git a/mlir/include/mlir/Dialect/LoopOps/LoopOps.td b/mlir/include/mlir/Dialect/LoopOps/LoopOps.td index e0f5b896309..3b0f120441a 100644 --- a/mlir/include/mlir/Dialect/LoopOps/LoopOps.td +++ b/mlir/include/mlir/Dialect/LoopOps/LoopOps.td @@ -1,19 +1,10 @@ //===- Ops.td - Loop operation definitions ---------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines MLIR loop operations. // diff --git a/mlir/include/mlir/Dialect/QuantOps/FakeQuantSupport.h b/mlir/include/mlir/Dialect/QuantOps/FakeQuantSupport.h index 23e2967bd77..1a141e3b1b3 100644 --- a/mlir/include/mlir/Dialect/QuantOps/FakeQuantSupport.h +++ b/mlir/include/mlir/Dialect/QuantOps/FakeQuantSupport.h @@ -1,19 +1,10 @@ //===- FakeQuantSupport.h - Support utilities for FakeQuant ops -*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines support utilities for interoperating with FakeQuant* based // QAT (Quantized Aware Training) computations, as implemented by TFLite. Note diff --git a/mlir/include/mlir/Dialect/QuantOps/Passes.h b/mlir/include/mlir/Dialect/QuantOps/Passes.h index c57d7bf41fe..d3109775db2 100644 --- a/mlir/include/mlir/Dialect/QuantOps/Passes.h +++ b/mlir/include/mlir/Dialect/QuantOps/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Quantization Passes ------ --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines all of the passes owned by the quantization dialect. As // things mature, it is expected that passes specific to certain frontend or diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantOps.h b/mlir/include/mlir/Dialect/QuantOps/QuantOps.h index 020d34918d4..9a4eec67c74 100644 --- a/mlir/include/mlir/Dialect/QuantOps/QuantOps.h +++ b/mlir/include/mlir/Dialect/QuantOps/QuantOps.h @@ -1,19 +1,10 @@ //===- QuantOps.h - Quantization Ops and Types ------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_QUANTOPS_QUANTOPS_H_ #define MLIR_DIALECT_QUANTOPS_QUANTOPS_H_ diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantOps.td b/mlir/include/mlir/Dialect/QuantOps/QuantOps.td index 072715d65aa..bbeb9419cc4 100644 --- a/mlir/include/mlir/Dialect/QuantOps/QuantOps.td +++ b/mlir/include/mlir/Dialect/QuantOps/QuantOps.td @@ -1,19 +1,10 @@ //===- QuantOps.td - Quantization operation definition -----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the operation definition file for Quantization. // diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td b/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td index 2fbb7995dd4..7225dcc72db 100644 --- a/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td +++ b/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td @@ -1,19 +1,10 @@ //===- QuantPredicates.td - Predicates for dialect types ---*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Predicates for types in the Quantization dialect. // diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantTypes.h b/mlir/include/mlir/Dialect/QuantOps/QuantTypes.h index 55e921ff8fb..daeb0374460 100644 --- a/mlir/include/mlir/Dialect/QuantOps/QuantTypes.h +++ b/mlir/include/mlir/Dialect/QuantOps/QuantTypes.h @@ -1,19 +1,10 @@ //===- QuantTypes.h - Quantization Ops and Types ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_QUANTOPS_QUANT_TYPES_H_ #define MLIR_DIALECT_QUANTOPS_QUANT_TYPES_H_ diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantizeUtils.h b/mlir/include/mlir/Dialect/QuantOps/QuantizeUtils.h index de87ca1e67c..c40b9e6f026 100644 --- a/mlir/include/mlir/Dialect/QuantOps/QuantizeUtils.h +++ b/mlir/include/mlir/Dialect/QuantOps/QuantizeUtils.h @@ -1,19 +1,10 @@ //===- QuantizeUtils.h - Support utilities for quantization -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_QUANTOPS_QUANTIZEUTILS_H_ #define MLIR_DIALECT_QUANTOPS_QUANTIZEUTILS_H_ diff --git a/mlir/include/mlir/Dialect/QuantOps/UniformSupport.h b/mlir/include/mlir/Dialect/QuantOps/UniformSupport.h index 0416db34e17..7c74fc56b8f 100644 --- a/mlir/include/mlir/Dialect/QuantOps/UniformSupport.h +++ b/mlir/include/mlir/Dialect/QuantOps/UniformSupport.h @@ -1,19 +1,10 @@ //===- UniformSupport.h - Support utilities for uniform quant ---*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_QUANTOPS_UNIFORMSUPPORT_H_ #define MLIR_DIALECT_QUANTOPS_UNIFORMSUPPORT_H_ diff --git a/mlir/include/mlir/Dialect/SDBM/SDBM.h b/mlir/include/mlir/Dialect/SDBM/SDBM.h index f95a51e407a..c8a0eec8ca8 100644 --- a/mlir/include/mlir/Dialect/SDBM/SDBM.h +++ b/mlir/include/mlir/Dialect/SDBM/SDBM.h @@ -1,19 +1,10 @@ //===- SDBM.h - MLIR SDBM declaration ---------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // A striped difference-bound matrix (SDBM) is a set in Z^N (or R^N) defined // as {(x_1, ... x_n) | f(x_1, ... x_n) >= 0} where f is an SDBM expression. diff --git a/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h b/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h index e3573ba604d..501c66140f0 100644 --- a/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h +++ b/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h @@ -1,19 +1,10 @@ //===- SDBMDialect.h - Dialect for striped DBMs -----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_SDBM_SDBMDIALECT_H #define MLIR_DIALECT_SDBM_SDBMDIALECT_H diff --git a/mlir/include/mlir/Dialect/SDBM/SDBMExpr.h b/mlir/include/mlir/Dialect/SDBM/SDBMExpr.h index 8cb5ef0be10..84a9a8405a8 100644 --- a/mlir/include/mlir/Dialect/SDBM/SDBMExpr.h +++ b/mlir/include/mlir/Dialect/SDBM/SDBMExpr.h @@ -1,19 +1,10 @@ //===- SDBMExpr.h - MLIR SDBM Expression ------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // A striped difference-bound matrix (SDBM) expression is a constant expression, // an identifier, a binary expression with constant RHS and +, stripe operators diff --git a/mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h b/mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h index 7537e5f654b..329caa2d3aa 100644 --- a/mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h +++ b/mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h @@ -1,19 +1,10 @@ //===-- LayoutUtils.h - Decorate composite type with layout information ---===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines utilities used to get alignment and layout information for // types in SPIR-V dialect. diff --git a/mlir/include/mlir/Dialect/SPIRV/Passes.h b/mlir/include/mlir/Dialect/SPIRV/Passes.h index fe029ff27ea..68f149b54d5 100644 --- a/mlir/include/mlir/Dialect/SPIRV/Passes.h +++ b/mlir/include/mlir/Dialect/SPIRV/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - SPIR-V pass entry points ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes that expose pass constructors. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td index f15d274922a..39858f357ff 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td @@ -1,19 +1,10 @@ //===-- SPIRVArithmeticOps.td - MLIR SPIR-V Arithmetic Ops -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains arithmetic ops for the SPIR-V dialect. It corresponds // to "3.32.13. Arithmetic Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td index 15b6ab0105c..c2ea100c121 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td @@ -1,19 +1,10 @@ //===-- SPIRVAtomicOps.td - MLIR SPIR-V Atomic Ops ---------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains atomic ops for the SPIR-V dialect. It corresponds to // "3.32.18. Atomic Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td index 838398823ad..5751a32e169 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td @@ -1,19 +1,10 @@ //===- SPIRVBase.td - MLIR SPIR-V Op Definitions Base file -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the base file for SPIR-V operation definition specification. // This file defines the SPIR-V dialect, common SPIR-V types, and utilities diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h index 3229e28ef1a..6a426488423 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h @@ -1,19 +1,10 @@ //===- SPIRVBinaryUtils.cpp - SPIR-V Binary Module Utils --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares common utilities for SPIR-V binary module. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td index d76a1e3854b..360edeec52d 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td @@ -1,19 +1,10 @@ //===-- SPIRVBitOps.td - MLIR SPIR-V Bit Ops -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains bit ops for the SPIR-V dialect. It corresponds // to "3.32.13. Bit Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td index e4fe526e420..99fe0bbbf5f 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td @@ -1,19 +1,10 @@ //===-- SPIRVCastOps.td - MLIR SPIR-V Cast Ops -------*- tablegen -*-------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains cast ops for the SPIR-V dialect. It corresponds // to "3.32.11. Convertion Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td index d19fd974684..7bd88ab66e0 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td @@ -1,19 +1,10 @@ //===-- SPIRVCompositeOps.td - MLIR SPIR-V Composite Ops ---*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains composite ops for SPIR-V dialect. It corresponds // to "3.32.12. Composite Instructions" of the SPIR-V spec. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td index 32a78024560..bc06c0289db 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td @@ -1,19 +1,10 @@ //===-- SPIRVControlFlowOps.td - SPIR-V Control Flow Ops ---*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains control flow ops for the SPIR-V dialect. It corresponds // to "3.32.17. Control-Flow Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h index 2571e5d8928..0c0eebd34d1 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h @@ -1,19 +1,10 @@ //===- SPIRVDialect.h - MLIR SPIR-V dialect ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the SPIR-V dialect in MLIR. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td index a031facdf5a..b2eacbf306a 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td @@ -1,19 +1,10 @@ //===- SPIRVGLSLOps.td - GLSL extended insts spec file -----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the op definition spec of GLSL extension ops. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td index c0388fe4e23..827636afbaf 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td @@ -1,19 +1,10 @@ //===-- SPIRVGroupOps.td - MLIR SPIR-V (Sub)Group Ops ------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains group and subgroup ops for the SPIR-V dialect. It // corresponds to "3.32.21. Group and Subgroup Instructions" of the SPIR-V diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td index e1e94bcd861..4057f47931c 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td @@ -1,19 +1,10 @@ //===-- SPIRVLogicalOps.td - MLIR SPIR-V Logical Ops -------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains arithmetic ops for the SPIR-V dialect. It corresponds // to "3.32.15. Relational and Logical Instructions" of the SPIR-V spec. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h index 37b4ee24237..e7cf250cc3a 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h @@ -1,19 +1,10 @@ //===- SPIRVLowering.h - SPIR-V lowering utilities -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines utilities to use while targeting SPIR-V dialect. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.td index d9cf0a752b8..91a8ff68bbf 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.td @@ -1,19 +1,10 @@ //===- SPIRVBase.td - MLIR SPIR-V Op Definitions Base file -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the base file for supporting lowering to SPIR-V dialect. This // file defines SPIR-V attributes used for specifying the shader diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td index 1b3174c9e9f..f3a9a61a9e9 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td @@ -1,19 +1,10 @@ //===-- SPIRVNonUniformOps.td - MLIR SPIR-V NonUniform Ops -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains non-uniform ops for the SPIR-V dialect. It corresponds to // "3.32.24. Non-Uniform Instructions" of the SPIR-V specification. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h index cb33146286a..2fa417bfe25 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h @@ -1,19 +1,10 @@ //===- SPIRVOps.h - MLIR SPIR-V operations ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the operations in the SPIR-V dialect. // diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td index 777e5750486..f657d5847d0 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td @@ -1,19 +1,10 @@ //===-- SPIRVOps.td - MLIR SPIR-V Op Definitions Spec ------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the main operation definition specification file for SPIR-V // operations. diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td index d1dacf3d63d..c37796b9f60 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td @@ -1,19 +1,10 @@ //===-- SPIRVStructureOps.td - MLIR SPIR-V Structure Ops ---*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains ops for defining the SPIR-V structure: module, function, // and module-level operations. The representational form of these ops deviate diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h index bc3083e8d7c..001d3130778 100644 --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h @@ -1,19 +1,10 @@ //===- SPIRVTypes.h - MLIR SPIR-V Types -------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the types in the SPIR-V dialect. // diff --git a/mlir/include/mlir/Dialect/SPIRV/Serialization.h b/mlir/include/mlir/Dialect/SPIRV/Serialization.h index bad7355791f..e8240b0072e 100644 --- a/mlir/include/mlir/Dialect/SPIRV/Serialization.h +++ b/mlir/include/mlir/Dialect/SPIRV/Serialization.h @@ -1,19 +1,10 @@ //===- Serialization.h - MLIR SPIR-V (De)serialization ----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the entry points for serialize and deserialize SPIR-V // binary modules. diff --git a/mlir/include/mlir/Dialect/StandardOps/Ops.h b/mlir/include/mlir/Dialect/StandardOps/Ops.h index 563116823d9..e3ec6f1f7d6 100644 --- a/mlir/include/mlir/Dialect/StandardOps/Ops.h +++ b/mlir/include/mlir/Dialect/StandardOps/Ops.h @@ -1,19 +1,10 @@ //===- Ops.h - Standard MLIR Operations -------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines convenience types for working with standard operations // in the MLIR operation set. diff --git a/mlir/include/mlir/Dialect/StandardOps/Ops.td b/mlir/include/mlir/Dialect/StandardOps/Ops.td index e00674708f6..c31b3dc9395 100644 --- a/mlir/include/mlir/Dialect/StandardOps/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/Ops.td @@ -1,19 +1,10 @@ //===- Ops.td - Standard operation definitions -------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines some MLIR standard operations. // diff --git a/mlir/include/mlir/Dialect/Traits.h b/mlir/include/mlir/Dialect/Traits.h index e04eb829e88..87c8e662a65 100644 --- a/mlir/include/mlir/Dialect/Traits.h +++ b/mlir/include/mlir/Dialect/Traits.h @@ -1,19 +1,10 @@ //===- Traits.h - Common op traits shared by dialects -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares common op traits that are not core to MLIR but can be // shared by multiple dialects. diff --git a/mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h b/mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h index b7e3990a333..9e7cbba0f43 100644 --- a/mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h +++ b/mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h @@ -1,19 +1,10 @@ //===- StructuredOpsUtils.h - Utilities used by structured ops --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file define utilities that operate on standard types and are // useful across multiple dialects that use structured ops abstractions. These diff --git a/mlir/include/mlir/Dialect/VectorOps/Utils.h b/mlir/include/mlir/Dialect/VectorOps/Utils.h index 68c62cc7ec7..b4d8ad65e60 100644 --- a/mlir/include/mlir/Dialect/VectorOps/Utils.h +++ b/mlir/include/mlir/Dialect/VectorOps/Utils.h @@ -1,19 +1,10 @@ //===- Utils.h - VectorOps Utils ----------------------------*- C++ -*-=======// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_VECTOROPS_UTILS_H_ #define MLIR_DIALECT_VECTOROPS_UTILS_H_ diff --git a/mlir/include/mlir/Dialect/VectorOps/VectorOps.h b/mlir/include/mlir/Dialect/VectorOps/VectorOps.h index 29ad6eecaf9..7234d46b765 100644 --- a/mlir/include/mlir/Dialect/VectorOps/VectorOps.h +++ b/mlir/include/mlir/Dialect/VectorOps/VectorOps.h @@ -1,19 +1,10 @@ //===- VectorOps.h - MLIR Super Vectorizer Operations -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the Vector dialect. // diff --git a/mlir/include/mlir/Dialect/VectorOps/VectorOps.td b/mlir/include/mlir/Dialect/VectorOps/VectorOps.td index 94262e6f1ff..87ed28caf80 100644 --- a/mlir/include/mlir/Dialect/VectorOps/VectorOps.td +++ b/mlir/include/mlir/Dialect/VectorOps/VectorOps.td @@ -1,19 +1,10 @@ //===- VectorOps.td - Vector op definitions ---------------*- tablegen -*-====// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines MLIR vector operations. // diff --git a/mlir/include/mlir/Dialect/VectorOps/VectorTransformPatterns.td b/mlir/include/mlir/Dialect/VectorOps/VectorTransformPatterns.td index 86ff9b505d5..5d0244f6989 100644 --- a/mlir/include/mlir/Dialect/VectorOps/VectorTransformPatterns.td +++ b/mlir/include/mlir/Dialect/VectorOps/VectorTransformPatterns.td @@ -1,19 +1,10 @@ //===- VectorTransformPatterns.td - Vector-Vector patterns -*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the pattern definition file for declarative Vector transformations. // diff --git a/mlir/include/mlir/Dialect/VectorOps/VectorTransforms.h b/mlir/include/mlir/Dialect/VectorOps/VectorTransforms.h index b48cb51533f..a73444d2023 100644 --- a/mlir/include/mlir/Dialect/VectorOps/VectorTransforms.h +++ b/mlir/include/mlir/Dialect/VectorOps/VectorTransforms.h @@ -1,19 +1,10 @@ //===- VectorTransforms.h - Vector transformations as patterns --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef DIALECT_VECTOROPS_VECTORTRANSFORMS_H_ #define DIALECT_VECTOROPS_VECTORTRANSFORMS_H_ diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h index 11ee0bff342..6607f267057 100644 --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -1,19 +1,10 @@ //===- Builders.h - MLIR Declarative Builder Classes ------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides intuitive composable interfaces for building structured MLIR // snippets in a declarative fashion. diff --git a/mlir/include/mlir/EDSC/Helpers.h b/mlir/include/mlir/EDSC/Helpers.h index c18307e7121..0be8a6045f7 100644 --- a/mlir/include/mlir/EDSC/Helpers.h +++ b/mlir/include/mlir/EDSC/Helpers.h @@ -1,19 +1,10 @@ //===- Helpers.h - MLIR Declarative Helper Functionality --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides helper classes and syntactic sugar for declarative builders. // diff --git a/mlir/include/mlir/EDSC/Intrinsics.h b/mlir/include/mlir/EDSC/Intrinsics.h index dc0c1186c7a..5edbf9600fb 100644 --- a/mlir/include/mlir/EDSC/Intrinsics.h +++ b/mlir/include/mlir/EDSC/Intrinsics.h @@ -1,19 +1,10 @@ //===- Intrinsics.h - MLIR Operations for Declarative Builders ---*- C++-*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides intuitive composable intrinsics for building snippets of MLIR // declaratively diff --git a/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h b/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h index 4e70a21f6ec..4f218bd0d9b 100644 --- a/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h +++ b/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h @@ -1,19 +1,10 @@ //===- ExecutionEngine.h - MLIR Execution engine and utils -----*- C++ -*--===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file provides a JIT-backed execution engine for MLIR modules. // diff --git a/mlir/include/mlir/ExecutionEngine/OptUtils.h b/mlir/include/mlir/ExecutionEngine/OptUtils.h index 8c0249d5c09..7b7b2598db5 100644 --- a/mlir/include/mlir/ExecutionEngine/OptUtils.h +++ b/mlir/include/mlir/ExecutionEngine/OptUtils.h @@ -1,19 +1,10 @@ //===- OptUtils.h - MLIR Execution Engine opt pass utilities ----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the utility functions to trigger LLVM optimizations from // MLIR Execution Engine. diff --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h index b66933df408..7059489ed4c 100644 --- a/mlir/include/mlir/IR/AffineExpr.h +++ b/mlir/include/mlir/IR/AffineExpr.h @@ -1,19 +1,10 @@ //===- AffineExpr.h - MLIR Affine Expr Class --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // An affine expression is an affine combination of dimension identifiers and // symbols, including ceildiv/floordiv/mod by a constant integer. diff --git a/mlir/include/mlir/IR/AffineExprVisitor.h b/mlir/include/mlir/IR/AffineExprVisitor.h index 9fa40218b5f..7866d6bb996 100644 --- a/mlir/include/mlir/IR/AffineExprVisitor.h +++ b/mlir/include/mlir/IR/AffineExprVisitor.h @@ -1,19 +1,10 @@ //===- AffineExprVisitor.h - MLIR AffineExpr Visitor Class ------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the AffineExpr visitor class. // diff --git a/mlir/include/mlir/IR/AffineMap.h b/mlir/include/mlir/IR/AffineMap.h index abd3712b0e1..3f9116cb168 100644 --- a/mlir/include/mlir/IR/AffineMap.h +++ b/mlir/include/mlir/IR/AffineMap.h @@ -1,19 +1,10 @@ //===- AffineMap.h - MLIR Affine Map Class ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Affine maps are mathematical functions which map a list of dimension // identifiers and symbols, to multidimensional affine expressions. diff --git a/mlir/include/mlir/IR/AttributeSupport.h b/mlir/include/mlir/IR/AttributeSupport.h index 78b3a2779d3..9804d6866f8 100644 --- a/mlir/include/mlir/IR/AttributeSupport.h +++ b/mlir/include/mlir/IR/AttributeSupport.h @@ -1,19 +1,10 @@ //===- AttributeSupport.h ---------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines support types for registering dialect extended attributes. // diff --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h index b5f4b1a7d7c..b8398580f61 100644 --- a/mlir/include/mlir/IR/Attributes.h +++ b/mlir/include/mlir/IR/Attributes.h @@ -1,19 +1,10 @@ //===- Attributes.h - MLIR Attribute Classes --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_ATTRIBUTES_H #define MLIR_IR_ATTRIBUTES_H diff --git a/mlir/include/mlir/IR/Block.h b/mlir/include/mlir/IR/Block.h index 87c77160e1d..b5189b48a85 100644 --- a/mlir/include/mlir/IR/Block.h +++ b/mlir/include/mlir/IR/Block.h @@ -1,19 +1,10 @@ //===- Block.h - MLIR Block Class -------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the Block class. // diff --git a/mlir/include/mlir/IR/BlockAndValueMapping.h b/mlir/include/mlir/IR/BlockAndValueMapping.h index 287dd508fa6..82173c34368 100644 --- a/mlir/include/mlir/IR/BlockAndValueMapping.h +++ b/mlir/include/mlir/IR/BlockAndValueMapping.h @@ -1,19 +1,10 @@ //===- BlockAndValueMapping.h -----------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a utility class for maintaining a mapping for multiple // value types. diff --git a/mlir/include/mlir/IR/BlockSupport.h b/mlir/include/mlir/IR/BlockSupport.h index fd30c36aaa3..7cefe870c22 100644 --- a/mlir/include/mlir/IR/BlockSupport.h +++ b/mlir/include/mlir/IR/BlockSupport.h @@ -1,19 +1,10 @@ //===- BlockSupport.h -------------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a number of support types for the Block class. // diff --git a/mlir/include/mlir/IR/Builders.h b/mlir/include/mlir/IR/Builders.h index c199c09feb5..038664f0186 100644 --- a/mlir/include/mlir/IR/Builders.h +++ b/mlir/include/mlir/IR/Builders.h @@ -1,19 +1,10 @@ //===- Builders.h - Helpers for constructing MLIR Classes -------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_BUILDERS_H #define MLIR_IR_BUILDERS_H diff --git a/mlir/include/mlir/IR/Diagnostics.h b/mlir/include/mlir/IR/Diagnostics.h index 9385de9ac4f..e3d0f838208 100644 --- a/mlir/include/mlir/IR/Diagnostics.h +++ b/mlir/include/mlir/IR/Diagnostics.h @@ -1,19 +1,10 @@ //===- Diagnostics.h - MLIR Diagnostics -------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines utilities for emitting diagnostics. // diff --git a/mlir/include/mlir/IR/Dialect.h b/mlir/include/mlir/IR/Dialect.h index a1855e797e8..d3b4b055bc0 100644 --- a/mlir/include/mlir/IR/Dialect.h +++ b/mlir/include/mlir/IR/Dialect.h @@ -1,19 +1,10 @@ //===- Dialect.h - IR Dialect Description -----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the 'dialect' abstraction. // diff --git a/mlir/include/mlir/IR/DialectHooks.h b/mlir/include/mlir/IR/DialectHooks.h index c51fafb6180..7e4e1d8335b 100644 --- a/mlir/include/mlir/IR/DialectHooks.h +++ b/mlir/include/mlir/IR/DialectHooks.h @@ -1,19 +1,10 @@ //===- DialectHooks.h - MLIR DialectHooks mechanism -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines abstraction and registration mechanism for dialect hooks. // diff --git a/mlir/include/mlir/IR/DialectImplementation.h b/mlir/include/mlir/IR/DialectImplementation.h index c645a2427b2..1eada8f264b 100644 --- a/mlir/include/mlir/IR/DialectImplementation.h +++ b/mlir/include/mlir/IR/DialectImplementation.h @@ -1,19 +1,10 @@ //===- DialectImplementation.h ----------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains utilities classes for implementing dialect attributes and // types. diff --git a/mlir/include/mlir/IR/DialectInterface.h b/mlir/include/mlir/IR/DialectInterface.h index 4eb41105032..ff1f8fb015a 100644 --- a/mlir/include/mlir/IR/DialectInterface.h +++ b/mlir/include/mlir/IR/DialectInterface.h @@ -1,19 +1,10 @@ //===- DialectInterface.h - IR Dialect Interfaces ---------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_DIALECTINTERFACE_H #define MLIR_IR_DIALECTINTERFACE_H diff --git a/mlir/include/mlir/IR/DialectSymbolRegistry.def b/mlir/include/mlir/IR/DialectSymbolRegistry.def index c1056bd4da0..14b876a2ce9 100644 --- a/mlir/include/mlir/IR/DialectSymbolRegistry.def +++ b/mlir/include/mlir/IR/DialectSymbolRegistry.def @@ -1,19 +1,10 @@ //===- DialectSymbolRegistry.def - MLIR Dialect Symbol Registry -*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file enumerates the different dialects that define custom classes // within the attribute or type system. diff --git a/mlir/include/mlir/IR/Function.h b/mlir/include/mlir/IR/Function.h index 6731f5430fa..3f788bbeeba 100644 --- a/mlir/include/mlir/IR/Function.h +++ b/mlir/include/mlir/IR/Function.h @@ -1,19 +1,10 @@ //===- Function.h - MLIR Function Class -------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Functions are the basic unit of composition in MLIR. // diff --git a/mlir/include/mlir/IR/FunctionImplementation.h b/mlir/include/mlir/IR/FunctionImplementation.h index c557d58429c..9d3e438f67e 100644 --- a/mlir/include/mlir/IR/FunctionImplementation.h +++ b/mlir/include/mlir/IR/FunctionImplementation.h @@ -1,19 +1,10 @@ //===- FunctionImplementation.h - Function-like Op utilities ----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file provides utility functions for implementing function-like // operations, in particular, parsing, printing and verification components diff --git a/mlir/include/mlir/IR/FunctionSupport.h b/mlir/include/mlir/IR/FunctionSupport.h index 1ba85d73df9..49175ba5e75 100644 --- a/mlir/include/mlir/IR/FunctionSupport.h +++ b/mlir/include/mlir/IR/FunctionSupport.h @@ -1,19 +1,10 @@ //===- FunctionSupport.h - Utility types for function-like ops --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines support types for Operations that represent function-like // constructs to use. diff --git a/mlir/include/mlir/IR/Identifier.h b/mlir/include/mlir/IR/Identifier.h index bc84c200545..604eebf341e 100644 --- a/mlir/include/mlir/IR/Identifier.h +++ b/mlir/include/mlir/IR/Identifier.h @@ -1,19 +1,10 @@ //===- Identifier.h - MLIR Identifier Class ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_IDENTIFIER_H #define MLIR_IR_IDENTIFIER_H diff --git a/mlir/include/mlir/IR/IntegerSet.h b/mlir/include/mlir/IR/IntegerSet.h index 6ffe830883b..1238511df34 100644 --- a/mlir/include/mlir/IR/IntegerSet.h +++ b/mlir/include/mlir/IR/IntegerSet.h @@ -1,19 +1,10 @@ //===- IntegerSet.h - MLIR Integer Set Class --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Integer sets are sets of points from the integer lattice constrained by // affine equality/inequality constraints. This class is meant to represent diff --git a/mlir/include/mlir/IR/Location.h b/mlir/include/mlir/IR/Location.h index bb55ad69057..c36bcb30735 100644 --- a/mlir/include/mlir/IR/Location.h +++ b/mlir/include/mlir/IR/Location.h @@ -1,19 +1,10 @@ //===- Location.h - MLIR Location Classes -----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // These classes provide the ability to relate MLIR objects back to source // location position information. diff --git a/mlir/include/mlir/IR/MLIRContext.h b/mlir/include/mlir/IR/MLIRContext.h index a93cb8b3353..e0761bcaaf1 100644 --- a/mlir/include/mlir/IR/MLIRContext.h +++ b/mlir/include/mlir/IR/MLIRContext.h @@ -1,19 +1,10 @@ //===- MLIRContext.h - MLIR Global Context Class ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_MLIRCONTEXT_H #define MLIR_IR_MLIRCONTEXT_H diff --git a/mlir/include/mlir/IR/Matchers.h b/mlir/include/mlir/IR/Matchers.h index 3b36f2fb5eb..5ce2cc7a8a8 100644 --- a/mlir/include/mlir/IR/Matchers.h +++ b/mlir/include/mlir/IR/Matchers.h @@ -1,19 +1,10 @@ //===- Matchers.h - Various common matchers ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file provides a simple and efficient mechanism for performing general // tree-based pattern matching over MLIR. This mechanism is inspired by LLVM's diff --git a/mlir/include/mlir/IR/Module.h b/mlir/include/mlir/IR/Module.h index 52d2455c7ae..babc51aad0d 100644 --- a/mlir/include/mlir/IR/Module.h +++ b/mlir/include/mlir/IR/Module.h @@ -1,19 +1,10 @@ //===- Module.h - MLIR Module Class -----------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Module is the top-level container for code in an MLIR program. // diff --git a/mlir/include/mlir/IR/OpAsmInterface.td b/mlir/include/mlir/IR/OpAsmInterface.td index 85726a8c64d..7e31c07575e 100644 --- a/mlir/include/mlir/IR/OpAsmInterface.td +++ b/mlir/include/mlir/IR/OpAsmInterface.td @@ -1,19 +1,10 @@ //===- OpAsmInterface.td - Asm Interfaces for opse ---------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains Interfaces for interacting with the AsmParser and // AsmPrinter. diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index 24e48b329d5..c457d25fc51 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -1,19 +1,10 @@ //===-- OpBase.td - Base op definition file ----------------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the base operation definition file. // diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h index 437540117c4..84f3cf2f444 100644 --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -1,19 +1,10 @@ //===- OpDefinition.h - Classes for defining concrete Op types --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements helper classes for implementing the "Op" types. This // includes the Op type, which is the base class for Op class definitions, diff --git a/mlir/include/mlir/IR/OpImplementation.h b/mlir/include/mlir/IR/OpImplementation.h index fcadce9ab16..e58a5b07038 100644 --- a/mlir/include/mlir/IR/OpImplementation.h +++ b/mlir/include/mlir/IR/OpImplementation.h @@ -1,19 +1,10 @@ //===- OpImplementation.h - Classes for implementing Op types ---*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This classes used by the implementation details of Op types. // diff --git a/mlir/include/mlir/IR/Operation.h b/mlir/include/mlir/IR/Operation.h index ad0dc600f8f..9ab900c8761 100644 --- a/mlir/include/mlir/IR/Operation.h +++ b/mlir/include/mlir/IR/Operation.h @@ -1,19 +1,10 @@ //===- Operation.h - MLIR Operation Class -----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the Operation class. // diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h index b7f63218ba5..14681663372 100644 --- a/mlir/include/mlir/IR/OperationSupport.h +++ b/mlir/include/mlir/IR/OperationSupport.h @@ -1,19 +1,10 @@ //===- OperationSupport.h ---------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a number of support types that Operation and related // classes build on top of. diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h index 707bb7c139f..e6b5e7a5eb7 100644 --- a/mlir/include/mlir/IR/PatternMatch.h +++ b/mlir/include/mlir/IR/PatternMatch.h @@ -1,19 +1,10 @@ //===- PatternMatch.h - PatternMatcher classes -------==---------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PATTERNMATCHER_H #define MLIR_PATTERNMATCHER_H diff --git a/mlir/include/mlir/IR/Region.h b/mlir/include/mlir/IR/Region.h index c1390adb40b..00f3ca7fba1 100644 --- a/mlir/include/mlir/IR/Region.h +++ b/mlir/include/mlir/IR/Region.h @@ -1,19 +1,10 @@ //===- Region.h - MLIR Region Class -----------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the Region class. // diff --git a/mlir/include/mlir/IR/RegionGraphTraits.h b/mlir/include/mlir/IR/RegionGraphTraits.h index f45dcc41a4a..b11c87dbd0c 100644 --- a/mlir/include/mlir/IR/RegionGraphTraits.h +++ b/mlir/include/mlir/IR/RegionGraphTraits.h @@ -1,19 +1,10 @@ //===- RegionGraphTraits.h - llvm::GraphTraits for CFGs ---------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements specializations of llvm::GraphTraits for various MLIR // CFG data types. This allows the generic LLVM graph algorithms to be applied diff --git a/mlir/include/mlir/IR/StandardTypes.h b/mlir/include/mlir/IR/StandardTypes.h index b6b4b6ea52c..89ffc45e547 100644 --- a/mlir/include/mlir/IR/StandardTypes.h +++ b/mlir/include/mlir/IR/StandardTypes.h @@ -1,19 +1,10 @@ //===- StandardTypes.h - MLIR Standard Type Classes -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_STANDARDTYPES_H #define MLIR_IR_STANDARDTYPES_H diff --git a/mlir/include/mlir/IR/StorageUniquerSupport.h b/mlir/include/mlir/IR/StorageUniquerSupport.h index 1a730731f32..f9288197072 100644 --- a/mlir/include/mlir/IR/StorageUniquerSupport.h +++ b/mlir/include/mlir/IR/StorageUniquerSupport.h @@ -1,19 +1,10 @@ //===- StorageUniquerSupport.h - MLIR Storage Uniquer Utilities -*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines utility classes for interfacing with StorageUniquer. // diff --git a/mlir/include/mlir/IR/SymbolTable.h b/mlir/include/mlir/IR/SymbolTable.h index e04beac6bc6..07829186cbf 100644 --- a/mlir/include/mlir/IR/SymbolTable.h +++ b/mlir/include/mlir/IR/SymbolTable.h @@ -1,19 +1,10 @@ //===- SymbolTable.h - MLIR Symbol Table Class ------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_SYMBOLTABLE_H #define MLIR_IR_SYMBOLTABLE_H diff --git a/mlir/include/mlir/IR/TypeSupport.h b/mlir/include/mlir/IR/TypeSupport.h index 86620da0b5c..8cc811cb916 100644 --- a/mlir/include/mlir/IR/TypeSupport.h +++ b/mlir/include/mlir/IR/TypeSupport.h @@ -1,19 +1,10 @@ //===- TypeSupport.h --------------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines support types for registering dialect extended types. // diff --git a/mlir/include/mlir/IR/TypeUtilities.h b/mlir/include/mlir/IR/TypeUtilities.h index af22f9c4a9f..b4713226559 100644 --- a/mlir/include/mlir/IR/TypeUtilities.h +++ b/mlir/include/mlir/IR/TypeUtilities.h @@ -1,19 +1,10 @@ //===- TypeUtilities.h - Helper function for type queries -------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines generic type utilities. // diff --git a/mlir/include/mlir/IR/Types.h b/mlir/include/mlir/IR/Types.h index 2ab36353dc4..6246e9bedd0 100644 --- a/mlir/include/mlir/IR/Types.h +++ b/mlir/include/mlir/IR/Types.h @@ -1,19 +1,10 @@ //===- Types.h - MLIR Type Classes ------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_IR_TYPES_H #define MLIR_IR_TYPES_H diff --git a/mlir/include/mlir/IR/UseDefLists.h b/mlir/include/mlir/IR/UseDefLists.h index 96e4ace2529..898d0da2b28 100644 --- a/mlir/include/mlir/IR/UseDefLists.h +++ b/mlir/include/mlir/IR/UseDefLists.h @@ -1,19 +1,10 @@ //===- UseDefLists.h --------------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines generic use/def list machinery and manipulation utilities. // diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h index 11cb8cdcbc7..030e6fa58b1 100644 --- a/mlir/include/mlir/IR/Value.h +++ b/mlir/include/mlir/IR/Value.h @@ -1,19 +1,10 @@ //===- Value.h - Base of the SSA Value hierarchy ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines generic Value type and manipulation utilities. // diff --git a/mlir/include/mlir/IR/Visitors.h b/mlir/include/mlir/IR/Visitors.h index 50d65627f1a..aaab933d239 100644 --- a/mlir/include/mlir/IR/Visitors.h +++ b/mlir/include/mlir/IR/Visitors.h @@ -1,19 +1,10 @@ //===- Visitors.h - Utilities for visiting operations -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines utilities for walking and visiting operations. // diff --git a/mlir/include/mlir/Parser.h b/mlir/include/mlir/Parser.h index 3a818ffa9d8..cae1e8b9ab1 100644 --- a/mlir/include/mlir/Parser.h +++ b/mlir/include/mlir/Parser.h @@ -1,19 +1,10 @@ //===- Parser.h - MLIR Parser Library Interface -----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file is contains the interface to the MLIR parser library. // diff --git a/mlir/include/mlir/Pass/AnalysisManager.h b/mlir/include/mlir/Pass/AnalysisManager.h index e233a4a5676..471cd011c40 100644 --- a/mlir/include/mlir/Pass/AnalysisManager.h +++ b/mlir/include/mlir/Pass/AnalysisManager.h @@ -1,19 +1,10 @@ //===- AnalysisManager.h - Analysis Management Infrastructure ---*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PASS_ANALYSISMANAGER_H #define MLIR_PASS_ANALYSISMANAGER_H diff --git a/mlir/include/mlir/Pass/Pass.h b/mlir/include/mlir/Pass/Pass.h index 380b097c78c..b4e8db86ff0 100644 --- a/mlir/include/mlir/Pass/Pass.h +++ b/mlir/include/mlir/Pass/Pass.h @@ -1,19 +1,10 @@ //===- Pass.h - Base classes for compiler passes ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PASS_PASS_H #define MLIR_PASS_PASS_H diff --git a/mlir/include/mlir/Pass/PassInstrumentation.h b/mlir/include/mlir/Pass/PassInstrumentation.h index 4b61850c661..ef75e56ae62 100644 --- a/mlir/include/mlir/Pass/PassInstrumentation.h +++ b/mlir/include/mlir/Pass/PassInstrumentation.h @@ -1,19 +1,10 @@ //===- PassInstrumentation.h ------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PASS_PASSINSTRUMENTATION_H_ #define MLIR_PASS_PASSINSTRUMENTATION_H_ diff --git a/mlir/include/mlir/Pass/PassManager.h b/mlir/include/mlir/Pass/PassManager.h index 9de8ace435c..d4f3683f031 100644 --- a/mlir/include/mlir/Pass/PassManager.h +++ b/mlir/include/mlir/Pass/PassManager.h @@ -1,19 +1,10 @@ //===- PassManager.h - Pass Management Interface ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PASS_PASSMANAGER_H #define MLIR_PASS_PASSMANAGER_H diff --git a/mlir/include/mlir/Pass/PassOptions.h b/mlir/include/mlir/Pass/PassOptions.h index eabfa73a1b6..8ebeead90c8 100644 --- a/mlir/include/mlir/Pass/PassOptions.h +++ b/mlir/include/mlir/Pass/PassOptions.h @@ -1,19 +1,10 @@ //===- PassOptions.h - Pass Option Utilities --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains utilities for registering options with compiler passes and // pipelines. diff --git a/mlir/include/mlir/Pass/PassRegistry.h b/mlir/include/mlir/Pass/PassRegistry.h index deb80ef765e..e07b9855c8d 100644 --- a/mlir/include/mlir/Pass/PassRegistry.h +++ b/mlir/include/mlir/Pass/PassRegistry.h @@ -1,19 +1,10 @@ //===- PassRegistry.h - Pass Registration Utilities -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains utilities for registering information about compiler // passes. diff --git a/mlir/include/mlir/Quantizer/Configurations/FxpMathConfig.h b/mlir/include/mlir/Quantizer/Configurations/FxpMathConfig.h index 467512f2b77..f27d12d7f52 100644 --- a/mlir/include/mlir/Quantizer/Configurations/FxpMathConfig.h +++ b/mlir/include/mlir/Quantizer/Configurations/FxpMathConfig.h @@ -1,19 +1,10 @@ //===- FxpMathConfig.h - Reference fixed point config -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a TargetConfiguration for reference fixed-point math // quantization scheme based on the FxpMathOps (plus a small category of diff --git a/mlir/include/mlir/Quantizer/Support/Configuration.h b/mlir/include/mlir/Quantizer/Support/Configuration.h index 17a472de30a..3732fbad3a2 100644 --- a/mlir/include/mlir/Quantizer/Support/Configuration.h +++ b/mlir/include/mlir/Quantizer/Support/Configuration.h @@ -1,19 +1,10 @@ //===- Configuration.h - Configuration object base classes ------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // The quantizer is relatively agnostic to source and target dialects, with // the specific represented by configuration policy objects derived from diff --git a/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraph.h b/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraph.h index 202e86566fc..fe66848b906 100644 --- a/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraph.h +++ b/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraph.h @@ -1,19 +1,10 @@ //===- ConstraintAnalysisGraph.h - Graphs type for constraints --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file provides graph-based data structures for representing anchors // and constraints between them. diff --git a/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraphTraits.h b/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraphTraits.h index 7e2b61d0496..35ec85f13b2 100644 --- a/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraphTraits.h +++ b/mlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraphTraits.h @@ -1,19 +1,10 @@ //===- ConstraintAnalysisGraphTraits.h - Traits for CAGs --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Provides graph traits for constraint analysis graphs. // diff --git a/mlir/include/mlir/Quantizer/Support/Metadata.h b/mlir/include/mlir/Quantizer/Support/Metadata.h index 6c327d9df7a..0545e78f917 100644 --- a/mlir/include/mlir/Quantizer/Support/Metadata.h +++ b/mlir/include/mlir/Quantizer/Support/Metadata.h @@ -1,19 +1,10 @@ //===- Metadata.h - Top level types and metadata ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains top level types needed to construct constraint graphs, // including context/allocator support and concrete metadata structs for diff --git a/mlir/include/mlir/Quantizer/Support/Rules.h b/mlir/include/mlir/Quantizer/Support/Rules.h index 9d1e53df5c0..536dd7ea07e 100644 --- a/mlir/include/mlir/Quantizer/Support/Rules.h +++ b/mlir/include/mlir/Quantizer/Support/Rules.h @@ -1,19 +1,10 @@ //===- Rules.h - Helpers for declaring facts and rules ----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines helper classes and functions for managing state (facts), // merging and tracking modification for various data types important for diff --git a/mlir/include/mlir/Quantizer/Support/Statistics.h b/mlir/include/mlir/Quantizer/Support/Statistics.h index 744c5b640ec..a24eecd3427 100644 --- a/mlir/include/mlir/Quantizer/Support/Statistics.h +++ b/mlir/include/mlir/Quantizer/Support/Statistics.h @@ -1,19 +1,10 @@ //===- Statistics.h - Collects statistics over tensors ----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines adapters for extracting various (per layer and per axis) // statistics over tensors. diff --git a/mlir/include/mlir/Quantizer/Support/TypeUtils.h b/mlir/include/mlir/Quantizer/Support/TypeUtils.h index 074f8b9e854..64ae5d65b57 100644 --- a/mlir/include/mlir/Quantizer/Support/TypeUtils.h +++ b/mlir/include/mlir/Quantizer/Support/TypeUtils.h @@ -1,19 +1,10 @@ //===- TypeUtils.h - Helper function for manipulating types -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines various helper functions for manipulating types. The // process of quantizing typically involves a number of type manipulations diff --git a/mlir/include/mlir/Quantizer/Support/UniformConstraints.h b/mlir/include/mlir/Quantizer/Support/UniformConstraints.h index 90b5fe12153..70c022c96a1 100644 --- a/mlir/include/mlir/Quantizer/Support/UniformConstraints.h +++ b/mlir/include/mlir/Quantizer/Support/UniformConstraints.h @@ -1,19 +1,10 @@ //===- UniformConstraints.h - Constraints for uniform quant -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a builder that lets you attach constraints necessary to // perform a variety of uniform quantization conversions to CAG anchors. diff --git a/mlir/include/mlir/Quantizer/Support/UniformSolvers.h b/mlir/include/mlir/Quantizer/Support/UniformSolvers.h index 98df671f81d..d6bd1a25ec3 100644 --- a/mlir/include/mlir/Quantizer/Support/UniformSolvers.h +++ b/mlir/include/mlir/Quantizer/Support/UniformSolvers.h @@ -1,19 +1,10 @@ //===- UniformSolvers.h - Uniform type solver algorithms --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines algorithms for solving uniform type parameters for various // conditions (i.e. fixed-point, affine, scale matching, etc). diff --git a/mlir/include/mlir/Quantizer/Transforms/Passes.h b/mlir/include/mlir/Quantizer/Transforms/Passes.h index 4fdea58daf4..3490f2953a4 100644 --- a/mlir/include/mlir/Quantizer/Transforms/Passes.h +++ b/mlir/include/mlir/Quantizer/Transforms/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Quantizer passes -----------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines entry points to create passes to perform various kinds // of quantization related transforms. diff --git a/mlir/include/mlir/Support/DebugStringHelper.h b/mlir/include/mlir/Support/DebugStringHelper.h index 230ed231458..0fa342686ba 100644 --- a/mlir/include/mlir/Support/DebugStringHelper.h +++ b/mlir/include/mlir/Support/DebugStringHelper.h @@ -1,19 +1,10 @@ //===- DebugStringHelper.h - helpers to generate debug strings --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Convenience functions to make it easier to get a string representation for // ops that have a print method. For use in debugging output and errors diff --git a/mlir/include/mlir/Support/FileUtilities.h b/mlir/include/mlir/Support/FileUtilities.h index 5ce97223176..c13b39efc4f 100644 --- a/mlir/include/mlir/Support/FileUtilities.h +++ b/mlir/include/mlir/Support/FileUtilities.h @@ -1,19 +1,10 @@ //===- FileUtilities.h - utilities for working with files -------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Common utilities for working with files. // diff --git a/mlir/include/mlir/Support/Functional.h b/mlir/include/mlir/Support/Functional.h index e8bf394b110..f18677f806b 100644 --- a/mlir/include/mlir/Support/Functional.h +++ b/mlir/include/mlir/Support/Functional.h @@ -1,19 +1,10 @@ //===- Functional.h - Helpers for functional-style Combinators --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_SUPPORT_FUNCTIONAL_H_ #define MLIR_SUPPORT_FUNCTIONAL_H_ diff --git a/mlir/include/mlir/Support/JitRunner.h b/mlir/include/mlir/Support/JitRunner.h index 14b66a8cebd..71c1d7d5105 100644 --- a/mlir/include/mlir/Support/JitRunner.h +++ b/mlir/include/mlir/Support/JitRunner.h @@ -1,19 +1,10 @@ //===- JitRunner.h - MLIR CPU Execution Driver Library ----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is a library that provides a shared implementation for command line // utilities that execute an MLIR file on the CPU by translating MLIR to LLVM diff --git a/mlir/include/mlir/Support/LLVM.h b/mlir/include/mlir/Support/LLVM.h index 91d145dd3ca..1885ebe609b 100644 --- a/mlir/include/mlir/Support/LLVM.h +++ b/mlir/include/mlir/Support/LLVM.h @@ -1,19 +1,10 @@ //===- LLVM.h - Import and forward declare core LLVM types ------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file forward declares and imports various common LLVM datatypes that // MLIR wants to use unqualified. diff --git a/mlir/include/mlir/Support/LogicalResult.h b/mlir/include/mlir/Support/LogicalResult.h index a9fc77ceef8..418293c0f80 100644 --- a/mlir/include/mlir/Support/LogicalResult.h +++ b/mlir/include/mlir/Support/LogicalResult.h @@ -1,19 +1,10 @@ //===- LogicalResult.h - Utilities for handling success/failure -*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_SUPPORT_LOGICAL_RESULT_H #define MLIR_SUPPORT_LOGICAL_RESULT_H diff --git a/mlir/include/mlir/Support/MathExtras.h b/mlir/include/mlir/Support/MathExtras.h index 767677fbc5d..1fd0634e9e8 100644 --- a/mlir/include/mlir/Support/MathExtras.h +++ b/mlir/include/mlir/Support/MathExtras.h @@ -1,19 +1,10 @@ //===- MathExtras.h - Math functions relevant to MLIR -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains math functions relevant to MLIR. // diff --git a/mlir/include/mlir/Support/MlirOptMain.h b/mlir/include/mlir/Support/MlirOptMain.h index be8e4328fb1..eac5ee765c2 100644 --- a/mlir/include/mlir/Support/MlirOptMain.h +++ b/mlir/include/mlir/Support/MlirOptMain.h @@ -1,19 +1,10 @@ //===- MlirOptMain.h - MLIR Optimizer Driver main ---------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Main entry function for mlir-opt for when built as standalone binary. // diff --git a/mlir/include/mlir/Support/STLExtras.h b/mlir/include/mlir/Support/STLExtras.h index 9bae7acadd6..9a128611c6e 100644 --- a/mlir/include/mlir/Support/STLExtras.h +++ b/mlir/include/mlir/Support/STLExtras.h @@ -1,19 +1,10 @@ //===- STLExtras.h - STL-like extensions that are used by MLIR --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains stuff that should be arguably sunk down to the LLVM // Support/STLExtras.h file over time. diff --git a/mlir/include/mlir/Support/StorageUniquer.h b/mlir/include/mlir/Support/StorageUniquer.h index fe1f898957a..f505731a649 100644 --- a/mlir/include/mlir/Support/StorageUniquer.h +++ b/mlir/include/mlir/Support/StorageUniquer.h @@ -1,19 +1,10 @@ //===- StorageUniquer.h - Common Storage Class Uniquer ----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_SUPPORT_STORAGEUNIQUER_H #define MLIR_SUPPORT_STORAGEUNIQUER_H diff --git a/mlir/include/mlir/Support/StringExtras.h b/mlir/include/mlir/Support/StringExtras.h index 2f75c8e5d20..5fc6769c124 100644 --- a/mlir/include/mlir/Support/StringExtras.h +++ b/mlir/include/mlir/Support/StringExtras.h @@ -1,19 +1,10 @@ //===- StringExtras.h - String utilities used by MLIR -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains string utility functions used within MLIR. // diff --git a/mlir/include/mlir/Support/ToolUtilities.h b/mlir/include/mlir/Support/ToolUtilities.h index 13a3742f849..3175ebbdba5 100644 --- a/mlir/include/mlir/Support/ToolUtilities.h +++ b/mlir/include/mlir/Support/ToolUtilities.h @@ -1,19 +1,10 @@ //===- ToolUtilities.h - MLIR Tool Utilities --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares common utilities for implementing MLIR tools. // diff --git a/mlir/include/mlir/Support/TranslateClParser.h b/mlir/include/mlir/Support/TranslateClParser.h index ccd4fb97676..822d4b1a0a4 100644 --- a/mlir/include/mlir/Support/TranslateClParser.h +++ b/mlir/include/mlir/Support/TranslateClParser.h @@ -1,19 +1,10 @@ //===- TranslateClParser.h - Translations command line parser ---*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains custom command line parser for translations. // diff --git a/mlir/include/mlir/TableGen/Argument.h b/mlir/include/mlir/TableGen/Argument.h index 83909392a43..6a0787e1b6c 100644 --- a/mlir/include/mlir/TableGen/Argument.h +++ b/mlir/include/mlir/TableGen/Argument.h @@ -1,19 +1,10 @@ //===- Argument.h - Argument definitions ------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file contains definitions for TableGen operation's arguments. // Operation arguments fall into two categories: diff --git a/mlir/include/mlir/TableGen/Attribute.h b/mlir/include/mlir/TableGen/Attribute.h index 242376e24ff..747df945cea 100644 --- a/mlir/include/mlir/TableGen/Attribute.h +++ b/mlir/include/mlir/TableGen/Attribute.h @@ -1,19 +1,10 @@ //===- Attribute.h - Attribute wrapper class --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Attribute wrapper to simplify using TableGen Record defining a MLIR // Attribute. diff --git a/mlir/include/mlir/TableGen/Constraint.h b/mlir/include/mlir/TableGen/Constraint.h index 17b60da6027..fb7c1d74b64 100644 --- a/mlir/include/mlir/TableGen/Constraint.h +++ b/mlir/include/mlir/TableGen/Constraint.h @@ -1,19 +1,10 @@ //===- Constraint.h - Constraint class --------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Constraint wrapper to simplify using TableGen Record for constraints. // diff --git a/mlir/include/mlir/TableGen/Dialect.h b/mlir/include/mlir/TableGen/Dialect.h index 6861da46e88..56d17f41b56 100644 --- a/mlir/include/mlir/TableGen/Dialect.h +++ b/mlir/include/mlir/TableGen/Dialect.h @@ -1,18 +1,9 @@ // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Dialect wrapper to simplify using TableGen Record defining a MLIR dialect. // diff --git a/mlir/include/mlir/TableGen/Format.h b/mlir/include/mlir/TableGen/Format.h index 6f02c283cad..160ba5f036a 100644 --- a/mlir/include/mlir/TableGen/Format.h +++ b/mlir/include/mlir/TableGen/Format.h @@ -1,19 +1,10 @@ //===- Format.h - Utilities for String Format -------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares utilities for formatting strings. They are specially // tailored to the needs of TableGen'ing op definitions and rewrite rules, diff --git a/mlir/include/mlir/TableGen/GenInfo.h b/mlir/include/mlir/TableGen/GenInfo.h index 0b0bd192ae5..3c732c2ff49 100644 --- a/mlir/include/mlir/TableGen/GenInfo.h +++ b/mlir/include/mlir/TableGen/GenInfo.h @@ -1,19 +1,10 @@ //===- GenInfo.h - Generator info -------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_TABLEGEN_GENINFO_H_ #define MLIR_TABLEGEN_GENINFO_H_ diff --git a/mlir/include/mlir/TableGen/GenNameParser.h b/mlir/include/mlir/TableGen/GenNameParser.h index 7b1e8a36d03..65f4a8ceace 100644 --- a/mlir/include/mlir/TableGen/GenNameParser.h +++ b/mlir/include/mlir/TableGen/GenNameParser.h @@ -1,19 +1,10 @@ //===- GenNameParser.h - Command line parser for generators -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // The GenNameParser class adds all passes linked in to the system that are // creatable to the tool. diff --git a/mlir/include/mlir/TableGen/OpInterfaces.h b/mlir/include/mlir/TableGen/OpInterfaces.h index 0959f6be9bb..9bf18161564 100644 --- a/mlir/include/mlir/TableGen/OpInterfaces.h +++ b/mlir/include/mlir/TableGen/OpInterfaces.h @@ -1,19 +1,10 @@ //===- OpInterfaces.h - OpInterfaces wrapper class --------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpInterfaces wrapper to simplify using TableGen OpInterfaces. // diff --git a/mlir/include/mlir/TableGen/OpTrait.h b/mlir/include/mlir/TableGen/OpTrait.h index c3ea9a7bda0..59fc7acbfd7 100644 --- a/mlir/include/mlir/TableGen/OpTrait.h +++ b/mlir/include/mlir/TableGen/OpTrait.h @@ -1,19 +1,10 @@ //===- OpTrait.h - OpTrait wrapper class ------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpTrait wrapper to simplify using TableGen Record defining an MLIR OpTrait. // diff --git a/mlir/include/mlir/TableGen/Operator.h b/mlir/include/mlir/TableGen/Operator.h index 89fd4ed8d2e..dd5ff353bf9 100644 --- a/mlir/include/mlir/TableGen/Operator.h +++ b/mlir/include/mlir/TableGen/Operator.h @@ -1,19 +1,10 @@ //===- Operator.h - Operator class ------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Operator wrapper to simplify using TableGen Record defining a MLIR Op. // diff --git a/mlir/include/mlir/TableGen/Pattern.h b/mlir/include/mlir/TableGen/Pattern.h index 8bd1c918e31..bf89f6e7c82 100644 --- a/mlir/include/mlir/TableGen/Pattern.h +++ b/mlir/include/mlir/TableGen/Pattern.h @@ -1,19 +1,10 @@ //===- Pattern.h - Pattern wrapper class ------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Pattern wrapper class to simplify using TableGen Record defining a MLIR // Pattern. diff --git a/mlir/include/mlir/TableGen/Predicate.h b/mlir/include/mlir/TableGen/Predicate.h index 49f7ebcfe52..045b7fece2e 100644 --- a/mlir/include/mlir/TableGen/Predicate.h +++ b/mlir/include/mlir/TableGen/Predicate.h @@ -1,19 +1,10 @@ //===- Predicate.h - Predicate class ----------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Wrapper around predicates defined in TableGen. // diff --git a/mlir/include/mlir/TableGen/Region.h b/mlir/include/mlir/TableGen/Region.h index 21dffe687f4..778f68622bf 100644 --- a/mlir/include/mlir/TableGen/Region.h +++ b/mlir/include/mlir/TableGen/Region.h @@ -1,19 +1,10 @@ //===- TGRegion.h - TableGen region definitions -----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_TABLEGEN_REGION_H_ #define MLIR_TABLEGEN_REGION_H_ diff --git a/mlir/include/mlir/TableGen/Type.h b/mlir/include/mlir/TableGen/Type.h index 03cbd104dc1..35de70f52fd 100644 --- a/mlir/include/mlir/TableGen/Type.h +++ b/mlir/include/mlir/TableGen/Type.h @@ -1,19 +1,10 @@ //===- Type.h - Type class --------------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Type wrapper to simplify using TableGen Record defining a MLIR Type. // diff --git a/mlir/include/mlir/Target/LLVMIR.h b/mlir/include/mlir/Target/LLVMIR.h index 7ed7b39c4db..1cdc26ccee6 100644 --- a/mlir/include/mlir/Target/LLVMIR.h +++ b/mlir/include/mlir/Target/LLVMIR.h @@ -1,19 +1,10 @@ //===- LLVMIR.h - MLIR to LLVM IR conversion --------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the entry point for the MLIR to LLVM IR conversion. // diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h index 7464e2a347d..4a5010ea09a 100644 --- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h +++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h @@ -1,19 +1,10 @@ //===- ModuleTranslation.h - MLIR to LLVM conversion ------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the translation between an MLIR LLVM dialect module and // the corresponding LLVMIR module. It only handles core LLVM IR operations. diff --git a/mlir/include/mlir/Target/NVVMIR.h b/mlir/include/mlir/Target/NVVMIR.h index ec9858e0fd7..377ee16d4e4 100644 --- a/mlir/include/mlir/Target/NVVMIR.h +++ b/mlir/include/mlir/Target/NVVMIR.h @@ -1,19 +1,10 @@ //===- NVVMIR.h - MLIR to LLVM + NVVM IR conversion -------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the entry point for the MLIR to LLVM + NVVM IR conversion. // diff --git a/mlir/include/mlir/Target/ROCDLIR.h b/mlir/include/mlir/Target/ROCDLIR.h index fd00e9458ef..25937eedd5a 100644 --- a/mlir/include/mlir/Target/ROCDLIR.h +++ b/mlir/include/mlir/Target/ROCDLIR.h @@ -1,19 +1,10 @@ //===- ROCDLIR.h - MLIR to LLVM + ROCDL IR conversion -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the entry point for the MLIR to LLVM + ROCDL IR // conversion. diff --git a/mlir/include/mlir/Transforms/DialectConversion.h b/mlir/include/mlir/Transforms/DialectConversion.h index f9f1207c0a0..dca26348689 100644 --- a/mlir/include/mlir/Transforms/DialectConversion.h +++ b/mlir/include/mlir/Transforms/DialectConversion.h @@ -1,19 +1,10 @@ //===- DialectConversion.h - MLIR dialect conversion pass -------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares a generic pass for converting between MLIR dialects. // diff --git a/mlir/include/mlir/Transforms/FoldUtils.h b/mlir/include/mlir/Transforms/FoldUtils.h index 65dd1b6df16..ed18619c44a 100644 --- a/mlir/include/mlir/Transforms/FoldUtils.h +++ b/mlir/include/mlir/Transforms/FoldUtils.h @@ -1,19 +1,10 @@ //===- FoldUtils.h - Operation Fold Utilities -------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file declares various operation folding utilities. These // utilities are intended to be used by passes to unify and simply their logic. diff --git a/mlir/include/mlir/Transforms/InliningUtils.h b/mlir/include/mlir/Transforms/InliningUtils.h index 47c4f48f468..e4739bba66b 100644 --- a/mlir/include/mlir/Transforms/InliningUtils.h +++ b/mlir/include/mlir/Transforms/InliningUtils.h @@ -1,19 +1,10 @@ //===- InliningUtils.h - Inliner utilities ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines interfaces for various inlining utility methods. // diff --git a/mlir/include/mlir/Transforms/LoopFusionUtils.h b/mlir/include/mlir/Transforms/LoopFusionUtils.h index af84b8911eb..4c307ffeda3 100644 --- a/mlir/include/mlir/Transforms/LoopFusionUtils.h +++ b/mlir/include/mlir/Transforms/LoopFusionUtils.h @@ -1,19 +1,10 @@ //===- LoopFusionUtils.h - Loop fusion utilities ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for various loop fusion utility // methods: these are not passes by themselves but are used either by passes, diff --git a/mlir/include/mlir/Transforms/LoopLikeInterface.h b/mlir/include/mlir/Transforms/LoopLikeInterface.h index a8bc0d11378..cba9ae78122 100644 --- a/mlir/include/mlir/Transforms/LoopLikeInterface.h +++ b/mlir/include/mlir/Transforms/LoopLikeInterface.h @@ -1,19 +1,10 @@ //===- LoopLikeInterface.h - Loop-like operations interface ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the operation interface for loop like operations. // diff --git a/mlir/include/mlir/Transforms/LoopLikeInterface.td b/mlir/include/mlir/Transforms/LoopLikeInterface.td index 583cfe26d87..089a3e19c35 100644 --- a/mlir/include/mlir/Transforms/LoopLikeInterface.td +++ b/mlir/include/mlir/Transforms/LoopLikeInterface.td @@ -1,19 +1,10 @@ //===- LoopLikeInterface.td - LoopLike interface -----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines the interface for loop-like operations as used by LICM. // diff --git a/mlir/include/mlir/Transforms/LoopUtils.h b/mlir/include/mlir/Transforms/LoopUtils.h index 37434ea2ea8..a08a3fc8307 100644 --- a/mlir/include/mlir/Transforms/LoopUtils.h +++ b/mlir/include/mlir/Transforms/LoopUtils.h @@ -1,19 +1,10 @@ //===- LoopUtils.h - Loop transformation utilities --------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for various loop transformation utility // methods: these are not passes by themselves but are used either by passes, diff --git a/mlir/include/mlir/Transforms/Passes.h b/mlir/include/mlir/Transforms/Passes.h index 5480a9a4fe1..1ea8f060e39 100644 --- a/mlir/include/mlir/Transforms/Passes.h +++ b/mlir/include/mlir/Transforms/Passes.h @@ -1,19 +1,10 @@ //===- Passes.h - Pass Entrypoints ------------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes that expose pass constructors in the loop // transformation library. diff --git a/mlir/include/mlir/Transforms/RegionUtils.h b/mlir/include/mlir/Transforms/RegionUtils.h index 63236d6a5a0..9639dfad857 100644 --- a/mlir/include/mlir/Transforms/RegionUtils.h +++ b/mlir/include/mlir/Transforms/RegionUtils.h @@ -1,19 +1,10 @@ //===- RegionUtils.h - Region-related transformation utilities --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_TRANSFORMS_REGIONUTILS_H_ #define MLIR_TRANSFORMS_REGIONUTILS_H_ diff --git a/mlir/include/mlir/Transforms/SideEffectsInterface.h b/mlir/include/mlir/Transforms/SideEffectsInterface.h index 443596b60c1..69c2a272c70 100644 --- a/mlir/include/mlir/Transforms/SideEffectsInterface.h +++ b/mlir/include/mlir/Transforms/SideEffectsInterface.h @@ -1,19 +1,10 @@ //===- SideEffectsInterface.h - dialect interface modeling side effects ---===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file specifies a dialect interface to model side-effects. // diff --git a/mlir/include/mlir/Transforms/Utils.h b/mlir/include/mlir/Transforms/Utils.h index 02c368ec496..a8268c1daa2 100644 --- a/mlir/include/mlir/Transforms/Utils.h +++ b/mlir/include/mlir/Transforms/Utils.h @@ -1,19 +1,10 @@ //===- Utils.h - General transformation utilities ---------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This header file defines prototypes for various transformation utilities for // memref's and non-loop IR structures. These are not passes by themselves but diff --git a/mlir/include/mlir/Transforms/ViewOpGraph.h b/mlir/include/mlir/Transforms/ViewOpGraph.h index 41f5eb5838d..c1782081adc 100644 --- a/mlir/include/mlir/Transforms/ViewOpGraph.h +++ b/mlir/include/mlir/Transforms/ViewOpGraph.h @@ -1,19 +1,10 @@ //===- ViewOpGraph.h - View/write op graphviz graphs ------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines interface to produce Graphviz outputs of MLIR op within block. // diff --git a/mlir/include/mlir/Transforms/ViewRegionGraph.h b/mlir/include/mlir/Transforms/ViewRegionGraph.h index 4378d38fae1..e8c47500c74 100644 --- a/mlir/include/mlir/Transforms/ViewRegionGraph.h +++ b/mlir/include/mlir/Transforms/ViewRegionGraph.h @@ -1,19 +1,10 @@ //===- ViewRegionGraph.h - View/write graphviz graphs -----------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines interface to produce Graphviz outputs of MLIR Regions. // diff --git a/mlir/include/mlir/Translation.h b/mlir/include/mlir/Translation.h index 0bf8178146a..9244b971753 100644 --- a/mlir/include/mlir/Translation.h +++ b/mlir/include/mlir/Translation.h @@ -1,19 +1,10 @@ //===- Translation.h - Translation registry ---------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Registry for user-provided translations. // diff --git a/mlir/lib/Analysis/AffineAnalysis.cpp b/mlir/lib/Analysis/AffineAnalysis.cpp index 60b2f17292b..27aa0748711 100644 --- a/mlir/lib/Analysis/AffineAnalysis.cpp +++ b/mlir/lib/Analysis/AffineAnalysis.cpp @@ -1,19 +1,10 @@ //===- AffineAnalysis.cpp - Affine structures analysis routines -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous analysis routines for affine structures // (expressions, maps, sets), and other utilities relying on such analysis. diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp index 21c2830c016..7ab547483cd 100644 --- a/mlir/lib/Analysis/AffineStructures.cpp +++ b/mlir/lib/Analysis/AffineStructures.cpp @@ -1,19 +1,10 @@ //===- AffineStructures.cpp - MLIR Affine Structures Class-----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Structures for affine/polyhedral analysis of MLIR functions. // diff --git a/mlir/lib/Analysis/CallGraph.cpp b/mlir/lib/Analysis/CallGraph.cpp index 6ec7c059526..65f6e83bcdf 100644 --- a/mlir/lib/Analysis/CallGraph.cpp +++ b/mlir/lib/Analysis/CallGraph.cpp @@ -1,19 +1,10 @@ //===- CallGraph.cpp - CallGraph analysis for MLIR ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains interfaces and analyses for defining a nested callgraph. // diff --git a/mlir/lib/Analysis/Dominance.cpp b/mlir/lib/Analysis/Dominance.cpp index 532972b771b..060a505593a 100644 --- a/mlir/lib/Analysis/Dominance.cpp +++ b/mlir/lib/Analysis/Dominance.cpp @@ -1,19 +1,10 @@ //===- Dominance.cpp - Dominator analysis for CFGs ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Implementation of dominance related classes and instantiations of extern // templates. diff --git a/mlir/lib/Analysis/InferTypeOpInterface.cpp b/mlir/lib/Analysis/InferTypeOpInterface.cpp index cbbd44681ba..2e52de2b3fa 100644 --- a/mlir/lib/Analysis/InferTypeOpInterface.cpp +++ b/mlir/lib/Analysis/InferTypeOpInterface.cpp @@ -1,19 +1,10 @@ //===- InferTypeOpInterface.cpp - Infer Type Interfaces ---------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the definitions of the infer op interfaces defined in // `InferTypeOpInterface.td`. diff --git a/mlir/lib/Analysis/Liveness.cpp b/mlir/lib/Analysis/Liveness.cpp index edb18e5645d..bef0b9fa385 100644 --- a/mlir/lib/Analysis/Liveness.cpp +++ b/mlir/lib/Analysis/Liveness.cpp @@ -1,19 +1,10 @@ //===- Liveness.cpp - Liveness analysis for MLIR --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Implementation of the liveness analysis. // diff --git a/mlir/lib/Analysis/LoopAnalysis.cpp b/mlir/lib/Analysis/LoopAnalysis.cpp index 9dfbfe0c542..5499f887c1e 100644 --- a/mlir/lib/Analysis/LoopAnalysis.cpp +++ b/mlir/lib/Analysis/LoopAnalysis.cpp @@ -1,19 +1,10 @@ //===- LoopAnalysis.cpp - Misc loop analysis routines //-------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous loop analysis routines. // diff --git a/mlir/lib/Analysis/MemRefBoundCheck.cpp b/mlir/lib/Analysis/MemRefBoundCheck.cpp index 4696ce64c22..1f7c1a1ae31 100644 --- a/mlir/lib/Analysis/MemRefBoundCheck.cpp +++ b/mlir/lib/Analysis/MemRefBoundCheck.cpp @@ -1,19 +1,10 @@ //===- MemRefBoundCheck.cpp - MLIR Affine Structures Class ----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to check memref accesses for out of bound // accesses. diff --git a/mlir/lib/Analysis/NestedMatcher.cpp b/mlir/lib/Analysis/NestedMatcher.cpp index 5f2be48b327..97eaafd37ce 100644 --- a/mlir/lib/Analysis/NestedMatcher.cpp +++ b/mlir/lib/Analysis/NestedMatcher.cpp @@ -1,19 +1,10 @@ //===- NestedMatcher.cpp - NestedMatcher Impl ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Analysis/NestedMatcher.h" #include "mlir/Dialect/AffineOps/AffineOps.h" diff --git a/mlir/lib/Analysis/OpStats.cpp b/mlir/lib/Analysis/OpStats.cpp index 1c9f6211a84..dbd938710ef 100644 --- a/mlir/lib/Analysis/OpStats.cpp +++ b/mlir/lib/Analysis/OpStats.cpp @@ -1,19 +1,10 @@ //===- OpStats.cpp - Prints stats of operations in module -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Module.h" #include "mlir/IR/Operation.h" diff --git a/mlir/lib/Analysis/SliceAnalysis.cpp b/mlir/lib/Analysis/SliceAnalysis.cpp index b09bddddd66..befe3d39759 100644 --- a/mlir/lib/Analysis/SliceAnalysis.cpp +++ b/mlir/lib/Analysis/SliceAnalysis.cpp @@ -1,19 +1,10 @@ //===- UseDefAnalysis.cpp - Analysis for Transitive UseDef chains ---------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements Analysis functions specific to slicing in Function. // diff --git a/mlir/lib/Analysis/TestMemRefDependenceCheck.cpp b/mlir/lib/Analysis/TestMemRefDependenceCheck.cpp index 80a579d163f..c6d7519740e 100644 --- a/mlir/lib/Analysis/TestMemRefDependenceCheck.cpp +++ b/mlir/lib/Analysis/TestMemRefDependenceCheck.cpp @@ -1,19 +1,10 @@ //===- TestMemRefDependenceCheck.cpp - Test dep analysis ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to run pair-wise memref access dependence checks. // diff --git a/mlir/lib/Analysis/TestParallelismDetection.cpp b/mlir/lib/Analysis/TestParallelismDetection.cpp index a9f9ea94a45..6cfc5431df3 100644 --- a/mlir/lib/Analysis/TestParallelismDetection.cpp +++ b/mlir/lib/Analysis/TestParallelismDetection.cpp @@ -1,19 +1,10 @@ //===- ParallelismDetection.cpp - Parallelism Detection pass ------------*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to detect parallel affine 'affine.for' ops. // diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp index 73aa07e7d7b..0e7d10e78cf 100644 --- a/mlir/lib/Analysis/Utils.cpp +++ b/mlir/lib/Analysis/Utils.cpp @@ -1,19 +1,10 @@ //===- Utils.cpp ---- Misc utilities for analysis -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous analysis routines for non-loop IR // structures. diff --git a/mlir/lib/Analysis/VectorAnalysis.cpp b/mlir/lib/Analysis/VectorAnalysis.cpp index a7917eba503..cd77eff9e40 100644 --- a/mlir/lib/Analysis/VectorAnalysis.cpp +++ b/mlir/lib/Analysis/VectorAnalysis.cpp @@ -1,19 +1,10 @@ //===- VectorAnalysis.cpp - Analysis for Vectorization --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Analysis/AffineAnalysis.h" #include "mlir/Analysis/LoopAnalysis.h" diff --git a/mlir/lib/Analysis/Verifier.cpp b/mlir/lib/Analysis/Verifier.cpp index be499a93898..d4861b1a2e7 100644 --- a/mlir/lib/Analysis/Verifier.cpp +++ b/mlir/lib/Analysis/Verifier.cpp @@ -1,19 +1,10 @@ //===- Verifier.cpp - MLIR Verifier Implementation ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the verify() methods on the various IR types, performing // (potentially expensive) checks on the holistic structure of the code. This diff --git a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp index 144b4a97e87..ce1e5c4a2af 100644 --- a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp +++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp @@ -1,19 +1,10 @@ //===- AffineToStandard.cpp - Lower affine constructs to primitives -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file lowers affine constructs (If and For statements, AffineApply // operations) within a function into their standard If and For equivalent ops. diff --git a/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h b/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h index a408ab5b5d9..2ca9717ad86 100644 --- a/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h +++ b/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h @@ -1,19 +1,10 @@ //===- IndexIntrinsicsOpLowering.h - GPU IndexOps Lowering class *- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_GPUCOMMON_INDEXINTRINSICSOPLOWERING_H_ #define MLIR_CONVERSION_GPUCOMMON_INDEXINTRINSICSOPLOWERING_H_ diff --git a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h index 3ab8e75633e..97881d359f6 100644 --- a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h +++ b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h @@ -1,19 +1,10 @@ //===- OpToFuncCallLowering.h - GPU ops lowering to custom calls *- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CONVERSION_GPUCOMMON_OPTOFUNCCALLLOWERING_H_ #define MLIR_CONVERSION_GPUCOMMON_OPTOFUNCCALLLOWERING_H_ diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp index a91c43e1e92..66a2e66f99a 100644 --- a/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp +++ b/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp @@ -1,19 +1,10 @@ //===- ConvertKernelFuncToCubin.cpp - MLIR GPU lowering passes ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert gpu kernel functions into a // corresponding binary blob that can be executed on a CUDA GPU. Currently diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp index 840ad6ba701..3383cf13d36 100644 --- a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp +++ b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp @@ -1,19 +1,10 @@ //===- ConvertLaunchFuncToCudaCalls.cpp - MLIR CUDA lowering passes -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert gpu.launch_func op into a sequence of // CUDA runtime calls. As the CUDA runtime does not have a stable published ABI, diff --git a/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td b/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td index 8c27ba49686..0a6aec07041 100644 --- a/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td +++ b/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td @@ -1,19 +1,10 @@ //==-- GPUToNVVM.td - GPU Ops to NVVM Patterns ---------------*- tablegen -*==// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Defines Patterns to lower GPU ops to NVVM. // diff --git a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp index bf18ea03dab..e15ad823a2b 100644 --- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp +++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp @@ -1,19 +1,10 @@ //===- LowerGpuOpsToNVVMOps.cpp - MLIR GPU to NVVM lowering passes --------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to generate NVVMIR operations for higher-level // GPU operations. diff --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp index 59892dbcee8..83770641bd4 100644 --- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp +++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp @@ -1,19 +1,10 @@ //===- LowerGpuOpsToROCDLOps.cpp - MLIR GPU to ROCDL lowering passes ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to generate ROCDLIR operations for higher-level // GPU operations. diff --git a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp index 0c34fc2b8e1..95c46853b1f 100644 --- a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp +++ b/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp @@ -1,19 +1,10 @@ //===- ConvertGPUToSPIRV.cpp - Convert GPU ops to SPIR-V dialect ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the conversion patterns from GPU ops to SPIR-V dialect. // diff --git a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp b/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp index b8fe27e92a2..115096003e1 100644 --- a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp +++ b/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp @@ -1,19 +1,10 @@ //===- ConvertGPUToSPIRVPass.cpp - GPU to SPIR-V dialect lowering passes --===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert a kernel function in the GPU Dialect // into a spv.module operation diff --git a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp index 8b6b9fb7930..1b70df6f8bd 100644 --- a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp +++ b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp @@ -1,19 +1,10 @@ //===- LinalgToLLVM.cpp - conversion from Linalg to LLVM dialect ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h" #include "mlir/Conversion/AffineToStandard/AffineToStandard.h" diff --git a/mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp b/mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp index d8df7487e71..59dac73de9c 100644 --- a/mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp +++ b/mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp @@ -1,19 +1,10 @@ //===- ConvertLoopToStandard.cpp - ControlFlow to CFG conversion ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert loop.for, loop.if and loop.terminator // ops into standard CFG ops. diff --git a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp index 3cbce7caa76..24bb8ffc462 100644 --- a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp +++ b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp @@ -1,19 +1,10 @@ //===- LoopsToGPU.cpp - Convert an affine loop nest to a GPU kernel -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This implements a straightforward conversion of an loop nest into a GPU // kernel. The caller is expected to guarantee that the conversion is correct diff --git a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp index 63836883512..4dfd26a4392 100644 --- a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp +++ b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp @@ -1,19 +1,10 @@ //===- LoopsToGPUPass.cpp - Convert a loop nest to a GPU kernel -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h" #include "mlir/Conversion/LoopsToGPU/LoopsToGPU.h" diff --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp index 67b545c4ec8..160678efe9f 100644 --- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp @@ -1,19 +1,10 @@ //===- ConvertStandardToLLVM.cpp - Standard to LLVM dialect conversion-----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert MLIR standard and builtin dialects // into the LLVM IR dialect. diff --git a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp index f7b0c9cb9bc..af1c92ef11d 100644 --- a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp +++ b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp @@ -1,19 +1,10 @@ //===- ConvertStandardToSPIRV.cpp - Standard to SPIR-V dialect conversion--===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements patterns to convert Standard Ops to the SPIR-V dialect. // diff --git a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp index 113789abe8a..41deec1f6ab 100644 --- a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp +++ b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp @@ -1,19 +1,10 @@ //===- ConvertStandardToSPIRVPass.cpp - Convert Std Ops to SPIR-V Ops -----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to convert MLIR standard ops into the SPIR-V // ops. diff --git a/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp index 2e1a7f09ff8..5d693336c3f 100644 --- a/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp +++ b/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp @@ -1,19 +1,10 @@ //===- LegalizeStandardForSPIRV.cpp - Legalize ops for SPIR-V lowering ----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This transformation pass legalizes operations before the conversion to SPIR-V // dialect to handle ops that cannot be lowered directly. diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp index 5099cb01bbc..56005220d3f 100644 --- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp +++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp @@ -1,19 +1,10 @@ //===- VectorToLLVM.cpp - Conversion from Vector to the LLVM dialect ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h" diff --git a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp index 33778e42329..3ed031b985a 100644 --- a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp +++ b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp @@ -1,19 +1,10 @@ //===- VectorToLoops.cpp - Conversion from Vector to mix of Loops and Std -===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements target-dependent lowering of vector transfer operations. // diff --git a/mlir/lib/Dialect/AffineOps/AffineOps.cpp b/mlir/lib/Dialect/AffineOps/AffineOps.cpp index 3a21de389c7..bfe72101e85 100644 --- a/mlir/lib/Dialect/AffineOps/AffineOps.cpp +++ b/mlir/lib/Dialect/AffineOps/AffineOps.cpp @@ -1,19 +1,10 @@ //===- AffineOps.cpp - MLIR Affine Operations -----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/AffineOps/AffineOps.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/Dialect/AffineOps/DialectRegistration.cpp b/mlir/lib/Dialect/AffineOps/DialectRegistration.cpp index 9197e3c619f..775e25ec8ea 100644 --- a/mlir/lib/Dialect/AffineOps/DialectRegistration.cpp +++ b/mlir/lib/Dialect/AffineOps/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register Affine Op dialect ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/AffineOps/AffineOps.h" using namespace mlir; diff --git a/mlir/lib/Dialect/FxpMathOps/IR/DialectRegistration.cpp b/mlir/lib/Dialect/FxpMathOps/IR/DialectRegistration.cpp index aa6782e1464..57d5ae8e789 100644 --- a/mlir/lib/Dialect/FxpMathOps/IR/DialectRegistration.cpp +++ b/mlir/lib/Dialect/FxpMathOps/IR/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register FxpMathOps dialect --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/FxpMathOps/FxpMathOps.h" diff --git a/mlir/lib/Dialect/FxpMathOps/IR/FxpMathOps.cpp b/mlir/lib/Dialect/FxpMathOps/IR/FxpMathOps.cpp index 18c07b07117..30e7dc04104 100644 --- a/mlir/lib/Dialect/FxpMathOps/IR/FxpMathOps.cpp +++ b/mlir/lib/Dialect/FxpMathOps/IR/FxpMathOps.cpp @@ -1,19 +1,10 @@ //===- FxpMathOps.cpp - Op implementation for FxpMathOps ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/FxpMathOps/FxpMathOps.h" #include "mlir/Dialect/QuantOps/QuantTypes.h" diff --git a/mlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp b/mlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp index e1951ff900b..725751eb6c1 100644 --- a/mlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp +++ b/mlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp @@ -1,19 +1,10 @@ //===- LowerUniformRealMath.cpp ------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "UniformKernelUtils.h" diff --git a/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h b/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h index 57a8422b362..bce5285a8b0 100644 --- a/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h +++ b/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h @@ -1,19 +1,10 @@ //===- UniformKernelUtils.h - Utilities for lowering uniform math - C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_FXPMATH_UNIFORM_KERNEL_UTILS_H_ #define MLIR_FXPMATH_UNIFORM_KERNEL_UTILS_H_ diff --git a/mlir/lib/Dialect/GPU/IR/DialectRegistration.cpp b/mlir/lib/Dialect/GPU/IR/DialectRegistration.cpp index af50d0270cf..511c69e0695 100644 --- a/mlir/lib/Dialect/GPU/IR/DialectRegistration.cpp +++ b/mlir/lib/Dialect/GPU/IR/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - MLIR GPU dialect registration ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/GPU/GPUDialect.h" diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp index 349c1fa4644..62d6a4b7ea4 100644 --- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp +++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp @@ -1,19 +1,10 @@ //===- GPUDialect.cpp - MLIR Dialect for GPU Kernels implementation -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the GPU kernel-related dialect and its operations. // diff --git a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp index 8f5f50e4909..6a7cd290dd2 100644 --- a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp @@ -1,19 +1,10 @@ //===- KernelOutlining.cpp - Implementation of GPU kernel outlining -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the GPU dialect kernel outlining pass. // diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp index b94ee335bd2..b8d2d242657 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -1,19 +1,10 @@ //===- LLVMDialect.cpp - LLVM IR Ops and Dialect registration -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the types and operation details for the LLVM IR dialect in // MLIR, and the LLVM IR dialect. It also registers the dialect. diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp index e4708fbe535..3a8e84ea918 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp @@ -1,19 +1,10 @@ //===- NVVMDialect.cpp - NVVM IR Ops and Dialect registration -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the types and operation details for the NVVM IR dialect in // MLIR, and the LLVM IR dialect. It also registers the dialect. diff --git a/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp index 30c55b52e59..c11572cf5a2 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp @@ -1,19 +1,10 @@ //===- ROCDLDialect.cpp - ROCDL IR Ops and Dialect registration -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the types and operation details for the ROCDL IR dialect in // MLIR, and the LLVM IR dialect. It also registers the dialect. diff --git a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp index ee122e16037..5fbbdea60c2 100644 --- a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp +++ b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp @@ -1,19 +1,10 @@ //===- DependenceAnalysis.cpp - Dependence analysis on SSA views ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements view-based alias and dependence analyses. // diff --git a/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp b/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp index 7b530d7f0df..af5e576b290 100644 --- a/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp +++ b/mlir/lib/Dialect/Linalg/EDSC/Builders.cpp @@ -1,19 +1,10 @@ //===- Builders.cpp - MLIR Declarative Linalg Builders --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/Linalg/EDSC/Builders.h" #include "mlir/Dialect/Linalg/EDSC/Intrinsics.h" diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp index c5f30b7e10b..10c37c0ec43 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1,19 +1,10 @@ //===- LinalgOps.cpp - Implementation of the linalg operations ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a the Linalg operations. // diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp index 263a64c5cdc..32b1620f67c 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Implementation of the linalg dialect and types -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the Linalg dialect types and dialect. // diff --git a/mlir/lib/Dialect/Linalg/LinalgRegistration.cpp b/mlir/lib/Dialect/Linalg/LinalgRegistration.cpp index df21ffa88ac..768b18b57f0 100644 --- a/mlir/lib/Dialect/Linalg/LinalgRegistration.cpp +++ b/mlir/lib/Dialect/Linalg/LinalgRegistration.cpp @@ -1,19 +1,10 @@ //===- LinalgRegistration.cpp - Register the linalg dialect statically ----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/Linalg/IR/LinalgOps.h" #include "mlir/Dialect/Linalg/IR/LinalgTypes.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp index 49cea7e4170..27dcf663d23 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp @@ -1,19 +1,10 @@ //===- Fusion.cpp - Implementation of linalg Fusion -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the linalg dialect Fusion pass. // diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp index e468c19a0b4..0f333791dd7 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp @@ -1,19 +1,10 @@ //===- LowerToLoops.cpp - conversion from Linalg library ops to loops------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/AffineOps/AffineOps.h" #include "mlir/Dialect/Linalg/IR/LinalgOps.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp index 999406e05cf..451803797f4 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp @@ -1,19 +1,10 @@ //===- LinalgTransforms.cpp - Linalg transformations as patterns ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements logic for transforming Linalg operations. // diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp index b1dae455194..08bc1518a19 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp @@ -1,19 +1,10 @@ //===- Promotion.cpp - Implementation of linalg Promotion -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the linalg dialect Promotion pass. // diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp index 07d559918cf..99645a23100 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -1,19 +1,10 @@ //===- Tiling.cpp - Implementation of linalg Tiling -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the linalg dialect Tiling pass. // diff --git a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp index 125937807f4..ae02af0ecc8 100644 --- a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp +++ b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp @@ -1,19 +1,10 @@ //===- Utils.cpp - Utilities to support the Linalg dialect ----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements utilities for the Linalg dialect. // diff --git a/mlir/lib/Dialect/LoopOps/DialectRegistration.cpp b/mlir/lib/Dialect/LoopOps/DialectRegistration.cpp index 5724402e690..6564e78855c 100644 --- a/mlir/lib/Dialect/LoopOps/DialectRegistration.cpp +++ b/mlir/lib/Dialect/LoopOps/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register loop dialect --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/LoopOps/LoopOps.h" using namespace mlir; diff --git a/mlir/lib/Dialect/LoopOps/LoopOps.cpp b/mlir/lib/Dialect/LoopOps/LoopOps.cpp index 9610a1ac270..d3040c1bbb2 100644 --- a/mlir/lib/Dialect/LoopOps/LoopOps.cpp +++ b/mlir/lib/Dialect/LoopOps/LoopOps.cpp @@ -1,19 +1,10 @@ //===- Ops.cpp - Loop MLIR Operations -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/LoopOps/LoopOps.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/Dialect/QuantOps/IR/DialectRegistration.cpp b/mlir/lib/Dialect/QuantOps/IR/DialectRegistration.cpp index b071248f4bb..1738d6d7277 100644 --- a/mlir/lib/Dialect/QuantOps/IR/DialectRegistration.cpp +++ b/mlir/lib/Dialect/QuantOps/IR/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register Quantization dialect ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantOps.h" diff --git a/mlir/lib/Dialect/QuantOps/IR/QuantOps.cpp b/mlir/lib/Dialect/QuantOps/IR/QuantOps.cpp index 51f19940dcb..faeff246bd2 100644 --- a/mlir/lib/Dialect/QuantOps/IR/QuantOps.cpp +++ b/mlir/lib/Dialect/QuantOps/IR/QuantOps.cpp @@ -1,19 +1,10 @@ //===- QuantOps.cpp - Quantization Type and Ops Implementation --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantOps.h" #include "TypeDetail.h" diff --git a/mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp b/mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp index bc8290cda16..2e33963602c 100644 --- a/mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp +++ b/mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp @@ -1,19 +1,10 @@ //===- QuantOps.cpp - Quantization Type and Ops Implementation --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantTypes.h" #include "TypeDetail.h" diff --git a/mlir/lib/Dialect/QuantOps/IR/TypeDetail.h b/mlir/lib/Dialect/QuantOps/IR/TypeDetail.h index 13a88da3043..801a0de32b4 100644 --- a/mlir/lib/Dialect/QuantOps/IR/TypeDetail.h +++ b/mlir/lib/Dialect/QuantOps/IR/TypeDetail.h @@ -1,19 +1,10 @@ //===- TypeDetail.h - QuantOps Type detail ----------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef TYPE_DETAIL_H_ #define TYPE_DETAIL_H_ diff --git a/mlir/lib/Dialect/QuantOps/IR/TypeParser.cpp b/mlir/lib/Dialect/QuantOps/IR/TypeParser.cpp index 2bdde1f94f8..2689a2dff89 100644 --- a/mlir/lib/Dialect/QuantOps/IR/TypeParser.cpp +++ b/mlir/lib/Dialect/QuantOps/IR/TypeParser.cpp @@ -1,19 +1,10 @@ //===- TypeParser.h - Quantization Type Parser ------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantOps.h" #include "mlir/Dialect/QuantOps/QuantTypes.h" diff --git a/mlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp b/mlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp index 61636dcdd8b..08a5ec59e8d 100644 --- a/mlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp +++ b/mlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp @@ -1,19 +1,10 @@ //===- ConvertConst.cpp - Quantizes constant ops --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/Passes.h" #include "mlir/Dialect/QuantOps/QuantOps.h" diff --git a/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp b/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp index 83fa9237dee..2a4c14f2231 100644 --- a/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp +++ b/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp @@ -1,19 +1,10 @@ //===- ConvertSimQuant.cpp - Converts simulated quant ops------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/FakeQuantSupport.h" #include "mlir/Dialect/QuantOps/Passes.h" diff --git a/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp b/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp index f4256cf25c8..cbd4315f832 100644 --- a/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp +++ b/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp @@ -1,19 +1,10 @@ //===- FakeQuantSupport.cpp - Support utilities for FakeQuant ops ---------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/FakeQuantSupport.h" #include "mlir/Dialect/QuantOps/QuantTypes.h" diff --git a/mlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp b/mlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp index 56e2cbae4f0..094fefee486 100644 --- a/mlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp +++ b/mlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp @@ -1,19 +1,10 @@ //===- QuantizeUtils.cpp - Support utilities for quantization -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantizeUtils.h" #include "mlir/Dialect/QuantOps/UniformSupport.h" diff --git a/mlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp b/mlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp index 34e767dfee3..df002336c16 100644 --- a/mlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp +++ b/mlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp @@ -1,19 +1,10 @@ //===- UniformSupport.cpp - Support utilities for uniform quant -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/UniformSupport.h" #include "mlir/IR/StandardTypes.h" diff --git a/mlir/lib/Dialect/SDBM/SDBM.cpp b/mlir/lib/Dialect/SDBM/SDBM.cpp index 510e13e8028..03ffe3ffbb9 100644 --- a/mlir/lib/Dialect/SDBM/SDBM.cpp +++ b/mlir/lib/Dialect/SDBM/SDBM.cpp @@ -1,19 +1,10 @@ //===- SDBM.cpp - MLIR SDBM implementation --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // A striped difference-bound matrix (SDBM) is a set in Z^N (or R^N) defined // as {(x_1, ... x_n) | f(x_1, ... x_n) >= 0} where f is an SDBM expression. diff --git a/mlir/lib/Dialect/SDBM/SDBMDialect.cpp b/mlir/lib/Dialect/SDBM/SDBMDialect.cpp index d3d895fec88..fab9463a866 100644 --- a/mlir/lib/Dialect/SDBM/SDBMDialect.cpp +++ b/mlir/lib/Dialect/SDBM/SDBMDialect.cpp @@ -1,19 +1,10 @@ //===- SDBMDialect.cpp - Dialect for striped difference-bound matrices ----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/SDBM/SDBMDialect.h" diff --git a/mlir/lib/Dialect/SDBM/SDBMExpr.cpp b/mlir/lib/Dialect/SDBM/SDBMExpr.cpp index 44cdd18cf98..68e3e1c278e 100644 --- a/mlir/lib/Dialect/SDBM/SDBMExpr.cpp +++ b/mlir/lib/Dialect/SDBM/SDBMExpr.cpp @@ -1,19 +1,10 @@ //===- SDBMExpr.cpp - MLIR SDBM Expression implementation -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // A striped difference-bound matrix (SDBM) expression is a constant expression, // an identifier, a binary expression with constant RHS and +, stripe operators diff --git a/mlir/lib/Dialect/SDBM/SDBMExprDetail.h b/mlir/lib/Dialect/SDBM/SDBMExprDetail.h index 0441200754c..fb80b45902e 100644 --- a/mlir/lib/Dialect/SDBM/SDBMExprDetail.h +++ b/mlir/lib/Dialect/SDBM/SDBMExprDetail.h @@ -1,19 +1,10 @@ //===- SDBMExprDetail.h - MLIR SDBM Expression storage details --*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of SDBMExpr, in particular underlying // storage types. diff --git a/mlir/lib/Dialect/SPIRV/DialectRegistration.cpp b/mlir/lib/Dialect/SPIRV/DialectRegistration.cpp index 63e9e812c39..431b40ef022 100644 --- a/mlir/lib/Dialect/SPIRV/DialectRegistration.cpp +++ b/mlir/lib/Dialect/SPIRV/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - MLIR SPIR-V dialect registration ---------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/SPIRV/SPIRVDialect.h" diff --git a/mlir/lib/Dialect/SPIRV/LayoutUtils.cpp b/mlir/lib/Dialect/SPIRV/LayoutUtils.cpp index 5db478d388b..a12d04edd68 100644 --- a/mlir/lib/Dialect/SPIRV/LayoutUtils.cpp +++ b/mlir/lib/Dialect/SPIRV/LayoutUtils.cpp @@ -1,19 +1,10 @@ //===-- LayoutUtils.cpp - Decorate composite type with layout information -===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements Utilities used to get alignment and layout information // for types in SPIR-V dialect. diff --git a/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp b/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp index ca9b883a703..7b6c013f9ed 100644 --- a/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp @@ -1,19 +1,10 @@ //===- SPIRVLowering.cpp - Standard to SPIR-V dialect conversion--===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements utilities used to lower to SPIR-V dialect. // diff --git a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp index a20c18056e1..e42dc10f55d 100644 --- a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp @@ -1,19 +1,10 @@ //===- SPIRVOps.cpp - MLIR SPIR-V operations ------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the operations in the SPIR-V dialect. // diff --git a/mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp b/mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp index 15621aa5fde..18e027afb4c 100644 --- a/mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp @@ -1,19 +1,10 @@ //===- SPIRVTypes.cpp - MLIR SPIR-V Types ---------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the types in the SPIR-V dialect. // diff --git a/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp b/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp index 799828cb629..9e820c6f42b 100644 --- a/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp +++ b/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp @@ -1,19 +1,10 @@ //===- Deserializer.cpp - MLIR SPIR-V Deserialization ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the SPIR-V binary to MLIR SPIR-V module deserialization. // diff --git a/mlir/lib/Dialect/SPIRV/Serialization/SPIRVBinaryUtils.cpp b/mlir/lib/Dialect/SPIRV/Serialization/SPIRVBinaryUtils.cpp index ba383b2cc6c..13405c9883d 100644 --- a/mlir/lib/Dialect/SPIRV/Serialization/SPIRVBinaryUtils.cpp +++ b/mlir/lib/Dialect/SPIRV/Serialization/SPIRVBinaryUtils.cpp @@ -1,19 +1,10 @@ //===- SPIRVBinaryUtils.cpp - MLIR SPIR-V Binary Module Utilities ---------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines common utilities for SPIR-V binary module. // diff --git a/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp b/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp index 9b47045ea61..7ff471dfda5 100644 --- a/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp +++ b/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp @@ -1,19 +1,10 @@ //===- Serializer.cpp - MLIR SPIR-V Serialization -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the MLIR SPIR-V module to SPIR-V binary serialization. // diff --git a/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp b/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp index e9b4f23cca4..750710fa3d9 100644 --- a/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp +++ b/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp @@ -1,19 +1,10 @@ //===- TranslateRegistration.cpp - hooks to mlir-translate ----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a translation from SPIR-V binary module to MLIR SPIR-V // ModuleOp. diff --git a/mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp index be486f858fe..07621d6fa80 100644 --- a/mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp @@ -1,19 +1,10 @@ //===- DecorateSPIRVCompositeTypeLayoutPass.cpp - Decorate composite type -===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to decorate the composite types used by // composite objects in the StorageBuffer, PhysicalStorageBuffer, Uniform, and diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp index 93ce2c0a0d5..76e1b9b716e 100644 --- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp @@ -1,19 +1,10 @@ //===- LowerABIAttributesPass.cpp - Decorate composite type ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to lower attributes that specify the shader ABI // for the functions in the generated SPIR-V module. diff --git a/mlir/lib/Dialect/StandardOps/DialectRegistration.cpp b/mlir/lib/Dialect/StandardOps/DialectRegistration.cpp index 6b5578f93cf..684806009e5 100644 --- a/mlir/lib/Dialect/StandardOps/DialectRegistration.cpp +++ b/mlir/lib/Dialect/StandardOps/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register standard Op dialect -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/StandardOps/Ops.h" using namespace mlir; diff --git a/mlir/lib/Dialect/StandardOps/Ops.cpp b/mlir/lib/Dialect/StandardOps/Ops.cpp index 94166b5a7dd..55da59a0c74 100644 --- a/mlir/lib/Dialect/StandardOps/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/Ops.cpp @@ -1,19 +1,10 @@ //===- Ops.cpp - Standard MLIR Operations ---------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/Dialect/Traits.cpp b/mlir/lib/Dialect/Traits.cpp index 0ac07c2c4f5..3aea206c07e 100644 --- a/mlir/lib/Dialect/Traits.cpp +++ b/mlir/lib/Dialect/Traits.cpp @@ -1,19 +1,10 @@ //===- Traits.cpp - Common op traits shared by dialects -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/Traits.h" #include "mlir/IR/StandardTypes.h" diff --git a/mlir/lib/Dialect/VectorOps/DialectRegistration.cpp b/mlir/lib/Dialect/VectorOps/DialectRegistration.cpp index 0caa1cf629e..edd6abb4e2e 100644 --- a/mlir/lib/Dialect/VectorOps/DialectRegistration.cpp +++ b/mlir/lib/Dialect/VectorOps/DialectRegistration.cpp @@ -1,19 +1,10 @@ //===- DialectRegistration.cpp - Register super vectorization dialect -----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/VectorOps/VectorOps.h" using namespace mlir; diff --git a/mlir/lib/Dialect/VectorOps/VectorOps.cpp b/mlir/lib/Dialect/VectorOps/VectorOps.cpp index 18c1714f403..8ceff014029 100644 --- a/mlir/lib/Dialect/VectorOps/VectorOps.cpp +++ b/mlir/lib/Dialect/VectorOps/VectorOps.cpp @@ -1,19 +1,10 @@ //===- VectorOps.cpp - MLIR Super Vectorizer Operations -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements convenience types for working with super-vectorization // operations, in particular super-vector loads and stores. diff --git a/mlir/lib/Dialect/VectorOps/VectorTransforms.cpp b/mlir/lib/Dialect/VectorOps/VectorTransforms.cpp index e5c281cbf64..927aeda4ecd 100644 --- a/mlir/lib/Dialect/VectorOps/VectorTransforms.cpp +++ b/mlir/lib/Dialect/VectorOps/VectorTransforms.cpp @@ -1,19 +1,10 @@ //===- VectorToLoops.cpp - Conversion within the Vector dialect -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements target-independent rewrites as 1->N patterns. // diff --git a/mlir/lib/EDSC/Builders.cpp b/mlir/lib/EDSC/Builders.cpp index 35108ed5666..b25eb987a9e 100644 --- a/mlir/lib/EDSC/Builders.cpp +++ b/mlir/lib/EDSC/Builders.cpp @@ -1,19 +1,10 @@ //===- Builders.cpp - MLIR Declarative Builder Classes --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/EDSC/Builders.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/EDSC/CoreAPIs.cpp b/mlir/lib/EDSC/CoreAPIs.cpp index 46199c29c14..6f7c1728bb0 100644 --- a/mlir/lib/EDSC/CoreAPIs.cpp +++ b/mlir/lib/EDSC/CoreAPIs.cpp @@ -1,19 +1,10 @@ //===- Types.cpp - Implementations of MLIR Core C APIs --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir-c/Core.h" diff --git a/mlir/lib/EDSC/Helpers.cpp b/mlir/lib/EDSC/Helpers.cpp index 1771eb0a427..79888334cd9 100644 --- a/mlir/lib/EDSC/Helpers.cpp +++ b/mlir/lib/EDSC/Helpers.cpp @@ -1,19 +1,10 @@ //===- Helpers.cpp - MLIR Declarative Helper Functionality ----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/EDSC/Helpers.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/EDSC/Intrinsics.cpp b/mlir/lib/EDSC/Intrinsics.cpp index c6738c42993..1bb32b97867 100644 --- a/mlir/lib/EDSC/Intrinsics.cpp +++ b/mlir/lib/EDSC/Intrinsics.cpp @@ -1,19 +1,10 @@ //===- Intrinsics.cpp - MLIR Operations for Declarative Builders ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/EDSC/Intrinsics.h" #include "mlir/EDSC/Builders.h" diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp index 5098ba81762..1537018076a 100644 --- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp @@ -1,19 +1,10 @@ //===- ExecutionEngine.cpp - MLIR Execution engine and utils --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the execution engine for MLIR modules based on LLVM Orc // JIT engine. diff --git a/mlir/lib/ExecutionEngine/OptUtils.cpp b/mlir/lib/ExecutionEngine/OptUtils.cpp index dc3bd20794e..ec2ae5f2dcc 100644 --- a/mlir/lib/ExecutionEngine/OptUtils.cpp +++ b/mlir/lib/ExecutionEngine/OptUtils.cpp @@ -1,19 +1,10 @@ //===- OptUtils.cpp - MLIR Execution Engine optimization pass utilities ---===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the utility functions to trigger LLVM optimizations from // MLIR Execution Engine. diff --git a/mlir/lib/IR/AffineExpr.cpp b/mlir/lib/IR/AffineExpr.cpp index 009c1a1485c..dd8ce00c82a 100644 --- a/mlir/lib/IR/AffineExpr.cpp +++ b/mlir/lib/IR/AffineExpr.cpp @@ -1,19 +1,10 @@ //===- AffineExpr.cpp - MLIR Affine Expr Classes --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/AffineExpr.h" #include "AffineExprDetail.h" diff --git a/mlir/lib/IR/AffineExprDetail.h b/mlir/lib/IR/AffineExprDetail.h index 214fee65056..8824ddd8682 100644 --- a/mlir/lib/IR/AffineExprDetail.h +++ b/mlir/lib/IR/AffineExprDetail.h @@ -1,19 +1,10 @@ //===- AffineExprDetail.h - MLIR Affine Expr storage details ----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of AffineExpr. Ideally it would not be // exposed and would be kept local to AffineExpr.cpp however, MLIRContext.cpp diff --git a/mlir/lib/IR/AffineMap.cpp b/mlir/lib/IR/AffineMap.cpp index 6cfef363985..50624afa3eb 100644 --- a/mlir/lib/IR/AffineMap.cpp +++ b/mlir/lib/IR/AffineMap.cpp @@ -1,19 +1,10 @@ //===- AffineMap.cpp - MLIR Affine Map Classes ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/AffineMap.h" #include "AffineMapDetail.h" diff --git a/mlir/lib/IR/AffineMapDetail.h b/mlir/lib/IR/AffineMapDetail.h index a247783540c..f00c4ba216e 100644 --- a/mlir/lib/IR/AffineMapDetail.h +++ b/mlir/lib/IR/AffineMapDetail.h @@ -1,19 +1,10 @@ //===- AffineMapDetail.h - MLIR Affine Map details Class --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of AffineMap. // diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index 177d8a5ef05..a574f87c530 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -1,19 +1,10 @@ //===- AsmPrinter.cpp - MLIR Assembly Printer Implementation --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the MLIR AsmPrinter class, which is used to implement // the various print() methods on the core IR objects. diff --git a/mlir/lib/IR/AttributeDetail.h b/mlir/lib/IR/AttributeDetail.h index da4aa69dda4..c78d49c0f87 100644 --- a/mlir/lib/IR/AttributeDetail.h +++ b/mlir/lib/IR/AttributeDetail.h @@ -1,19 +1,10 @@ //===- AttributeDetail.h - MLIR Affine Map details Class --------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of Attribute. // diff --git a/mlir/lib/IR/Attributes.cpp b/mlir/lib/IR/Attributes.cpp index bb35a63bf5d..3a9c91f6f77 100644 --- a/mlir/lib/IR/Attributes.cpp +++ b/mlir/lib/IR/Attributes.cpp @@ -1,19 +1,10 @@ //===- Attributes.cpp - MLIR Affine Expr Classes --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Attributes.h" #include "AttributeDetail.h" diff --git a/mlir/lib/IR/Block.cpp b/mlir/lib/IR/Block.cpp index 894f9ba38d0..b168a8facd2 100644 --- a/mlir/lib/IR/Block.cpp +++ b/mlir/lib/IR/Block.cpp @@ -1,19 +1,10 @@ //===- Block.cpp - MLIR Block Class ---------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Block.h" #include "mlir/IR/Builders.h" diff --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp index 733fcd13994..2ef10b6e669 100644 --- a/mlir/lib/IR/Builders.cpp +++ b/mlir/lib/IR/Builders.cpp @@ -1,19 +1,10 @@ //===- Builders.cpp - Helpers for constructing MLIR Classes ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Builders.h" #include "mlir/IR/AffineExpr.h" diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp index 59e16a48865..6ec92f05370 100644 --- a/mlir/lib/IR/Diagnostics.cpp +++ b/mlir/lib/IR/Diagnostics.cpp @@ -1,19 +1,10 @@ //===- Diagnostics.cpp - MLIR Diagnostics ---------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Diagnostics.h" #include "mlir/IR/Attributes.h" diff --git a/mlir/lib/IR/Dialect.cpp b/mlir/lib/IR/Dialect.cpp index c6266b09668..b2485a368fd 100644 --- a/mlir/lib/IR/Dialect.cpp +++ b/mlir/lib/IR/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Dialect implementation -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Dialect.h" #include "mlir/IR/Diagnostics.h" diff --git a/mlir/lib/IR/Function.cpp b/mlir/lib/IR/Function.cpp index b51c77f34c2..72b5ac46a8f 100644 --- a/mlir/lib/IR/Function.cpp +++ b/mlir/lib/IR/Function.cpp @@ -1,19 +1,10 @@ //===- Function.cpp - MLIR Function Classes -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Function.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/IR/FunctionImplementation.cpp b/mlir/lib/IR/FunctionImplementation.cpp index 9cec216468d..79863bc74f4 100644 --- a/mlir/lib/IR/FunctionImplementation.cpp +++ b/mlir/lib/IR/FunctionImplementation.cpp @@ -1,19 +1,10 @@ //===- FunctionImplementation.cpp - Utilities for function-like ops -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/FunctionImplementation.h" #include "mlir/IR/Builders.h" diff --git a/mlir/lib/IR/IntegerSet.cpp b/mlir/lib/IR/IntegerSet.cpp index ce50fa7cc5b..835b4c3a7e2 100644 --- a/mlir/lib/IR/IntegerSet.cpp +++ b/mlir/lib/IR/IntegerSet.cpp @@ -1,19 +1,10 @@ //===- IntegerSet.cpp - MLIR Integer Set class ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/IntegerSet.h" #include "IntegerSetDetail.h" diff --git a/mlir/lib/IR/IntegerSetDetail.h b/mlir/lib/IR/IntegerSetDetail.h index b3eda5205fb..54ffd47bd47 100644 --- a/mlir/lib/IR/IntegerSetDetail.h +++ b/mlir/lib/IR/IntegerSetDetail.h @@ -1,19 +1,10 @@ //===- IntegerSetDetail.h - MLIR IntegerSet storage details -----*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of IntegerSet. // diff --git a/mlir/lib/IR/Location.cpp b/mlir/lib/IR/Location.cpp index 1ea75d5e30e..e23a73647a4 100644 --- a/mlir/lib/IR/Location.cpp +++ b/mlir/lib/IR/Location.cpp @@ -1,19 +1,10 @@ //===- Location.cpp - MLIR Location Classes -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Location.h" #include "LocationDetail.h" diff --git a/mlir/lib/IR/LocationDetail.h b/mlir/lib/IR/LocationDetail.h index 6ccaa17018c..a47a2111c4f 100644 --- a/mlir/lib/IR/LocationDetail.h +++ b/mlir/lib/IR/LocationDetail.h @@ -1,19 +1,10 @@ //===- LocationDetail.h - MLIR Location storage details ---------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of the location attributes. // diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp index d3feca14477..42d77ae2a3d 100644 --- a/mlir/lib/IR/MLIRContext.cpp +++ b/mlir/lib/IR/MLIRContext.cpp @@ -1,19 +1,10 @@ //===- MLIRContext.cpp - MLIR Type Classes --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/MLIRContext.h" #include "AffineExprDetail.h" diff --git a/mlir/lib/IR/Module.cpp b/mlir/lib/IR/Module.cpp index c52a55b20fe..c5af227459c 100644 --- a/mlir/lib/IR/Module.cpp +++ b/mlir/lib/IR/Module.cpp @@ -1,19 +1,10 @@ //===- Module.cpp - MLIR Module Operation ---------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Module.h" #include "mlir/IR/Builders.h" diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp index 53399ce00a3..1dc7cb4bafd 100644 --- a/mlir/lib/IR/Operation.cpp +++ b/mlir/lib/IR/Operation.cpp @@ -1,19 +1,10 @@ //===- Operation.cpp - Operation support code -----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Operation.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/IR/OperationSupport.cpp b/mlir/lib/IR/OperationSupport.cpp index 333685a16fd..1c68686a0cb 100644 --- a/mlir/lib/IR/OperationSupport.cpp +++ b/mlir/lib/IR/OperationSupport.cpp @@ -1,19 +1,10 @@ //===- OperationSupport.cpp -----------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains out-of-line implementations of the support types that // Operation and related classes build on top of. diff --git a/mlir/lib/IR/PatternMatch.cpp b/mlir/lib/IR/PatternMatch.cpp index 3887a0308b0..d5749fabc07 100644 --- a/mlir/lib/IR/PatternMatch.cpp +++ b/mlir/lib/IR/PatternMatch.cpp @@ -1,19 +1,10 @@ //===- PatternMatch.cpp - Base classes for pattern match ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/PatternMatch.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/IR/Region.cpp b/mlir/lib/IR/Region.cpp index 26f14c43424..935854a5365 100644 --- a/mlir/lib/IR/Region.cpp +++ b/mlir/lib/IR/Region.cpp @@ -1,19 +1,10 @@ //===- Region.cpp - MLIR Region Class -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Region.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/IR/StandardTypes.cpp b/mlir/lib/IR/StandardTypes.cpp index 7c494e219e8..441b59ed9cd 100644 --- a/mlir/lib/IR/StandardTypes.cpp +++ b/mlir/lib/IR/StandardTypes.cpp @@ -1,19 +1,10 @@ //===- StandardTypes.cpp - MLIR Standard Type Classes ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/StandardTypes.h" #include "TypeDetail.h" diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp index bd8cb59cea7..83e5802093c 100644 --- a/mlir/lib/IR/SymbolTable.cpp +++ b/mlir/lib/IR/SymbolTable.cpp @@ -1,19 +1,10 @@ //===- SymbolTable.cpp - MLIR Symbol Table Class --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/SymbolTable.h" #include "llvm/ADT/SmallString.h" diff --git a/mlir/lib/IR/TypeDetail.h b/mlir/lib/IR/TypeDetail.h index 5bcb0b61aa5..b3e0edd3a57 100644 --- a/mlir/lib/IR/TypeDetail.h +++ b/mlir/lib/IR/TypeDetail.h @@ -1,19 +1,10 @@ //===- TypeDetail.h - MLIR Type storage details -----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This holds implementation details of Type. // diff --git a/mlir/lib/IR/TypeUtilities.cpp b/mlir/lib/IR/TypeUtilities.cpp index 8200e3a3bc6..8bc67e46fdc 100644 --- a/mlir/lib/IR/TypeUtilities.cpp +++ b/mlir/lib/IR/TypeUtilities.cpp @@ -1,19 +1,10 @@ //===- TypeUtilities.cpp - Helper function for type queries ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines generic type utilities. // diff --git a/mlir/lib/IR/Types.cpp b/mlir/lib/IR/Types.cpp index 23c80c96aad..923d6e16f57 100644 --- a/mlir/lib/IR/Types.cpp +++ b/mlir/lib/IR/Types.cpp @@ -1,19 +1,10 @@ //===- Types.cpp - MLIR Type Classes --------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Types.h" #include "TypeDetail.h" diff --git a/mlir/lib/IR/Value.cpp b/mlir/lib/IR/Value.cpp index 660d8ae3248..d723eec8b29 100644 --- a/mlir/lib/IR/Value.cpp +++ b/mlir/lib/IR/Value.cpp @@ -1,19 +1,10 @@ //===- Value.cpp - MLIR Value Classes -------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Value.h" #include "mlir/IR/Block.h" diff --git a/mlir/lib/IR/Visitors.cpp b/mlir/lib/IR/Visitors.cpp index ea2a6d69418..404e74a82c9 100644 --- a/mlir/lib/IR/Visitors.cpp +++ b/mlir/lib/IR/Visitors.cpp @@ -1,19 +1,10 @@ //===- Visitors.cpp - MLIR Visitor Utilties -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Visitors.h" #include "mlir/IR/Operation.h" diff --git a/mlir/lib/Parser/Lexer.cpp b/mlir/lib/Parser/Lexer.cpp index 29104c82e23..7d8337a9cb3 100644 --- a/mlir/lib/Parser/Lexer.cpp +++ b/mlir/lib/Parser/Lexer.cpp @@ -1,19 +1,10 @@ //===- Lexer.cpp - MLIR Lexer Implementation ------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the lexer for the MLIR textual form. // diff --git a/mlir/lib/Parser/Lexer.h b/mlir/lib/Parser/Lexer.h index a7a2ac4214c..a760dca9396 100644 --- a/mlir/lib/Parser/Lexer.h +++ b/mlir/lib/Parser/Lexer.h @@ -1,19 +1,10 @@ //===- Lexer.h - MLIR Lexer Interface ---------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file declares the MLIR Lexer class. // diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index f78704842fe..e25f4d19654 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -1,19 +1,10 @@ //===- Parser.cpp - MLIR Parser Implementation ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the parser for the MLIR textual form. // diff --git a/mlir/lib/Parser/Token.cpp b/mlir/lib/Parser/Token.cpp index c01d6032cbd..84de4c396f4 100644 --- a/mlir/lib/Parser/Token.cpp +++ b/mlir/lib/Parser/Token.cpp @@ -1,19 +1,10 @@ //===- Token.cpp - MLIR Token Implementation ------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the Token class for the MLIR textual form. // diff --git a/mlir/lib/Parser/Token.h b/mlir/lib/Parser/Token.h index 333c4d29aad..7487736fac7 100644 --- a/mlir/lib/Parser/Token.h +++ b/mlir/lib/Parser/Token.h @@ -1,19 +1,10 @@ //===- Token.h - MLIR Token Interface ---------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_LIB_PARSER_TOKEN_H #define MLIR_LIB_PARSER_TOKEN_H diff --git a/mlir/lib/Parser/TokenKinds.def b/mlir/lib/Parser/TokenKinds.def index 19cd343274d..fc9f7821f1a 100644 --- a/mlir/lib/Parser/TokenKinds.def +++ b/mlir/lib/Parser/TokenKinds.def @@ -1,19 +1,10 @@ //===- TokenKinds.def - MLIR Token Description ------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file is intended to be #include'd multiple times to extract information // about tokens for various clients in the lexer. diff --git a/mlir/lib/Pass/IRPrinting.cpp b/mlir/lib/Pass/IRPrinting.cpp index 9d1c1f0d391..132a0bec4b7 100644 --- a/mlir/lib/Pass/IRPrinting.cpp +++ b/mlir/lib/Pass/IRPrinting.cpp @@ -1,19 +1,10 @@ //===- IRPrinting.cpp -----------------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "PassDetail.h" #include "mlir/IR/Module.h" diff --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp index f893c7babf9..22e58cc5b63 100644 --- a/mlir/lib/Pass/Pass.cpp +++ b/mlir/lib/Pass/Pass.cpp @@ -1,19 +1,10 @@ //===- Pass.cpp - Pass infrastructure implementation ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements common pass infrastructure. // diff --git a/mlir/lib/Pass/PassDetail.h b/mlir/lib/Pass/PassDetail.h index d0a2ea63e7d..9a52535bedf 100644 --- a/mlir/lib/Pass/PassDetail.h +++ b/mlir/lib/Pass/PassDetail.h @@ -1,19 +1,10 @@ //===- PassDetail.h - MLIR Pass details -------------------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_PASS_PASSDETAIL_H_ #define MLIR_PASS_PASSDETAIL_H_ diff --git a/mlir/lib/Pass/PassManagerOptions.cpp b/mlir/lib/Pass/PassManagerOptions.cpp index c29e0d08869..87487069d97 100644 --- a/mlir/lib/Pass/PassManagerOptions.cpp +++ b/mlir/lib/Pass/PassManagerOptions.cpp @@ -1,19 +1,10 @@ //===- PassManagerOptions.cpp - PassManager Command Line Options ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp index 1a321d666c4..93753d363db 100644 --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -1,19 +1,10 @@ //===- PassRegistry.cpp - Pass Registration Utilities ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Pass/PassRegistry.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/lib/Pass/PassStatistics.cpp b/mlir/lib/Pass/PassStatistics.cpp index 530697421ef..0ab656c2054 100644 --- a/mlir/lib/Pass/PassStatistics.cpp +++ b/mlir/lib/Pass/PassStatistics.cpp @@ -1,19 +1,10 @@ //===- PassStatistics.cpp -------------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "PassDetail.h" #include "mlir/Pass/PassManager.h" diff --git a/mlir/lib/Pass/PassTiming.cpp b/mlir/lib/Pass/PassTiming.cpp index 113b65a09b5..93e640e7890 100644 --- a/mlir/lib/Pass/PassTiming.cpp +++ b/mlir/lib/Pass/PassTiming.cpp @@ -1,19 +1,10 @@ //===- PassTiming.cpp -----------------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "PassDetail.h" #include "mlir/Pass/PassManager.h" diff --git a/mlir/lib/Quantizer/Configurations/FxpMathConfig.cpp b/mlir/lib/Quantizer/Configurations/FxpMathConfig.cpp index 94e364238c5..ba9c078a765 100644 --- a/mlir/lib/Quantizer/Configurations/FxpMathConfig.cpp +++ b/mlir/lib/Quantizer/Configurations/FxpMathConfig.cpp @@ -1,19 +1,10 @@ //===- FxpMathConfig.cpp - Reference fixed point config -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a TargetConfiguration for reference fixed-point math // quantization scheme based on the FxpMathOps (plus a small category of diff --git a/mlir/lib/Quantizer/Support/Configuration.cpp b/mlir/lib/Quantizer/Support/Configuration.cpp index 78a74514f8b..f64cc85f0f7 100644 --- a/mlir/lib/Quantizer/Support/Configuration.cpp +++ b/mlir/lib/Quantizer/Support/Configuration.cpp @@ -1,19 +1,10 @@ //===- Configuration.cpp - Configuration object base classes --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/Configuration.h" diff --git a/mlir/lib/Quantizer/Support/ConstraintAnalysisGraph.cpp b/mlir/lib/Quantizer/Support/ConstraintAnalysisGraph.cpp index 13fed0f9b1c..38aa5dc811b 100644 --- a/mlir/lib/Quantizer/Support/ConstraintAnalysisGraph.cpp +++ b/mlir/lib/Quantizer/Support/ConstraintAnalysisGraph.cpp @@ -1,19 +1,10 @@ //===- ConstraintAnalysisGraph.cpp - Graphs type for constraints ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/ConstraintAnalysisGraph.h" diff --git a/mlir/lib/Quantizer/Support/Metadata.cpp b/mlir/lib/Quantizer/Support/Metadata.cpp index 89478c4209d..b7badfd5f87 100644 --- a/mlir/lib/Quantizer/Support/Metadata.cpp +++ b/mlir/lib/Quantizer/Support/Metadata.cpp @@ -1,19 +1,10 @@ //===- Metadata.cpp - Top level types and metadata ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/Metadata.h" diff --git a/mlir/lib/Quantizer/Support/Statistics.cpp b/mlir/lib/Quantizer/Support/Statistics.cpp index 6753898dbdc..3c8b041e244 100644 --- a/mlir/lib/Quantizer/Support/Statistics.cpp +++ b/mlir/lib/Quantizer/Support/Statistics.cpp @@ -1,19 +1,10 @@ //===- Statistics.cpp - Collects statistics over tensors ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/Statistics.h" diff --git a/mlir/lib/Quantizer/Support/TypeUtils.cpp b/mlir/lib/Quantizer/Support/TypeUtils.cpp index fab4e565308..a1f52c585a1 100644 --- a/mlir/lib/Quantizer/Support/TypeUtils.cpp +++ b/mlir/lib/Quantizer/Support/TypeUtils.cpp @@ -1,19 +1,10 @@ //===- TypeUtils.cpp - Helper function for manipulating types -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/TypeUtils.h" diff --git a/mlir/lib/Quantizer/Support/UniformConstraints.cpp b/mlir/lib/Quantizer/Support/UniformConstraints.cpp index 1a800dad4ac..b20213568a1 100644 --- a/mlir/lib/Quantizer/Support/UniformConstraints.cpp +++ b/mlir/lib/Quantizer/Support/UniformConstraints.cpp @@ -1,19 +1,10 @@ //===- UniformConstraints.cpp - Constraints for uniform quant -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/UniformConstraints.h" diff --git a/mlir/lib/Quantizer/Support/UniformSolvers.cpp b/mlir/lib/Quantizer/Support/UniformSolvers.cpp index 77d69be8382..2f6bb20792f 100644 --- a/mlir/lib/Quantizer/Support/UniformSolvers.cpp +++ b/mlir/lib/Quantizer/Support/UniformSolvers.cpp @@ -1,19 +1,10 @@ //===- UniformSolvers.cpp - Uniform type solver algorithms ----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/UniformSolvers.h" #include "mlir/Support/LLVM.h" diff --git a/mlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp b/mlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp index a3cbe214040..a27f09bf942 100644 --- a/mlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp +++ b/mlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp @@ -1,19 +1,10 @@ //===- AddDefaultStatsTestPass.cpp - Testing pass to add default stats ----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a testing pass to add default statistics nodes to every // quantization eligible op. Useful for unit testing. diff --git a/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp b/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp index 68c263bc423..c8569c2fe19 100644 --- a/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp +++ b/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp @@ -1,19 +1,10 @@ //===- InferQuantizedTypesPass.cpp - Infers quantized types ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines the primary pass for instantiating a CAG, running it to // convergence on a module to determine eligible quantized type transforms, and diff --git a/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp b/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp index 0266520bec3..da5bd12ea1c 100644 --- a/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp +++ b/mlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp @@ -1,19 +1,10 @@ //===- RemoveInstrumentationPass.cpp - Removes instrumentation ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a pass to remove any instrumentation ops. It is often one // of the final steps when performing quantization and is run after any diff --git a/mlir/lib/Support/FileUtilities.cpp b/mlir/lib/Support/FileUtilities.cpp index 6f0dc93b235..a56ae57ba25 100644 --- a/mlir/lib/Support/FileUtilities.cpp +++ b/mlir/lib/Support/FileUtilities.cpp @@ -1,19 +1,10 @@ //===- FileUtilities.cpp - utilities for working with files ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Definitions of common utilities for working with files. // diff --git a/mlir/lib/Support/JitRunner.cpp b/mlir/lib/Support/JitRunner.cpp index dcd23437401..b327d3d4756 100644 --- a/mlir/lib/Support/JitRunner.cpp +++ b/mlir/lib/Support/JitRunner.cpp @@ -1,19 +1,10 @@ //===- jit-runner.cpp - MLIR CPU Execution Driver Library -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is a library that provides a shared implementation for command line // utilities that execute an MLIR file on the CPU by translating MLIR to LLVM diff --git a/mlir/lib/Support/MlirOptMain.cpp b/mlir/lib/Support/MlirOptMain.cpp index c256e970c95..4a76801211c 100644 --- a/mlir/lib/Support/MlirOptMain.cpp +++ b/mlir/lib/Support/MlirOptMain.cpp @@ -1,19 +1,10 @@ //===- MlirOptMain.cpp - MLIR Optimizer Driver ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is a utility that runs an optimization pass and prints the result back // out. It is designed to support unit testing. diff --git a/mlir/lib/Support/StorageUniquer.cpp b/mlir/lib/Support/StorageUniquer.cpp index cae4dce143f..d6f6bac4236 100644 --- a/mlir/lib/Support/StorageUniquer.cpp +++ b/mlir/lib/Support/StorageUniquer.cpp @@ -1,19 +1,10 @@ //===- StorageUniquer.cpp - Common Storage Class Uniquer ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Support/StorageUniquer.h" diff --git a/mlir/lib/Support/ToolUtilities.cpp b/mlir/lib/Support/ToolUtilities.cpp index 60d0eee6b8a..cd2df7809b7 100644 --- a/mlir/lib/Support/ToolUtilities.cpp +++ b/mlir/lib/Support/ToolUtilities.cpp @@ -1,19 +1,10 @@ //===- ToolUtilities.cpp - MLIR Tool Utilities ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines common utilities for implementing MLIR tools. // diff --git a/mlir/lib/Support/TranslateClParser.cpp b/mlir/lib/Support/TranslateClParser.cpp index 115c0c03f50..1f538cb531d 100644 --- a/mlir/lib/Support/TranslateClParser.cpp +++ b/mlir/lib/Support/TranslateClParser.cpp @@ -1,19 +1,10 @@ //===- TranslateClParser.h - Translations command line parser -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains custom command line parser for translations. // diff --git a/mlir/lib/TableGen/Argument.cpp b/mlir/lib/TableGen/Argument.cpp index 17dba054e4f..080e717092e 100644 --- a/mlir/lib/TableGen/Argument.cpp +++ b/mlir/lib/TableGen/Argument.cpp @@ -1,19 +1,10 @@ //===- Argument.cpp - Argument definitions --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/TableGen/Argument.h" #include "llvm/TableGen/Record.h" diff --git a/mlir/lib/TableGen/Attribute.cpp b/mlir/lib/TableGen/Attribute.cpp index ec946a855fc..92f5b1f7d9f 100644 --- a/mlir/lib/TableGen/Attribute.cpp +++ b/mlir/lib/TableGen/Attribute.cpp @@ -1,19 +1,10 @@ //===- Attribute.cpp - Attribute wrapper class ----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Attribute wrapper to simplify using TableGen Record defining a MLIR // Attribute. diff --git a/mlir/lib/TableGen/Constraint.cpp b/mlir/lib/TableGen/Constraint.cpp index ef3fa5271fa..022c5ad04df 100644 --- a/mlir/lib/TableGen/Constraint.cpp +++ b/mlir/lib/TableGen/Constraint.cpp @@ -1,19 +1,10 @@ //===- Constraint.cpp - Constraint class ----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Constraint wrapper to simplify using TableGen Record for constraints. // diff --git a/mlir/lib/TableGen/Dialect.cpp b/mlir/lib/TableGen/Dialect.cpp index ace4ce3d0f6..d9e8e2f7154 100644 --- a/mlir/lib/TableGen/Dialect.cpp +++ b/mlir/lib/TableGen/Dialect.cpp @@ -1,19 +1,10 @@ //===- Dialect.cpp - Dialect wrapper class --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Dialect wrapper to simplify using TableGen Record defining a MLIR dialect. // diff --git a/mlir/lib/TableGen/Format.cpp b/mlir/lib/TableGen/Format.cpp index 967d51a61f7..07742ab6a40 100644 --- a/mlir/lib/TableGen/Format.cpp +++ b/mlir/lib/TableGen/Format.cpp @@ -1,19 +1,10 @@ //===- Format.cpp - Utilities for String Format ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines utilities for formatting strings. They are specially // tailored to the needs of TableGen'ing op definitions and rewrite rules, diff --git a/mlir/lib/TableGen/OpInterfaces.cpp b/mlir/lib/TableGen/OpInterfaces.cpp index 1687f3ac795..b1e56efc029 100644 --- a/mlir/lib/TableGen/OpInterfaces.cpp +++ b/mlir/lib/TableGen/OpInterfaces.cpp @@ -1,19 +1,10 @@ //===- OpInterfaces.cpp - OpInterfaces class ------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpInterfaces wrapper to simplify using TableGen OpInterfaces. // diff --git a/mlir/lib/TableGen/OpTrait.cpp b/mlir/lib/TableGen/OpTrait.cpp index 0e436a87497..86e34cd46b5 100644 --- a/mlir/lib/TableGen/OpTrait.cpp +++ b/mlir/lib/TableGen/OpTrait.cpp @@ -1,19 +1,10 @@ //===- OpTrait.cpp - OpTrait class ----------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpTrait wrapper to simplify using TableGen Record defining a MLIR OpTrait. // diff --git a/mlir/lib/TableGen/Operator.cpp b/mlir/lib/TableGen/Operator.cpp index 3825363bec0..d61eec4ad44 100644 --- a/mlir/lib/TableGen/Operator.cpp +++ b/mlir/lib/TableGen/Operator.cpp @@ -1,19 +1,10 @@ //===- Operator.cpp - Operator class --------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Operator wrapper to simplify using TableGen Record defining a MLIR Op. // diff --git a/mlir/lib/TableGen/Pattern.cpp b/mlir/lib/TableGen/Pattern.cpp index e8f44087b85..1045b784ae2 100644 --- a/mlir/lib/TableGen/Pattern.cpp +++ b/mlir/lib/TableGen/Pattern.cpp @@ -1,19 +1,10 @@ //===- Pattern.cpp - Pattern wrapper class --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Pattern wrapper class to simplify using TableGen Record defining a MLIR // Pattern. diff --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp index f8f23e04c3f..c52e15dbdea 100644 --- a/mlir/lib/TableGen/Predicate.cpp +++ b/mlir/lib/TableGen/Predicate.cpp @@ -1,19 +1,10 @@ //===- Predicate.cpp - Predicate class ------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Wrapper around predicates defined in TableGen. // diff --git a/mlir/lib/TableGen/Type.cpp b/mlir/lib/TableGen/Type.cpp index a558be4c89d..9a309bdde46 100644 --- a/mlir/lib/TableGen/Type.cpp +++ b/mlir/lib/TableGen/Type.cpp @@ -1,19 +1,10 @@ //===- Type.cpp - Type class ----------------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Type wrapper to simplify using TableGen Record defining a MLIR Type. // diff --git a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp index 7273d3dfd7b..6f3e2ef21aa 100644 --- a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp @@ -1,19 +1,10 @@ //===- ConvertFromLLVMIR.cpp - MLIR to LLVM IR conversion -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a translation between LLVM IR and the MLIR LLVM dialect. // diff --git a/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp index e69dce7b59b..4cc59974960 100644 --- a/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp @@ -1,19 +1,10 @@ //===- ConvertToLLVMIR.cpp - MLIR to LLVM IR conversion -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a translation between the MLIR LLVM dialect and LLVM IR. // diff --git a/mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp index 8baed9854f1..a5992174df3 100644 --- a/mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp @@ -1,19 +1,10 @@ //===- ConvertToNVVMIR.cpp - MLIR to LLVM IR conversion -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a translation between the MLIR LLVM + NVVM dialects and // LLVM IR with NVVM intrinsics and metadata. diff --git a/mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp b/mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp index f119b138e13..881d165e0c8 100644 --- a/mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp @@ -1,19 +1,10 @@ //===- ConvertToROCDLIR.cpp - MLIR to LLVM IR conversion ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a translation between the MLIR LLVM + ROCDL dialects and // LLVM IR with ROCDL intrinsics and metadata. diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp index ec28434b823..e8376364c41 100644 --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -1,19 +1,10 @@ //===- ModuleTranslation.cpp - MLIR to LLVM conversion --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements the translation between an MLIR LLVM dialect module and // the corresponding LLVMIR module. It only handles core LLVM IR operations. diff --git a/mlir/lib/Transforms/AffineDataCopyGeneration.cpp b/mlir/lib/Transforms/AffineDataCopyGeneration.cpp index 5bc33943e50..1e1b8775d32 100644 --- a/mlir/lib/Transforms/AffineDataCopyGeneration.cpp +++ b/mlir/lib/Transforms/AffineDataCopyGeneration.cpp @@ -1,19 +1,10 @@ //===- AffineDataCopyGeneration.cpp - Explicit memref copying pass ------*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to automatically promote accessed memref regions // to buffers in a faster memory space that is explicitly managed, with the diff --git a/mlir/lib/Transforms/AffineLoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/AffineLoopInvariantCodeMotion.cpp index 23199dd8a39..1f33c0f5dca 100644 --- a/mlir/lib/Transforms/AffineLoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/AffineLoopInvariantCodeMotion.cpp @@ -1,19 +1,10 @@ //===- AffineLoopInvariantCodeMotion.cpp - Code to perform loop fusion-----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop invariant code motion. // diff --git a/mlir/lib/Transforms/CSE.cpp b/mlir/lib/Transforms/CSE.cpp index 18f9fce5e46..714fb1d0109 100644 --- a/mlir/lib/Transforms/CSE.cpp +++ b/mlir/lib/Transforms/CSE.cpp @@ -1,19 +1,10 @@ //===- CSE.cpp - Common Sub-expression Elimination ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This transformation pass performs a simple common sub-expression elimination // algorithm on operations within a function. diff --git a/mlir/lib/Transforms/Canonicalizer.cpp b/mlir/lib/Transforms/Canonicalizer.cpp index 7dcdeb67cdc..5b3a1eb1cf3 100644 --- a/mlir/lib/Transforms/Canonicalizer.cpp +++ b/mlir/lib/Transforms/Canonicalizer.cpp @@ -1,19 +1,10 @@ //===- Canonicalizer.cpp - Canonicalize MLIR operations -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This transformation pass converts operations into their canonical forms by // folding constants, applying operation identity transformations etc. diff --git a/mlir/lib/Transforms/DialectConversion.cpp b/mlir/lib/Transforms/DialectConversion.cpp index 05066ef599c..a19274acd1b 100644 --- a/mlir/lib/Transforms/DialectConversion.cpp +++ b/mlir/lib/Transforms/DialectConversion.cpp @@ -1,19 +1,10 @@ //===- DialectConversion.cpp - MLIR dialect conversion generic pass -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Transforms/DialectConversion.h" #include "mlir/IR/Block.h" diff --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp index b158948069e..b2cee7da083 100644 --- a/mlir/lib/Transforms/Inliner.cpp +++ b/mlir/lib/Transforms/Inliner.cpp @@ -1,19 +1,10 @@ //===- Inliner.cpp - Pass to inline function calls ------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a basic inlining algorithm that operates bottom up over // the Strongly Connect Components(SCCs) of the CallGraph. This enables a more diff --git a/mlir/lib/Transforms/LoopCoalescing.cpp b/mlir/lib/Transforms/LoopCoalescing.cpp index c1eec56526e..2aee688c6c1 100644 --- a/mlir/lib/Transforms/LoopCoalescing.cpp +++ b/mlir/lib/Transforms/LoopCoalescing.cpp @@ -1,19 +1,10 @@ //===- LoopCoalescing.cpp - Pass transforming loop nests into single loops-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/LoopOps/LoopOps.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp index 60f0264eb35..51e30ba7163 100644 --- a/mlir/lib/Transforms/LoopFusion.cpp +++ b/mlir/lib/Transforms/LoopFusion.cpp @@ -1,19 +1,10 @@ //===- LoopFusion.cpp - Code to perform loop fusion -----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop fusion. // diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp index bd58827d001..93c80822fb3 100644 --- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp @@ -1,19 +1,10 @@ //===- LoopInvariantCodeMotion.cpp - Code to perform loop fusion-----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop invariant code motion. // diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Transforms/LoopTiling.cpp index 361a4d8ecb9..5389c7e4429 100644 --- a/mlir/lib/Transforms/LoopTiling.cpp +++ b/mlir/lib/Transforms/LoopTiling.cpp @@ -1,19 +1,10 @@ //===- LoopTiling.cpp --- Loop tiling pass ------------------------------*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to tile loop nests. // diff --git a/mlir/lib/Transforms/LoopUnroll.cpp b/mlir/lib/Transforms/LoopUnroll.cpp index 40f48ada4d7..e94c6c8b0bb 100644 --- a/mlir/lib/Transforms/LoopUnroll.cpp +++ b/mlir/lib/Transforms/LoopUnroll.cpp @@ -1,19 +1,10 @@ //===- LoopUnroll.cpp - Code to perform loop unrolling --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop unrolling. // diff --git a/mlir/lib/Transforms/LoopUnrollAndJam.cpp b/mlir/lib/Transforms/LoopUnrollAndJam.cpp index a857b8ec95a..3cefcaacadc 100644 --- a/mlir/lib/Transforms/LoopUnrollAndJam.cpp +++ b/mlir/lib/Transforms/LoopUnrollAndJam.cpp @@ -1,19 +1,10 @@ //===- LoopUnrollAndJam.cpp - Code to perform loop unroll and jam ---------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop unroll and jam. Unroll and jam is a transformation // that improves locality, in particular, register reuse, while also improving diff --git a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp index 0695aafe171..957f41a9d3e 100644 --- a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp +++ b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp @@ -1,19 +1,10 @@ //===- MemRefDataFlowOpt.cpp - MemRef DataFlow Optimization pass ------ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to forward memref stores to loads, thereby // potentially getting rid of intermediate memref's entirely. diff --git a/mlir/lib/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Transforms/PipelineDataTransfer.cpp index 4162936ea2d..12ce6c66abd 100644 --- a/mlir/lib/Transforms/PipelineDataTransfer.cpp +++ b/mlir/lib/Transforms/PipelineDataTransfer.cpp @@ -1,19 +1,10 @@ //===- PipelineDataTransfer.cpp --- Pass for pipelining data movement ---*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to pipeline data transfers. // diff --git a/mlir/lib/Transforms/SimplifyAffineStructures.cpp b/mlir/lib/Transforms/SimplifyAffineStructures.cpp index 9512ff738aa..217e06bc877 100644 --- a/mlir/lib/Transforms/SimplifyAffineStructures.cpp +++ b/mlir/lib/Transforms/SimplifyAffineStructures.cpp @@ -1,19 +1,10 @@ //===- SimplifyAffineStructures.cpp ---------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to simplify affine structures. // diff --git a/mlir/lib/Transforms/StripDebugInfo.cpp b/mlir/lib/Transforms/StripDebugInfo.cpp index 772df3da3c7..cdfc7fd7e41 100644 --- a/mlir/lib/Transforms/StripDebugInfo.cpp +++ b/mlir/lib/Transforms/StripDebugInfo.cpp @@ -1,19 +1,10 @@ //===- StripDebugInfo.cpp - Pass to strip debug information ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Function.h" #include "mlir/IR/Operation.h" diff --git a/mlir/lib/Transforms/Utils/FoldUtils.cpp b/mlir/lib/Transforms/Utils/FoldUtils.cpp index 85d1f21305e..ce39625831a 100644 --- a/mlir/lib/Transforms/Utils/FoldUtils.cpp +++ b/mlir/lib/Transforms/Utils/FoldUtils.cpp @@ -1,19 +1,10 @@ //===- FoldUtils.cpp ---- Fold Utilities ----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines various operation fold utilities. These utilities are // intended to be used by passes to unify and simply their logic. diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp index fe4a6f9f9e0..3ab4e287bb2 100644 --- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp +++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp @@ -1,19 +1,10 @@ //===- GreedyPatternRewriteDriver.cpp - A greedy rewriter -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements mlir::applyPatternsGreedily. // diff --git a/mlir/lib/Transforms/Utils/InliningUtils.cpp b/mlir/lib/Transforms/Utils/InliningUtils.cpp index 048130c0d3a..e7b34bb3956 100644 --- a/mlir/lib/Transforms/Utils/InliningUtils.cpp +++ b/mlir/lib/Transforms/Utils/InliningUtils.cpp @@ -1,19 +1,10 @@ //===- InliningUtils.cpp ---- Misc utilities for inlining -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous inlining utilities. // diff --git a/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp b/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp index d5cda3265de..4745a26e168 100644 --- a/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp @@ -1,19 +1,10 @@ //===- LoopFusionUtils.cpp ---- Utilities for loop fusion ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements loop fusion transformation utility functions. // diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp index bc1ced408a9..3d4db22c866 100644 --- a/mlir/lib/Transforms/Utils/LoopUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp @@ -1,19 +1,10 @@ //===- LoopUtils.cpp ---- Misc utilities for loop transformation ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous loop transformation routines. // diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp index 749d5bf1dd0..569c5416edd 100644 --- a/mlir/lib/Transforms/Utils/RegionUtils.cpp +++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp @@ -1,19 +1,10 @@ //===- RegionUtils.cpp - Region-related transformation utilities ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Transforms/RegionUtils.h" #include "mlir/IR/Block.h" diff --git a/mlir/lib/Transforms/Utils/Utils.cpp b/mlir/lib/Transforms/Utils/Utils.cpp index 96a6cdc544f..409729a5f20 100644 --- a/mlir/lib/Transforms/Utils/Utils.cpp +++ b/mlir/lib/Transforms/Utils/Utils.cpp @@ -1,19 +1,10 @@ //===- Utils.cpp ---- Misc utilities for code and data transformation -----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements miscellaneous transformation routines for non-loop IR // structures. diff --git a/mlir/lib/Transforms/Vectorize.cpp b/mlir/lib/Transforms/Vectorize.cpp index d8f5b1dc0e4..2dbac868cc0 100644 --- a/mlir/lib/Transforms/Vectorize.cpp +++ b/mlir/lib/Transforms/Vectorize.cpp @@ -1,19 +1,10 @@ //===- Vectorize.cpp - Vectorize Pass Impl --------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements vectorization of loops, operations and data types to // a target-independent, n-D super-vector abstraction. diff --git a/mlir/lib/Transforms/ViewOpGraph.cpp b/mlir/lib/Transforms/ViewOpGraph.cpp index 591562d0245..508c547a52b 100644 --- a/mlir/lib/Transforms/ViewOpGraph.cpp +++ b/mlir/lib/Transforms/ViewOpGraph.cpp @@ -1,19 +1,10 @@ //===- ViewOpGraph.cpp - View/write op graphviz graphs --------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Transforms/ViewOpGraph.h" #include "mlir/IR/Block.h" diff --git a/mlir/lib/Transforms/ViewRegionGraph.cpp b/mlir/lib/Transforms/ViewRegionGraph.cpp index db55415d62e..77111087d07 100644 --- a/mlir/lib/Transforms/ViewRegionGraph.cpp +++ b/mlir/lib/Transforms/ViewRegionGraph.cpp @@ -1,19 +1,10 @@ //===- ViewRegionGraph.cpp - View/write graphviz graphs -------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Transforms/ViewRegionGraph.h" #include "mlir/IR/RegionGraphTraits.h" diff --git a/mlir/lib/Translation/Translation.cpp b/mlir/lib/Translation/Translation.cpp index 8b5f98714e4..80c1e483731 100644 --- a/mlir/lib/Translation/Translation.cpp +++ b/mlir/lib/Translation/Translation.cpp @@ -1,19 +1,10 @@ //===- Translation.cpp - Translation registry -----------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Definitions of the translation registry. // diff --git a/mlir/test/APITest.h b/mlir/test/APITest.h index 9475bae2b58..08d64a0e48d 100644 --- a/mlir/test/APITest.h +++ b/mlir/test/APITest.h @@ -1,19 +1,10 @@ //===- Test.h - Simple macros for API unit tests ----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file define simple macros for declaring test functions and running them. // The actual checking must be performed on the outputs with FileCheck. diff --git a/mlir/test/EDSC/builder-api-test.cpp b/mlir/test/EDSC/builder-api-test.cpp index 376fc249a18..cfe703281e2 100644 --- a/mlir/test/EDSC/builder-api-test.cpp +++ b/mlir/test/EDSC/builder-api-test.cpp @@ -1,19 +1,10 @@ //===- builder-api-test.cpp - Tests for Declarative Builder APIs ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // RUN: mlir-edsc-builder-api-test | FileCheck %s diff --git a/mlir/test/SDBM/sdbm-api-test.cpp b/mlir/test/SDBM/sdbm-api-test.cpp index 12aff301d88..a672290d01d 100644 --- a/mlir/test/SDBM/sdbm-api-test.cpp +++ b/mlir/test/SDBM/sdbm-api-test.cpp @@ -1,19 +1,10 @@ //===- sdbm-api-test.cpp - Tests for SDBM expression APIs -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // RUN: mlir-sdbm-api-test | FileCheck %s diff --git a/mlir/test/lib/DeclarativeTransforms/TestLinalgTransformPatterns.td b/mlir/test/lib/DeclarativeTransforms/TestLinalgTransformPatterns.td index d2313927398..d07f6060c3b 100644 --- a/mlir/test/lib/DeclarativeTransforms/TestLinalgTransformPatterns.td +++ b/mlir/test/lib/DeclarativeTransforms/TestLinalgTransformPatterns.td @@ -1,19 +1,10 @@ //===- TestLinalgTransformPatterns.td - Test patterns --*- tablegen ----*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the pattern definition file for declarative Linalg transformations // tests. diff --git a/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td b/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td index 228a8a018d6..29875ccd543 100644 --- a/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td +++ b/mlir/test/lib/DeclarativeTransforms/TestVectorTransformPatterns.td @@ -1,19 +1,10 @@ //===- TestVectorTransformPatterns.td - Test patterns ---*- tablegen ----*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is the pattern definition file for declarative Vector transformations // tests. diff --git a/mlir/test/lib/IR/TestFunc.cpp b/mlir/test/lib/IR/TestFunc.cpp index 880d0785bb5..3e131590fae 100644 --- a/mlir/test/lib/IR/TestFunc.cpp +++ b/mlir/test/lib/IR/TestFunc.cpp @@ -1,19 +1,10 @@ //===- TestFunctionLike.cpp - Pass to test helpers on FunctionLike --------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Function.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/IR/TestMatchers.cpp b/mlir/test/lib/IR/TestMatchers.cpp index 5985a88ffa6..b62daa8437c 100644 --- a/mlir/test/lib/IR/TestMatchers.cpp +++ b/mlir/test/lib/IR/TestMatchers.cpp @@ -1,19 +1,10 @@ //===- TestMatchers.cpp - Pass to test matchers ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/StandardOps/Ops.h" #include "mlir/IR/Function.h" diff --git a/mlir/test/lib/IR/TestSymbolUses.cpp b/mlir/test/lib/IR/TestSymbolUses.cpp index 8ef4bb48a1c..c8fb1d8eecf 100644 --- a/mlir/test/lib/IR/TestSymbolUses.cpp +++ b/mlir/test/lib/IR/TestSymbolUses.cpp @@ -1,19 +1,10 @@ //===- TestSymbolUses.cpp - Pass to test symbol uselists ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "TestDialect.h" #include "mlir/IR/Function.h" diff --git a/mlir/test/lib/Pass/TestPassManager.cpp b/mlir/test/lib/Pass/TestPassManager.cpp index d1e1a6d13ee..2e811634880 100644 --- a/mlir/test/lib/Pass/TestPassManager.cpp +++ b/mlir/test/lib/Pass/TestPassManager.cpp @@ -1,19 +1,10 @@ //===- TestPassManager.cpp - Test pass manager functionality --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Function.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/TestDialect/TestDialect.cpp b/mlir/test/lib/TestDialect/TestDialect.cpp index 12d024f6593..976a1976f01 100644 --- a/mlir/test/lib/TestDialect/TestDialect.cpp +++ b/mlir/test/lib/TestDialect/TestDialect.cpp @@ -1,19 +1,10 @@ //===- TestDialect.cpp - MLIR Dialect for Testing -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "TestDialect.h" #include "mlir/IR/Function.h" diff --git a/mlir/test/lib/TestDialect/TestDialect.h b/mlir/test/lib/TestDialect/TestDialect.h index 783b8a1bcdd..20db0f39b81 100644 --- a/mlir/test/lib/TestDialect/TestDialect.h +++ b/mlir/test/lib/TestDialect/TestDialect.h @@ -1,19 +1,10 @@ //===- TestDialect.h - MLIR Dialect for testing -----------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines a fake 'test' dialect that can be used for testing things // that do not have a respective counterpart in the main source directories. diff --git a/mlir/test/lib/TestDialect/TestOps.td b/mlir/test/lib/TestDialect/TestOps.td index ea071f0ddf4..a8709ddca27 100644 --- a/mlir/test/lib/TestDialect/TestOps.td +++ b/mlir/test/lib/TestDialect/TestOps.td @@ -1,19 +1,10 @@ //===-- TestOps.td - Test dialect operation definitions ----*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef TEST_OPS #define TEST_OPS diff --git a/mlir/test/lib/TestDialect/TestPatterns.cpp b/mlir/test/lib/TestDialect/TestPatterns.cpp index 1f6224dba3a..b886097202d 100644 --- a/mlir/test/lib/TestDialect/TestPatterns.cpp +++ b/mlir/test/lib/TestDialect/TestPatterns.cpp @@ -1,19 +1,10 @@ //===- TestPatterns.cpp - Test dialect pattern driver ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "TestDialect.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/test/lib/Transforms/TestCallGraph.cpp b/mlir/test/lib/Transforms/TestCallGraph.cpp index debf5e77645..6378d953648 100644 --- a/mlir/test/lib/Transforms/TestCallGraph.cpp +++ b/mlir/test/lib/Transforms/TestCallGraph.cpp @@ -1,19 +1,10 @@ //===- TestCallGraph.cpp - Test callgraph construction and iteration ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains test passes for constructing and iterating over a // callgraph. diff --git a/mlir/test/lib/Transforms/TestConstantFold.cpp b/mlir/test/lib/Transforms/TestConstantFold.cpp index 5a0e9ed3f3c..f660bccca1d 100644 --- a/mlir/test/lib/Transforms/TestConstantFold.cpp +++ b/mlir/test/lib/Transforms/TestConstantFold.cpp @@ -1,19 +1,10 @@ //===- TestConstantFold.cpp - Pass to test constant folding ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/AffineOps/AffineOps.h" #include "mlir/Dialect/StandardOps/Ops.h" diff --git a/mlir/test/lib/Transforms/TestInlining.cpp b/mlir/test/lib/Transforms/TestInlining.cpp index 0571dc62b73..36378283f8e 100644 --- a/mlir/test/lib/Transforms/TestInlining.cpp +++ b/mlir/test/lib/Transforms/TestInlining.cpp @@ -1,19 +1,10 @@ //===- TestInlining.cpp - Pass to inline calls in the test dialect --------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // TODO(riverriddle) This pass is only necessary because the main inlining pass // has no abstracted away the call+callee relationship. When the inlining diff --git a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp index 37030ca2059..6ea995d3dfe 100644 --- a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp +++ b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp @@ -1,19 +1,10 @@ //===- TestLinalgTransforms.cpp - Test Linalg transformation patterns -----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements logic for testing Linalg transformations. // diff --git a/mlir/test/lib/Transforms/TestLiveness.cpp b/mlir/test/lib/Transforms/TestLiveness.cpp index d97060247f4..23725740df4 100644 --- a/mlir/test/lib/Transforms/TestLiveness.cpp +++ b/mlir/test/lib/Transforms/TestLiveness.cpp @@ -1,20 +1,11 @@ //===- TestLiveness.cpp - Test liveness construction and information //-------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains test passes for constructing and resolving liveness // information. diff --git a/mlir/test/lib/Transforms/TestLoopFusion.cpp b/mlir/test/lib/Transforms/TestLoopFusion.cpp index 7dc722f21f6..23e5035153e 100644 --- a/mlir/test/lib/Transforms/TestLoopFusion.cpp +++ b/mlir/test/lib/Transforms/TestLoopFusion.cpp @@ -1,19 +1,10 @@ //===- TestLoopFusion.cpp - Test loop fusion ------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to test various loop fusion utility functions. // diff --git a/mlir/test/lib/Transforms/TestLoopMapping.cpp b/mlir/test/lib/Transforms/TestLoopMapping.cpp index 7f587fc3170..5b1394d5996 100644 --- a/mlir/test/lib/Transforms/TestLoopMapping.cpp +++ b/mlir/test/lib/Transforms/TestLoopMapping.cpp @@ -1,19 +1,10 @@ //===- TestLoopMapping.cpp --- Parametric loop mapping pass ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to parametrically map loop.for loops to virtual // processing element dimensions. diff --git a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp index 9a8e1917e1f..7b0cdcade4d 100644 --- a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp +++ b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp @@ -1,19 +1,10 @@ //===- TestLoopParametricTiling.cpp --- Parametric loop tiling pass -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a pass to parametrically tile nests of standard loops. // diff --git a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp index 40788b259c5..d5e0b7df02b 100644 --- a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp +++ b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp @@ -1,19 +1,10 @@ //===- TestMemRefStrideCalculation.cpp - Pass to test strides computation--===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/StandardOps/Ops.h" #include "mlir/IR/StandardTypes.h" diff --git a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp b/mlir/test/lib/Transforms/TestOpaqueLoc.cpp index 0db53322fb8..9a261c0bb3b 100644 --- a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp +++ b/mlir/test/lib/Transforms/TestOpaqueLoc.cpp @@ -1,19 +1,10 @@ //===- TestOpaqueLoc.cpp - Pass to test opaque locations ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/StandardOps/Ops.h" #include "mlir/IR/Builders.h" diff --git a/mlir/test/lib/Transforms/TestVectorToLoopsConversion.cpp b/mlir/test/lib/Transforms/TestVectorToLoopsConversion.cpp index e5f5f749bd0..a31f8e474b4 100644 --- a/mlir/test/lib/Transforms/TestVectorToLoopsConversion.cpp +++ b/mlir/test/lib/Transforms/TestVectorToLoopsConversion.cpp @@ -1,19 +1,10 @@ //===- TestVectorToLoopsConversion.cpp - Test VectorTransfers lowering ----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include diff --git a/mlir/test/lib/Transforms/TestVectorTransforms.cpp b/mlir/test/lib/Transforms/TestVectorTransforms.cpp index 1d513065330..664d49ab4e5 100644 --- a/mlir/test/lib/Transforms/TestVectorTransforms.cpp +++ b/mlir/test/lib/Transforms/TestVectorTransforms.cpp @@ -1,19 +1,10 @@ //===- TestVectorToVectorConversion.cpp - Test VectorTransfers lowering ---===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include diff --git a/mlir/test/lib/Transforms/TestVectorizationUtils.cpp b/mlir/test/lib/Transforms/TestVectorizationUtils.cpp index 35df0631ca7..e131f4803ef 100644 --- a/mlir/test/lib/Transforms/TestVectorizationUtils.cpp +++ b/mlir/test/lib/Transforms/TestVectorizationUtils.cpp @@ -1,19 +1,10 @@ //===- VectorizerTestPass.cpp - VectorizerTestPass Pass Impl --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file implements a simple testing pass for vectorization functionality. // diff --git a/mlir/test/mlir-cpu-runner/cblas.cpp b/mlir/test/mlir-cpu-runner/cblas.cpp index d219b7b1256..aebb8f212b4 100644 --- a/mlir/test/mlir-cpu-runner/cblas.cpp +++ b/mlir/test/mlir-cpu-runner/cblas.cpp @@ -1,19 +1,10 @@ //===- cblas.cpp - Simple Blas subset implementation ----------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Simple Blas subset implementation. // diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp index 831702f594e..5e3a00e7fd1 100644 --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -1,19 +1,10 @@ //===- cblas_interface.cpp - Simple Blas subset interface -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Simple Blas subset interface implementation. // diff --git a/mlir/test/mlir-cpu-runner/include/cblas.h b/mlir/test/mlir-cpu-runner/include/cblas.h index 522ac8380b9..ccd316ff52e 100644 --- a/mlir/test/mlir-cpu-runner/include/cblas.h +++ b/mlir/test/mlir-cpu-runner/include/cblas.h @@ -1,19 +1,10 @@ //===- cblas.h - Simple Blas subset ---------------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CPU_RUNNER_CBLAS_H_ #define MLIR_CPU_RUNNER_CBLAS_H_ diff --git a/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h b/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h index d4b6e1fedb0..1f4e638c33e 100644 --- a/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h +++ b/mlir/test/mlir-cpu-runner/include/mlir_runner_utils.h @@ -1,19 +1,10 @@ //===- mlir_runner_utils.h - Utils for debugging MLIR CPU execution -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #ifndef MLIR_CPU_RUNNER_MLIRUTILS_H_ #define MLIR_CPU_RUNNER_MLIRUTILS_H_ diff --git a/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp b/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp index 56829c629bb..fc3a782c080 100644 --- a/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp +++ b/mlir/test/mlir-cpu-runner/mlir_runner_utils.cpp @@ -1,19 +1,10 @@ //===- mlir_runner_utils.cpp - Utils for MLIR CPU execution ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Utilities for interfacing MLIR types with C code as well as printing, // debugging etc. diff --git a/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp b/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp index f7023c4cf61..144f73d9c97 100644 --- a/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp +++ b/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp @@ -1,19 +1,10 @@ //===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Main entry point to a command line utility that executes an MLIR file on the // CPU by translating MLIR to LLVM IR before JIT-compiling and executing the diff --git a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp index 0698095afcf..9f1591b5a8c 100644 --- a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp +++ b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp @@ -1,19 +1,10 @@ //===- cuda-runtime-wrappers.cpp - MLIR CUDA runner wrapper library -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Implements C wrappers around the CUDA library for easy linking in ORC jit. // Also adds some debugging helpers that are helpful when writing MLIR code to diff --git a/mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp b/mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp index c1ca4ebd8e1..d6160d6d6e0 100644 --- a/mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp +++ b/mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp @@ -1,19 +1,10 @@ //===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is a command line utility that executes an MLIR file on the GPU by // translating MLIR to NVVM/LVVM IR before JIT-compiling and executing the diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp index d01f66d4e0b..b0dd1b59ce7 100644 --- a/mlir/tools/mlir-opt/mlir-opt.cpp +++ b/mlir/tools/mlir-opt/mlir-opt.cpp @@ -1,19 +1,10 @@ //===- mlir-opt.cpp - MLIR Optimizer Driver -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // Main entry function for mlir-opt for when built as standalone binary. // diff --git a/mlir/tools/mlir-tblgen/DocGenUtilities.h b/mlir/tools/mlir-tblgen/DocGenUtilities.h index b7617742727..1b3c8541aee 100644 --- a/mlir/tools/mlir-tblgen/DocGenUtilities.h +++ b/mlir/tools/mlir-tblgen/DocGenUtilities.h @@ -1,19 +1,10 @@ //===- DocGenUtilities.h - MLIR doc gen utilities ---------------*- C++ -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file defines common utilities for generating documents from tablegen // structures. diff --git a/mlir/tools/mlir-tblgen/EnumsGen.cpp b/mlir/tools/mlir-tblgen/EnumsGen.cpp index e278fdd80e8..610a380dab3 100644 --- a/mlir/tools/mlir-tblgen/EnumsGen.cpp +++ b/mlir/tools/mlir-tblgen/EnumsGen.cpp @@ -1,19 +1,10 @@ //===- EnumsGen.cpp - MLIR enum utility generator -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // EnumsGen generates common utility functions for enums. // diff --git a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp index f4b1279f11e..30f720e8d73 100644 --- a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp +++ b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp @@ -1,19 +1,10 @@ //===- LLVMIRConversionGen.cpp - MLIR LLVM IR builder generator -----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file uses tablegen definitions of the LLVM IR Dialect operations to // generate the code building the LLVM IR from it. diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp index df8feb855c5..52cbc08c429 100644 --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -1,19 +1,10 @@ //===- OpDefinitionsGen.cpp - MLIR op definitions generator ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpDefinitionsGen uses the description of operations to generate C++ // definitions for ops. diff --git a/mlir/tools/mlir-tblgen/OpDocGen.cpp b/mlir/tools/mlir-tblgen/OpDocGen.cpp index 8b048d9ea94..87a27238ce3 100644 --- a/mlir/tools/mlir-tblgen/OpDocGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDocGen.cpp @@ -1,19 +1,10 @@ //===- OpDocGen.cpp - MLIR operation documentation generator --------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpDocGen uses the description of operations to generate documentation for the // operations. diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp index a48bd2509bc..a96736cd2c5 100644 --- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp +++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp @@ -1,19 +1,10 @@ //===- OpInterfacesGen.cpp - MLIR op interface utility generator ----------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // OpInterfacesGen generates definitions for operation interfaces. // diff --git a/mlir/tools/mlir-tblgen/ReferenceImplGen.cpp b/mlir/tools/mlir-tblgen/ReferenceImplGen.cpp index 9181d0e90ed..90b60e5efed 100644 --- a/mlir/tools/mlir-tblgen/ReferenceImplGen.cpp +++ b/mlir/tools/mlir-tblgen/ReferenceImplGen.cpp @@ -1,19 +1,10 @@ //===- ReferenceImplGen.cpp - MLIR reference implementation generator -----===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // ReferenceImplGen uses the description of operations to generate reference // implementations for the ops. diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp index a74bc23a95a..8cfd454d629 100644 --- a/mlir/tools/mlir-tblgen/RewriterGen.cpp +++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp @@ -1,19 +1,10 @@ //===- RewriterGen.cpp - MLIR pattern rewriter generator ------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // RewriterGen uses pattern rewrite definitions to generate rewriter matchers. // diff --git a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp index 6d5bcc116ad..1aa7d5968d2 100644 --- a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp +++ b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp @@ -1,19 +1,10 @@ //===- SPIRVSerializationGen.cpp - SPIR-V serialization utility generator -===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // SPIRVSerializationGen generates common utility functions for SPIR-V // serialization. diff --git a/mlir/tools/mlir-tblgen/StructsGen.cpp b/mlir/tools/mlir-tblgen/StructsGen.cpp index d8844957ece..576085e41eb 100644 --- a/mlir/tools/mlir-tblgen/StructsGen.cpp +++ b/mlir/tools/mlir-tblgen/StructsGen.cpp @@ -1,19 +1,10 @@ //===- StructsGen.cpp - MLIR struct utility generator ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // StructsGen generates common utility functions for grouping attributes into a // set of structured data. diff --git a/mlir/tools/mlir-tblgen/mlir-tblgen.cpp b/mlir/tools/mlir-tblgen/mlir-tblgen.cpp index 993a05d7095..3c9778b3ec7 100644 --- a/mlir/tools/mlir-tblgen/mlir-tblgen.cpp +++ b/mlir/tools/mlir-tblgen/mlir-tblgen.cpp @@ -1,19 +1,10 @@ //===- mlir-tblgen.cpp - Top-Level TableGen implementation for MLIR -------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains the main function for MLIR's TableGen. // diff --git a/mlir/tools/mlir-translate/mlir-translate.cpp b/mlir/tools/mlir-translate/mlir-translate.cpp index b5622e3ecf8..3b15c5f3875 100644 --- a/mlir/tools/mlir-translate/mlir-translate.cpp +++ b/mlir/tools/mlir-translate/mlir-translate.cpp @@ -1,19 +1,10 @@ //===- mlir-translate.cpp - MLIR Translate Driver -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This is a command line utility that translates a file from/to MLIR using one // of the registered translations. diff --git a/mlir/unittests/ADT/TypeSwitchTest.cpp b/mlir/unittests/ADT/TypeSwitchTest.cpp index b6a78de892e..549fb9b221e 100644 --- a/mlir/unittests/ADT/TypeSwitchTest.cpp +++ b/mlir/unittests/ADT/TypeSwitchTest.cpp @@ -1,19 +1,10 @@ //===- TypeSwitchTest.cpp - TypeSwitch unit tests -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/ADT/TypeSwitch.h" #include "gtest/gtest.h" diff --git a/mlir/unittests/Dialect/BroadcastShapeTest.cpp b/mlir/unittests/Dialect/BroadcastShapeTest.cpp index c475fa79476..594e98741e1 100644 --- a/mlir/unittests/Dialect/BroadcastShapeTest.cpp +++ b/mlir/unittests/Dialect/BroadcastShapeTest.cpp @@ -1,19 +1,10 @@ //===- BroadcastShapeTest.cpp - broadcasting shape unit tests -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/Traits.h" #include "llvm/ADT/SmallVector.h" diff --git a/mlir/unittests/Dialect/QuantOps/QuantizationUtilsTest.cpp b/mlir/unittests/Dialect/QuantOps/QuantizationUtilsTest.cpp index d10623e3d1d..4f6ad302c7c 100644 --- a/mlir/unittests/Dialect/QuantOps/QuantizationUtilsTest.cpp +++ b/mlir/unittests/Dialect/QuantOps/QuantizationUtilsTest.cpp @@ -1,19 +1,10 @@ //===- QuantizationUtilsTest.cpp - unit tests for quantization utils ------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/QuantOps/QuantizeUtils.h" #include "mlir/Dialect/QuantOps/UniformSupport.h" diff --git a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp index ed5bd9ebecc..72fee15ac90 100644 --- a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp +++ b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp @@ -1,19 +1,10 @@ //===- DeserializationTest.cpp - SPIR-V Deserialization Tests -------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // The purpose of this file is to provide negative deserialization tests. // For positive deserialization tests, please use serialization and diff --git a/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp b/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp index 2728ab820b6..61f5fcbfb7b 100644 --- a/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp +++ b/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp @@ -1,19 +1,10 @@ //===- SerializationTest.cpp - SPIR-V Serialization Tests -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// // // This file contains corner case tests for the SPIR-V serializer that are not // covered by normal serialization and deserialization roundtripping. diff --git a/mlir/unittests/IR/AttributeTest.cpp b/mlir/unittests/IR/AttributeTest.cpp index 3db87b29c2d..5a1750e1123 100644 --- a/mlir/unittests/IR/AttributeTest.cpp +++ b/mlir/unittests/IR/AttributeTest.cpp @@ -1,19 +1,10 @@ //===- AttributeTest.cpp - Attribute unit tests ---------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Attributes.h" #include "mlir/IR/StandardTypes.h" diff --git a/mlir/unittests/IR/DialectTest.cpp b/mlir/unittests/IR/DialectTest.cpp index e48d2d7d710..1438d322652 100644 --- a/mlir/unittests/IR/DialectTest.cpp +++ b/mlir/unittests/IR/DialectTest.cpp @@ -1,19 +1,10 @@ //===- DialectTest.cpp - Dialect unit tests -------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Dialect.h" #include "gtest/gtest.h" diff --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp index d7dae4648fe..004a940ca6c 100644 --- a/mlir/unittests/IR/OperationSupportTest.cpp +++ b/mlir/unittests/IR/OperationSupportTest.cpp @@ -1,19 +1,10 @@ //===- OperationSupportTest.cpp - Operation support unit tests ------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/OperationSupport.h" #include "mlir/IR/Builders.h" diff --git a/mlir/unittests/IR/StringExtrasTest.cpp b/mlir/unittests/IR/StringExtrasTest.cpp index def65950365..3773006faee 100644 --- a/mlir/unittests/IR/StringExtrasTest.cpp +++ b/mlir/unittests/IR/StringExtrasTest.cpp @@ -1,19 +1,10 @@ //===- StringExtrasTest.cpp - Tests for utility methods in StringExtras.h -===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Support/StringExtras.h" #include "gtest/gtest.h" diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp index 790ad9c2589..0ea2c3f66e5 100644 --- a/mlir/unittests/Pass/AnalysisManagerTest.cpp +++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp @@ -1,19 +1,10 @@ //===- AnalysisManagerTest.cpp - AnalysisManager unit tests ---------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Pass/AnalysisManager.h" #include "mlir/IR/Builders.h" diff --git a/mlir/unittests/Quantizer/Support/RulesTest.cpp b/mlir/unittests/Quantizer/Support/RulesTest.cpp index 7ddfb715751..e2593848cbf 100644 --- a/mlir/unittests/Quantizer/Support/RulesTest.cpp +++ b/mlir/unittests/Quantizer/Support/RulesTest.cpp @@ -1,19 +1,10 @@ //===- RulesTest.cpp - Rules unit tests -----------------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/Rules.h" #include "llvm/Support/raw_ostream.h" diff --git a/mlir/unittests/Quantizer/Support/UniformSolversTest.cpp b/mlir/unittests/Quantizer/Support/UniformSolversTest.cpp index 4a53f923d3d..4e27cdc1d66 100644 --- a/mlir/unittests/Quantizer/Support/UniformSolversTest.cpp +++ b/mlir/unittests/Quantizer/Support/UniformSolversTest.cpp @@ -1,19 +1,10 @@ //===- UniformSolversTest.cpp - Tests for uniform solvers -----------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Quantizer/Support/UniformSolvers.h" #include "gtest/gtest.h" diff --git a/mlir/unittests/SDBM/SDBMTest.cpp b/mlir/unittests/SDBM/SDBMTest.cpp index 99756dcaa96..aa55ce58477 100644 --- a/mlir/unittests/SDBM/SDBMTest.cpp +++ b/mlir/unittests/SDBM/SDBMTest.cpp @@ -1,19 +1,10 @@ //===- SDBMTest.cpp - SDBM expression unit tests --------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/Dialect/SDBM/SDBM.h" #include "mlir/Dialect/SDBM/SDBMDialect.h" diff --git a/mlir/unittests/TableGen/EnumsGenTest.cpp b/mlir/unittests/TableGen/EnumsGenTest.cpp index 3934e8b0ed2..e4fe68482ef 100644 --- a/mlir/unittests/TableGen/EnumsGenTest.cpp +++ b/mlir/unittests/TableGen/EnumsGenTest.cpp @@ -1,19 +1,10 @@ //===- EnumsGenTest.cpp - TableGen EnumsGen Tests -------------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Optional.h" diff --git a/mlir/unittests/TableGen/FormatTest.cpp b/mlir/unittests/TableGen/FormatTest.cpp index 7338a8f7554..0566c8a5a7b 100644 --- a/mlir/unittests/TableGen/FormatTest.cpp +++ b/mlir/unittests/TableGen/FormatTest.cpp @@ -1,19 +1,10 @@ //===- FormatTest.cpp - TableGen Format Utility Tests ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/TableGen/Format.h" #include "gmock/gmock.h" diff --git a/mlir/unittests/TableGen/StructsGenTest.cpp b/mlir/unittests/TableGen/StructsGenTest.cpp index b446ca9558a..45455d7e2aa 100644 --- a/mlir/unittests/TableGen/StructsGenTest.cpp +++ b/mlir/unittests/TableGen/StructsGenTest.cpp @@ -1,19 +1,10 @@ //===- StructsGenTest.cpp - TableGen StructsGen Tests ---------------------===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// #include "mlir/IR/Attributes.h" #include "mlir/IR/Identifier.h" diff --git a/mlir/unittests/TableGen/enums.td b/mlir/unittests/TableGen/enums.td index 806d4a9d7b9..7d44856f9dc 100644 --- a/mlir/unittests/TableGen/enums.td +++ b/mlir/unittests/TableGen/enums.td @@ -1,19 +1,10 @@ //===-- enums.td - EnumsGen test definition file -----------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// include "mlir/IR/OpBase.td" diff --git a/mlir/unittests/TableGen/structs.td b/mlir/unittests/TableGen/structs.td index efa0a6024c5..88551751182 100644 --- a/mlir/unittests/TableGen/structs.td +++ b/mlir/unittests/TableGen/structs.td @@ -1,19 +1,10 @@ //===-- structs.td - StructsGen test definition file -------*- tablegen -*-===// // -// Copyright 2019 The MLIR Authors. +// Part of the MLIR 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 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ============================================================================= +//===----------------------------------------------------------------------===// include "mlir/IR/OpBase.td" diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py index 3bb4ffe4a4f..6dc40c797e2 100755 --- a/mlir/utils/generate-test-checks.py +++ b/mlir/utils/generate-test-checks.py @@ -17,19 +17,9 @@ adding checks to a test case fast, it is *not* designed to be authoritative about what constitutes a good test! """ -# Copyright 2019 The MLIR Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 import argparse import os # Used to advertise this file's name ("autogenerated_note"). diff --git a/mlir/utils/spirv/define_enum.sh b/mlir/utils/spirv/define_enum.sh index 9da898f7d4c..87b88c93133 100755 --- a/mlir/utils/spirv/define_enum.sh +++ b/mlir/utils/spirv/define_enum.sh @@ -1,18 +1,8 @@ #!/bin/bash -# Copyright 2019 The MLIR Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 # Script for defining a new enum attr using SPIR-V spec from the Internet. # diff --git a/mlir/utils/spirv/define_inst.sh b/mlir/utils/spirv/define_inst.sh index f11078a8e76..322c67e8da8 100755 --- a/mlir/utils/spirv/define_inst.sh +++ b/mlir/utils/spirv/define_inst.sh @@ -1,17 +1,7 @@ #!/bin/bash -# Copyright 2019 The MLIR Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 # Script for defining a new op using SPIR-V spec from the Internet. # diff --git a/mlir/utils/spirv/define_opcodes.sh b/mlir/utils/spirv/define_opcodes.sh index 05c36571115..7b9aeab9c08 100755 --- a/mlir/utils/spirv/define_opcodes.sh +++ b/mlir/utils/spirv/define_opcodes.sh @@ -1,18 +1,8 @@ #!/bin/bash -# Copyright 2019 The MLIR Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 # Script for defining map for opname to opcode using SPIR-V spec from the # Internet diff --git a/mlir/utils/spirv/gen_spirv_dialect.py b/mlir/utils/spirv/gen_spirv_dialect.py index be7116c211f..2433cf4e6da 100755 --- a/mlir/utils/spirv/gen_spirv_dialect.py +++ b/mlir/utils/spirv/gen_spirv_dialect.py @@ -1,19 +1,9 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2019 The MLIR Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 # Script for updating SPIR-V dialect by scraping information from SPIR-V # HTML and JSON specs from the Internet. -- cgit v1.2.3