Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/aster/Dialect/AMDGCN/IR/AMDGCNAttrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#include "aster/Dialect/AMDGCN/IR/Hazards.h"
#include "aster/Dialect/AMDGCN/IR/Interfaces/KernelArgInterface.h"
#include "aster/Dialect/AMDGCN/IR/Sched.h"
#include "aster/Dialect/NormalForm/IR/NormalFormInterfaces.h"
#include "aster/Interfaces/MemorySpaceConstraints.h"
#include "aster/Interfaces/SchedInterfaces.h"
#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
#include "mlir/Dialect/Transform/Utils/DiagnosedSilenceableFailure.h"
#include "mlir/IR/Attributes.h"

namespace mlir {
Expand Down
43 changes: 30 additions & 13 deletions include/aster/Dialect/AMDGCN/IR/AMDGCNAttrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@ include "aster/Dialect/AMDGCN/IR/AMDGCNEnums.td"
include "aster/Dialect/AMDGCN/IR/Interfaces/KernelArgInterface.td"
include "aster/Dialect/AMDGCN/IR/Interfaces/HazardAttrInterface.td"
include "aster/Dialect/AMDGCN/IR/Hazards.td"
include "aster/Dialect/NormalForm/IR/NormalFormInterfaces.td"
include "aster/Interfaces/MemorySpaceConstraints.td"
include "aster/Interfaces/SchedInterfaces.td"
include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.td"
include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.td"
include "mlir/IR/AttrTypeBase.td"
include "mlir/IR/CommonAttrConstraints.td"

//===----------------------------------------------------------------------===//
// Normal form attribute array constraints.
//===----------------------------------------------------------------------===//

/// An array of attributes implementing `mlir::transform::NormalFormAttrInterface`.
def NormalFormAttrArray : TypedArrayAttrBase<NormalFormAttrInterface,
"array of NormalFormAttrInterface">;

/// Optional normal form array: omitted when empty, prints in attr-dict.
def OptionalNormalFormAttrArray
: DefaultValuedAttr<NormalFormAttrArray, "::ArrayRef<Attribute>()"> {
let constBuilderCall = "$_builder.getArrayAttr($0)";
let isOptional = true;
}

//===----------------------------------------------------------------------===//
// AddressSpaceAttr
Expand Down Expand Up @@ -372,7 +389,7 @@ def KernelArgumentsAttr

def NoValueSemanticRegistersAttr : AMDGCN_Attr<
"NoValueSemanticRegisters", "no_value_semantic_registers",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyType"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no register types with value semantics";
let description = [{
Verifies that no register types in the IR have value semantics.
Expand All @@ -386,7 +403,7 @@ def NoValueSemanticRegistersAttr : AMDGCN_Attr<

def AllRegistersAllocatedAttr : AMDGCN_Attr<
"AllRegistersAllocated", "all_registers_allocated",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyType"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: all register types have allocated semantics";
let description = [{
Verifies that every register type in the IR has allocated semantics
Expand All @@ -400,7 +417,7 @@ def AllRegistersAllocatedAttr : AMDGCN_Attr<

def NoRegCastOpsAttr : AMDGCN_Attr<
"NoRegCastOps", "no_reg_cast_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no lsir.reg_cast operations";
let description = [{
Verifies that no `lsir.reg_cast` operations exist in the IR.
Expand All @@ -414,7 +431,7 @@ def NoRegCastOpsAttr : AMDGCN_Attr<

def NoCfBranchesAttr : AMDGCN_Attr<
"NoCfBranches", "no_cf_branches",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no CF dialect branch operations";
let description = [{
Verifies that no `cf.br` or `cf.cond_br` operations exist in the IR.
Expand All @@ -426,7 +443,7 @@ def NoCfBranchesAttr : AMDGCN_Attr<

def NoScfOpsAttr : AMDGCN_Attr<
"NoScfOps", "no_scf_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no SCF dialect operations";
let description = [{
Verifies that no SCF dialect operations (`scf.for`, `scf.if`, `scf.while`,
Expand All @@ -438,7 +455,7 @@ def NoScfOpsAttr : AMDGCN_Attr<

def NoLsirOpsAttr : AMDGCN_Attr<
"NoLsirOps", "no_lsir_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no LSIR dialect operations";
let description = [{
Verifies that no LSIR dialect operations exist in the IR.
Expand All @@ -450,7 +467,7 @@ def NoLsirOpsAttr : AMDGCN_Attr<

def NoLsirComputeOpsAttr : AMDGCN_Attr<
"NoLsirComputeOps", "no_lsir_compute_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no LSIR compute/memory operations";
let description = [{
Verifies that no LSIR arithmetic, memory, or utility operations exist in
Expand All @@ -469,7 +486,7 @@ def NoLsirComputeOpsAttr : AMDGCN_Attr<

def NoLsirControlOpsAttr : AMDGCN_Attr<
"NoLsirControlOps", "no_lsir_control_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no LSIR control-flow operations";
let description = [{
Verifies that no LSIR control-flow-related operations (`lsir.cmpi`,
Expand All @@ -485,7 +502,7 @@ def NoLsirControlOpsAttr : AMDGCN_Attr<

def NoRegisterBlockArgsAttr : AMDGCN_Attr<
"NoRegisterBlockArgs", "no_register_block_args",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no block arguments with register types";
let description = [{
Verifies that no block arguments have register types
Expand All @@ -497,7 +514,7 @@ def NoRegisterBlockArgsAttr : AMDGCN_Attr<

def NoAffineOpsAttr : AMDGCN_Attr<
"NoAffineOps", "no_affine_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no affine dialect operations";
let description = [{
Verifies that no affine dialect operations (`affine.apply`, `affine.for`,
Expand All @@ -509,7 +526,7 @@ def NoAffineOpsAttr : AMDGCN_Attr<

def NoMetadataOpsAttr : AMDGCN_Attr<
"NoMetadataOps", "no_metadata_ops",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: no AMDGCN metadata operations";
let description = [{
Verifies that no AMDGCN metadata operations remain in the IR.
Expand All @@ -523,7 +540,7 @@ def NoMetadataOpsAttr : AMDGCN_Attr<

def AllInlinedAttr : AMDGCN_Attr<
"AllInlined", "all_inlined",
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["verifyOperation"]>]> {
[DeclareAttrInterfaceMethods<NormalFormAttrInterface, ["checkOperation"]>]> {
let summary = "Normal form: all function calls inlined";
let description = [{
Verifies that no `func.call` operations exist in the IR.
Expand Down
8 changes: 4 additions & 4 deletions include/aster/Dialect/AMDGCN/IR/AMDGCNOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,11 @@ def AMDGCN_KernelOp : AMDGCN_Op<"kernel", [

/// Adds normal form attributes. Returns true if the op was changed.
bool addNormalForms(
::llvm::ArrayRef<::normalform::NormalFormAttrInterface> normalForms);
::llvm::ArrayRef<::mlir::transform::NormalFormAttrInterface> normalForms);

/// Removes normal form attributes. Returns true if the op was changed.
bool removeNormalForms(
::llvm::ArrayRef<::normalform::NormalFormAttrInterface> normalForms);
::llvm::ArrayRef<::mlir::transform::NormalFormAttrInterface> normalForms);
}];
}

Expand Down Expand Up @@ -572,11 +572,11 @@ def AMDGCN_ModuleOp : AMDGCN_Op<"module", [

/// Adds normal form attributes. Returns true if the op was changed.
bool addNormalForms(
::llvm::ArrayRef<::normalform::NormalFormAttrInterface> normalForms);
::llvm::ArrayRef<::mlir::transform::NormalFormAttrInterface> normalForms);

/// Removes normal form attributes. Returns true if the op was changed.
bool removeNormalForms(
::llvm::ArrayRef<::normalform::NormalFormAttrInterface> normalForms);
::llvm::ArrayRef<::mlir::transform::NormalFormAttrInterface> normalForms);
}];
}

Expand Down
1 change: 0 additions & 1 deletion include/aster/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ add_subdirectory(AMDGCN)
add_subdirectory(AsterUtils)
add_subdirectory(Layout)
add_subdirectory(LSIR)
add_subdirectory(NormalForm)
2 changes: 0 additions & 2 deletions include/aster/Dialect/NormalForm/CMakeLists.txt

This file was deleted.

23 changes: 0 additions & 23 deletions include/aster/Dialect/NormalForm/IR/CMakeLists.txt

This file was deleted.

18 changes: 0 additions & 18 deletions include/aster/Dialect/NormalForm/IR/NormalFormDialect.h

This file was deleted.

28 changes: 0 additions & 28 deletions include/aster/Dialect/NormalForm/IR/NormalFormDialect.td

This file was deleted.

48 changes: 0 additions & 48 deletions include/aster/Dialect/NormalForm/IR/NormalFormInterfaces.h

This file was deleted.

92 changes: 0 additions & 92 deletions include/aster/Dialect/NormalForm/IR/NormalFormInterfaces.td

This file was deleted.

Loading