Skip to content

Commit a452617

Browse files
Refactoring QEC Tablegen into QECOps and QECDialect (#2253)
1 parent 5df6cb8 commit a452617

33 files changed

+933
-859
lines changed

doc/releases/changelog-dev.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@
317317
[(#2245)](https://github.com/PennyLaneAI/catalyst/pull/2245)
318318
[(#2254)](https://github.com/PennyLaneAI/catalyst/pull/2254)
319319

320+
321+
* Refactor QEC tablegen files to separate QEC operations into a new `QECOp.td` file
322+
[(#2253](https://github.com/PennyLaneAI/catalyst/pull/2253)
323+
324+
320325
<h3>Documentation 📝</h3>
321326

322327
* A typo in the code example for :func:`~.passes.ppr_to_ppm` has been corrected.

mlir/include/QEC/IR/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
add_mlir_dialect(QECDialect qec)
1+
add_mlir_dialect(QECOps qec)
22
add_mlir_interface(QECOpInterfaces)
3-
add_mlir_doc(QECDialect QECDialect QEC/ -gen-dialect-doc -gen-op-doc)
3+
add_mlir_doc(QECDialect QECDialect QEC/ -gen-dialect-doc -dialect qec)
4+
add_mlir_doc(QECOps QECOps QEC/ -gen-op-doc)
45
add_mlir_doc(QECOpInterfaces QECOpInterfaces QEC/ -gen-op-interface-docs)
56

6-
set(LLVM_TARGET_DEFINITIONS QECDialect.td)
7+
set(LLVM_TARGET_DEFINITIONS QECOps.td)
78
mlir_tablegen(QECEnums.h.inc -gen-enum-decls)
89
mlir_tablegen(QECEnums.cpp.inc -gen-enum-defs)
910
mlir_tablegen(QECAttributes.h.inc -gen-attrdef-decls)

mlir/include/QEC/IR/QECDialect.h

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,23 @@
1414

1515
#pragma once
1616

17-
#include "mlir/Bytecode/BytecodeOpInterface.h"
18-
#include "mlir/IR/BuiltinTypes.h"
1917
#include "mlir/IR/Dialect.h"
20-
#include "mlir/IR/OpDefinition.h"
21-
#include "mlir/IR/PatternMatch.h"
22-
#include "mlir/Interfaces/ControlFlowInterfaces.h"
23-
#include "mlir/Interfaces/SideEffectInterfaces.h"
24-
25-
#include "QEC/IR/QECOpInterfaces.h"
2618

2719
//===----------------------------------------------------------------------===//
2820
// QEC dialect declarations.
2921
//===----------------------------------------------------------------------===//
3022

31-
#include "QEC/IR/QECDialectDialect.h.inc"
23+
#include "QEC/IR/QECOpsDialect.h.inc"
3224

3325
//===----------------------------------------------------------------------===//
3426
// QEC type declarations.
3527
//===----------------------------------------------------------------------===//
3628

3729
#define GET_TYPEDEF_CLASSES
38-
#include "QEC/IR/QECDialectTypes.h.inc"
30+
#include "QEC/IR/QECOpsTypes.h.inc"
3931

4032
//===----------------------------------------------------------------------===//
41-
// QEC enum definitions.
33+
// QEC enum declarations.
4234
//===----------------------------------------------------------------------===//
4335

4436
#include "QEC/IR/QECEnums.h.inc"
@@ -49,10 +41,3 @@
4941

5042
#define GET_ATTRDEF_CLASSES
5143
#include "QEC/IR/QECAttributes.h.inc"
52-
53-
//===----------------------------------------------------------------------===//
54-
// QEC ops declarations.
55-
//===----------------------------------------------------------------------===//
56-
57-
#define GET_OP_CLASSES
58-
#include "QEC/IR/QECDialect.h.inc"

0 commit comments

Comments
 (0)