-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][polynomial] split polynomial types tablegen (#92805)
Similar to #92613, but for types. Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
mlir/include/mlir/Dialect/Polynomial/IR/PolynomialTypes.td
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//===- PolynomialTypes.td - Polynomial types ---------------*- tablegen -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef POLYNOMIAL_TYPES | ||
#define POLYNOMIAL_TYPES | ||
|
||
include "mlir/Dialect/Polynomial/IR/PolynomialAttributes.td" | ||
include "mlir/Dialect/Polynomial/IR/PolynomialDialect.td" | ||
|
||
class Polynomial_Type<string name, string typeMnemonic> | ||
: TypeDef<Polynomial_Dialect, name> { | ||
let mnemonic = typeMnemonic; | ||
} | ||
|
||
def Polynomial_PolynomialType : Polynomial_Type<"Polynomial", "polynomial"> { | ||
let summary = "An element of a polynomial ring."; | ||
let description = [{ | ||
A type for polynomials in a polynomial quotient ring. | ||
}]; | ||
let parameters = (ins Polynomial_RingAttr:$ring); | ||
let assemblyFormat = "`<` struct(params) `>`"; | ||
} | ||
|
||
def PolynomialLike: TypeOrContainer<Polynomial_PolynomialType, "polynomial-like">; | ||
|
||
|
||
#endif // POLYNOMIAL_TYPES |