CIRCT 20.0.0git
Loading...
Searching...
No Matches
FIRRTLVisitors.h
Go to the documentation of this file.
1//===- FIRRTLVisitors.h - FIRRTL Dialect Visitors ---------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines visitors that make it easier to work with FIRRTL IR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
14#define CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
15
17#include "mlir/IR/BuiltinOps.h"
18#include "llvm/ADT/TypeSwitch.h"
19
20namespace circt {
21namespace firrtl {
22
23/// ExprVisitor is a visitor for FIRRTL expression nodes.
24template <typename ConcreteType, typename ResultType = void,
25 typename... ExtraArgs>
27public:
28 ResultType dispatchExprVisitor(Operation *op, ExtraArgs... args) {
29 auto *thisCast = static_cast<ConcreteType *>(this);
30 return TypeSwitch<Operation *, ResultType>(op)
31 // Basic Expressions
32 .template Case<
33 ConstantOp, SpecialConstantOp, AggregateConstantOp, InvalidValueOp,
34 SubfieldOp, SubindexOp, SubaccessOp, IsTagOp, SubtagOp,
35 BundleCreateOp, VectorCreateOp, FEnumCreateOp, MultibitMuxOp,
36 TagExtractOp, OpenSubfieldOp, OpenSubindexOp, ObjectSubfieldOp,
37 ObjectAnyRefCastOp,
38 // Arithmetic and Logical Binary Primitives.
39 AddPrimOp, SubPrimOp, MulPrimOp, DivPrimOp, RemPrimOp, AndPrimOp,
40 OrPrimOp, XorPrimOp,
41 // Elementwise operations,
42 ElementwiseOrPrimOp, ElementwiseAndPrimOp, ElementwiseXorPrimOp,
43 // Comparisons.
44 LEQPrimOp, LTPrimOp, GEQPrimOp, GTPrimOp, EQPrimOp, NEQPrimOp,
45 // Misc Binary Primitives.
46 CatPrimOp, DShlPrimOp, DShlwPrimOp, DShrPrimOp,
47 // Unary operators.
48 AsSIntPrimOp, AsUIntPrimOp, AsAsyncResetPrimOp, AsClockPrimOp,
49 CvtPrimOp, NegPrimOp, NotPrimOp, AndRPrimOp, OrRPrimOp, XorRPrimOp,
50 // Intrinsic Expressions.
51 IsXIntrinsicOp, PlusArgsValueIntrinsicOp, PlusArgsTestIntrinsicOp,
52 SizeOfIntrinsicOp, ClockGateIntrinsicOp, ClockInverterIntrinsicOp,
53 ClockDividerIntrinsicOp, LTLAndIntrinsicOp, LTLOrIntrinsicOp,
54 LTLIntersectIntrinsicOp, LTLDelayIntrinsicOp, LTLConcatIntrinsicOp,
55 LTLRepeatIntrinsicOp, LTLGoToRepeatIntrinsicOp,
56 LTLNonConsecutiveRepeatIntrinsicOp, LTLNotIntrinsicOp,
57 LTLImplicationIntrinsicOp, LTLUntilIntrinsicOp,
58 LTLEventuallyIntrinsicOp, LTLClockIntrinsicOp, Mux2CellIntrinsicOp,
59 Mux4CellIntrinsicOp, HasBeenResetIntrinsicOp,
60 // Miscellaneous.
61 BitsPrimOp, HeadPrimOp, MuxPrimOp, PadPrimOp, ShlPrimOp, ShrPrimOp,
62 TailPrimOp, VerbatimExprOp, HWStructCastOp, BitCastOp, RefSendOp,
63 RefResolveOp, RefSubOp, RWProbeOp, XMRRefOp, XMRDerefOp,
64 // Casts to deal with weird stuff
65 UninferredResetCastOp, ConstCastOp, RefCastOp,
66 // Property expressions.
67 StringConstantOp, FIntegerConstantOp, BoolConstantOp,
68 DoubleConstantOp, ListCreateOp, ListConcatOp, UnresolvedPathOp,
69 PathOp, IntegerAddOp, IntegerMulOp, IntegerShrOp>(
70 [&](auto expr) -> ResultType {
71 return thisCast->visitExpr(expr, args...);
72 })
73 .Default([&](auto expr) -> ResultType {
74 return thisCast->visitInvalidExpr(op, args...);
75 });
76 }
77
78 /// This callback is invoked on any non-expression operations.
79 ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
80 op->emitOpError("unknown FIRRTL expression");
81 abort();
82 }
83
84 /// This callback is invoked on any expression operations that are not handled
85 /// by the concrete visitor.
86 ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
87 return ResultType();
88 }
89
90 /// This fallback is invoked on any unary expr that isn't explicitly handled.
91 /// The default implementation delegates to the unhandled expression fallback.
92 ResultType visitUnaryExpr(Operation *op, ExtraArgs... args) {
93 return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
94 }
95
96 /// This fallback is invoked on any binary expr that isn't explicitly handled.
97 /// The default implementation delegates to the unhandled expression fallback.
98 ResultType visitBinaryExpr(Operation *op, ExtraArgs... args) {
99 return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
100 }
101
102#define HANDLE(OPTYPE, OPKIND) \
103 ResultType visitExpr(OPTYPE op, ExtraArgs... args) { \
104 return static_cast<ConcreteType *>(this)->visit##OPKIND##Expr(op, \
105 args...); \
106 }
107
108 // Basic expressions.
109 HANDLE(ConstantOp, Unhandled);
110 HANDLE(SpecialConstantOp, Unhandled);
111 HANDLE(AggregateConstantOp, Unhandled);
112 HANDLE(BundleCreateOp, Unhandled);
113 HANDLE(VectorCreateOp, Unhandled);
114 HANDLE(FEnumCreateOp, Unhandled);
115 HANDLE(SubfieldOp, Unhandled);
116 HANDLE(SubindexOp, Unhandled);
117 HANDLE(SubaccessOp, Unhandled);
118 HANDLE(IsTagOp, Unhandled);
119 HANDLE(SubtagOp, Unhandled);
120 HANDLE(TagExtractOp, Unhandled);
121 HANDLE(MultibitMuxOp, Unhandled);
122 HANDLE(OpenSubfieldOp, Unhandled);
123 HANDLE(OpenSubindexOp, Unhandled);
124 HANDLE(ObjectSubfieldOp, Unhandled);
125 HANDLE(ObjectAnyRefCastOp, Unhandled);
126
127 // Arithmetic and Logical Binary Primitives.
128 HANDLE(AddPrimOp, Binary);
129 HANDLE(SubPrimOp, Binary);
130 HANDLE(MulPrimOp, Binary);
131 HANDLE(DivPrimOp, Binary);
132 HANDLE(RemPrimOp, Binary);
133 HANDLE(AndPrimOp, Binary);
134 HANDLE(OrPrimOp, Binary);
135 HANDLE(XorPrimOp, Binary);
136
137 // Comparisons.
138 HANDLE(LEQPrimOp, Binary);
139 HANDLE(LTPrimOp, Binary);
140 HANDLE(GEQPrimOp, Binary);
141 HANDLE(GTPrimOp, Binary);
142 HANDLE(EQPrimOp, Binary);
143 HANDLE(NEQPrimOp, Binary);
144
145 // Misc Binary Primitives.
146 HANDLE(CatPrimOp, Binary);
147 HANDLE(DShlPrimOp, Binary);
148 HANDLE(DShlwPrimOp, Binary);
149 HANDLE(DShrPrimOp, Binary);
150
151 // Unary operators.
152 HANDLE(AsSIntPrimOp, Unary);
153 HANDLE(AsUIntPrimOp, Unary);
154 HANDLE(AsAsyncResetPrimOp, Unary);
155 HANDLE(AsClockPrimOp, Unary);
156 HANDLE(CvtPrimOp, Unary);
157 HANDLE(NegPrimOp, Unary);
158 HANDLE(NotPrimOp, Unary);
159 HANDLE(AndRPrimOp, Unary);
160 HANDLE(OrRPrimOp, Unary);
161 HANDLE(XorRPrimOp, Unary);
162
163 HANDLE(ElementwiseOrPrimOp, Unhandled);
164 HANDLE(ElementwiseAndPrimOp, Unhandled);
165 HANDLE(ElementwiseXorPrimOp, Unhandled);
166
167 // Intrinsic Expr.
168 HANDLE(IsXIntrinsicOp, Unhandled);
169 HANDLE(PlusArgsValueIntrinsicOp, Unhandled);
170 HANDLE(PlusArgsTestIntrinsicOp, Unhandled);
171 HANDLE(SizeOfIntrinsicOp, Unhandled);
172 HANDLE(ClockGateIntrinsicOp, Unhandled);
173 HANDLE(ClockInverterIntrinsicOp, Unhandled);
174 HANDLE(ClockDividerIntrinsicOp, Unhandled);
175 HANDLE(LTLAndIntrinsicOp, Unhandled);
176 HANDLE(LTLOrIntrinsicOp, Unhandled);
177 HANDLE(LTLIntersectIntrinsicOp, Unhandled);
178 HANDLE(LTLDelayIntrinsicOp, Unhandled);
179 HANDLE(LTLConcatIntrinsicOp, Unhandled);
180 HANDLE(LTLRepeatIntrinsicOp, Unhandled);
181 HANDLE(LTLGoToRepeatIntrinsicOp, Unhandled);
182 HANDLE(LTLNonConsecutiveRepeatIntrinsicOp, Unhandled);
183 HANDLE(LTLNotIntrinsicOp, Unhandled);
184 HANDLE(LTLImplicationIntrinsicOp, Unhandled);
185 HANDLE(LTLUntilIntrinsicOp, Unhandled);
186 HANDLE(LTLEventuallyIntrinsicOp, Unhandled);
187 HANDLE(LTLClockIntrinsicOp, Unhandled);
188 HANDLE(Mux4CellIntrinsicOp, Unhandled);
189 HANDLE(Mux2CellIntrinsicOp, Unhandled);
190 HANDLE(HasBeenResetIntrinsicOp, Unhandled);
191
192 // Miscellaneous.
193 HANDLE(BitsPrimOp, Unhandled);
194 HANDLE(HeadPrimOp, Unhandled);
195 HANDLE(InvalidValueOp, Unhandled);
196 HANDLE(MuxPrimOp, Unhandled);
197 HANDLE(PadPrimOp, Unhandled);
198 HANDLE(ShlPrimOp, Unhandled);
199 HANDLE(ShrPrimOp, Unhandled);
200 HANDLE(TailPrimOp, Unhandled);
201 HANDLE(VerbatimExprOp, Unhandled);
202 HANDLE(RefSendOp, Unhandled);
203 HANDLE(RefResolveOp, Unhandled);
204 HANDLE(RefSubOp, Unhandled);
205 HANDLE(RWProbeOp, Unhandled);
206 HANDLE(XMRRefOp, Unhandled);
207 HANDLE(XMRDerefOp, Unhandled);
208
209 // Conversions.
210 HANDLE(HWStructCastOp, Unhandled);
211 HANDLE(UninferredResetCastOp, Unhandled);
212 HANDLE(ConstCastOp, Unhandled);
213 HANDLE(BitCastOp, Unhandled);
214 HANDLE(RefCastOp, Unhandled);
215
216 // Property expressions.
217 HANDLE(StringConstantOp, Unhandled);
218 HANDLE(FIntegerConstantOp, Unhandled);
219 HANDLE(BoolConstantOp, Unhandled);
220 HANDLE(DoubleConstantOp, Unhandled);
221 HANDLE(ListCreateOp, Unhandled);
222 HANDLE(ListConcatOp, Unhandled);
223 HANDLE(PathOp, Unhandled);
224 HANDLE(UnresolvedPathOp, Unhandled);
225 HANDLE(IntegerAddOp, Unhandled);
226 HANDLE(IntegerMulOp, Unhandled);
227 HANDLE(IntegerShrOp, Unhandled);
228#undef HANDLE
229};
230
231/// ExprVisitor is a visitor for FIRRTL statement nodes.
232template <typename ConcreteType, typename ResultType = void,
233 typename... ExtraArgs>
235public:
236 ResultType dispatchStmtVisitor(Operation *op, ExtraArgs... args) {
237 auto *thisCast = static_cast<ConcreteType *>(this);
238 return TypeSwitch<Operation *, ResultType>(op)
239 .template Case<
240 AttachOp, ConnectOp, MatchingConnectOp, RefDefineOp, ForceOp,
241 PrintFOp, SkipOp, StopOp, WhenOp, AssertOp, AssumeOp, CoverOp,
242 PropAssignOp, RefForceOp, RefForceInitialOp, RefReleaseOp,
243 RefReleaseInitialOp, FPGAProbeIntrinsicOp, VerifAssertIntrinsicOp,
244 VerifAssumeIntrinsicOp, UnclockedAssumeIntrinsicOp,
245 VerifCoverIntrinsicOp, LayerBlockOp, MatchOp, ViewIntrinsicOp>(
246 [&](auto opNode) -> ResultType {
247 return thisCast->visitStmt(opNode, args...);
248 })
249 .Default([&](auto expr) -> ResultType {
250 return thisCast->visitInvalidStmt(op, args...);
251 });
252 }
253
254 /// This callback is invoked on any non-Stmt operations.
255 ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
256 op->emitOpError("unknown firrtl stmt");
257 abort();
258 }
259
260 /// This callback is invoked on any Stmt operations that are not handled
261 /// by the concrete visitor.
262 ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
263 return ResultType();
264 }
265
266#define HANDLE(OPTYPE) \
267 ResultType visitStmt(OPTYPE op, ExtraArgs... args) { \
268 return static_cast<ConcreteType *>(this)->visitUnhandledStmt(op, args...); \
269 }
270
271 HANDLE(AttachOp);
272 HANDLE(ConnectOp);
273 HANDLE(MatchingConnectOp);
274 HANDLE(RefDefineOp);
275 HANDLE(ForceOp);
276 HANDLE(PrintFOp);
277 HANDLE(SkipOp);
278 HANDLE(StopOp);
279 HANDLE(WhenOp);
280 HANDLE(AssertOp);
281 HANDLE(AssumeOp);
282 HANDLE(CoverOp);
283 HANDLE(PropAssignOp);
284 HANDLE(RefForceOp);
285 HANDLE(RefForceInitialOp);
286 HANDLE(RefReleaseOp);
287 HANDLE(RefReleaseInitialOp);
288 HANDLE(FPGAProbeIntrinsicOp);
289 HANDLE(VerifAssertIntrinsicOp);
290 HANDLE(VerifAssumeIntrinsicOp);
291 HANDLE(VerifCoverIntrinsicOp);
292 HANDLE(UnclockedAssumeIntrinsicOp);
293 HANDLE(LayerBlockOp);
294 HANDLE(MatchOp);
295 HANDLE(ViewIntrinsicOp);
296
297#undef HANDLE
298};
299
300/// ExprVisitor is a visitor for FIRRTL declaration nodes.
301template <typename ConcreteType, typename ResultType = void,
302 typename... ExtraArgs>
304public:
305 ResultType dispatchDeclVisitor(Operation *op, ExtraArgs... args) {
306 auto *thisCast = static_cast<ConcreteType *>(this);
307 return TypeSwitch<Operation *, ResultType>(op)
308 .template Case<InstanceOp, InstanceChoiceOp, ObjectOp, MemOp, NodeOp,
309 RegOp, RegResetOp, WireOp, VerbatimWireOp>(
310 [&](auto opNode) -> ResultType {
311 return thisCast->visitDecl(opNode, args...);
312 })
313 .Default([&](auto expr) -> ResultType {
314 return thisCast->visitInvalidDecl(op, args...);
315 });
316 }
317
318 /// This callback is invoked on any non-Decl operations.
319 ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
320 op->emitOpError("unknown firrtl decl");
321 abort();
322 }
323
324 /// This callback is invoked on any Decl operations that are not handled
325 /// by the concrete visitor.
326 ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
327 return ResultType();
328 }
329
330#define HANDLE(OPTYPE) \
331 ResultType visitDecl(OPTYPE op, ExtraArgs... args) { \
332 return static_cast<ConcreteType *>(this)->visitUnhandledDecl(op, args...); \
333 }
334
335 HANDLE(InstanceOp);
336 HANDLE(InstanceChoiceOp);
337 HANDLE(ObjectOp);
338 HANDLE(MemOp);
339 HANDLE(NodeOp);
340 HANDLE(RegOp);
341 HANDLE(RegResetOp);
342 HANDLE(WireOp);
343 HANDLE(VerbatimWireOp);
344#undef HANDLE
345};
346
347/// StmtExprVisitor is a visitor for FIRRTL operation that has an optional
348/// result.
349template <typename ConcreteType, typename ResultType = void,
350 typename... ExtraArgs>
352public:
353 ResultType dispatchStmtExprVisitor(Operation *op, ExtraArgs... args) {
354 auto *thisCast = static_cast<ConcreteType *>(this);
355 return TypeSwitch<Operation *, ResultType>(op)
356 .template Case<GenericIntrinsicOp, DPICallIntrinsicOp>(
357 [&](auto expr) -> ResultType {
358 return thisCast->visitStmtExpr(expr, args...);
359 })
360 .Default([&](auto expr) -> ResultType {
361 return thisCast->visitInvalidStmtExpr(op, args...);
362 });
363 }
364
365 /// This callback is invoked on any non-StmtExpr operations.
366 ResultType visitInvalidStmtExpr(Operation *op, ExtraArgs... args) {
367 op->emitOpError("unknown FIRRTL stmt expression");
368 abort();
369 }
370
371 /// This callback is invoked on any StmtExpr operations that are not handled
372 /// by the concrete visitor.
373 ResultType visitUnhandledStmtExpr(Operation *op, ExtraArgs... args) {
374 return ResultType();
375 }
376
377#define HANDLE(OPTYPE, OPKIND) \
378 ResultType visitStmtExpr(OPTYPE op, ExtraArgs... args) { \
379 return static_cast<ConcreteType *>(this)->visit##OPKIND##StmtExpr( \
380 op, args...); \
381 }
382
383 // Statement expressions.
384 HANDLE(DPICallIntrinsicOp, Unhandled);
385 HANDLE(GenericIntrinsicOp, Unhandled);
386#undef HANDLE
387};
388
389/// FIRRTLVisitor allows you to visit all of the expr/stmt/decls with one class
390/// declaration.
391///
392/// Clients call dispatchVisitor to invoke the dispatch, and may implement
393/// visitInvalidOp() to get notified about non-FIRRTL dialect nodes and
394/// visitUnhandledOp() to get notified about FIRRTL dialect ops that are not
395/// handled specifically.
396template <typename ConcreteType, typename ResultType = void,
397 typename... ExtraArgs>
399 : public ExprVisitor<ConcreteType, ResultType, ExtraArgs...>,
400 public StmtVisitor<ConcreteType, ResultType, ExtraArgs...>,
401 public DeclVisitor<ConcreteType, ResultType, ExtraArgs...>,
402 public StmtExprVisitor<ConcreteType, ResultType, ExtraArgs...> {
403public:
404 /// This is the main entrypoint for the FIRRTLVisitor.
405 ResultType dispatchVisitor(Operation *op, ExtraArgs... args) {
406 return this->dispatchExprVisitor(op, args...);
407 }
408
409 // Chain from each visitor onto the next one.
410 ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
411 return this->dispatchStmtVisitor(op, args...);
412 }
413 ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
414 return this->dispatchDeclVisitor(op, args...);
415 }
416 ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
417 return this->dispatchStmtExprVisitor(op, args...);
418 }
419 ResultType visitInvalidStmtExpr(Operation *op, ExtraArgs... args) {
420 return static_cast<ConcreteType *>(this)->visitInvalidOp(op, args...);
421 }
422
423 // Default to chaining visitUnhandledXXX to visitUnhandledOp.
424 ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
425 return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
426 }
427 ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
428 return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
429 }
430 ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
431 return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
432 }
433 ResultType visitUnhandledStmtExpr(Operation *op, ExtraArgs... args) {
434 return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
435 }
436
437 /// visitInvalidOp is an override point for non-FIRRTL dialect operations.
438 ResultType visitInvalidOp(Operation *op, ExtraArgs... args) {
439 return ResultType();
440 }
441
442 /// visitUnhandledOp is an override point for FIRRTL dialect ops that the
443 /// concrete visitor didn't bother to implement.
444 ResultType visitUnhandledOp(Operation *op, ExtraArgs... args) {
445 return ResultType();
446 }
447};
448} // namespace firrtl
449} // namespace circt
450
451#endif // CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
ExprVisitor is a visitor for FIRRTL declaration nodes.
ResultType dispatchDeclVisitor(Operation *op, ExtraArgs... args)
HANDLE(InstanceChoiceOp)
ResultType visitInvalidDecl(Operation *op, ExtraArgs... args)
This callback is invoked on any non-Decl operations.
ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args)
This callback is invoked on any Decl operations that are not handled by the concrete visitor.
ExprVisitor is a visitor for FIRRTL expression nodes.
HANDLE(ListCreateOp, Unhandled)
HANDLE(LTLUntilIntrinsicOp, Unhandled)
HANDLE(DoubleConstantOp, Unhandled)
HANDLE(LTLNotIntrinsicOp, Unhandled)
HANDLE(PadPrimOp, Unhandled)
HANDLE(SubPrimOp, Binary)
HANDLE(ElementwiseXorPrimOp, Unhandled)
HANDLE(ClockDividerIntrinsicOp, Unhandled)
HANDLE(AddPrimOp, Binary)
HANDLE(BitsPrimOp, Unhandled)
HANDLE(RWProbeOp, Unhandled)
HANDLE(LTLAndIntrinsicOp, Unhandled)
HANDLE(OpenSubfieldOp, Unhandled)
HANDLE(BoolConstantOp, Unhandled)
HANDLE(AndRPrimOp, Unary)
HANDLE(HeadPrimOp, Unhandled)
HANDLE(LTPrimOp, Binary)
HANDLE(ClockInverterIntrinsicOp, Unhandled)
HANDLE(LTLGoToRepeatIntrinsicOp, Unhandled)
HANDLE(LTLNonConsecutiveRepeatIntrinsicOp, Unhandled)
HANDLE(BitCastOp, Unhandled)
HANDLE(SubindexOp, Unhandled)
HANDLE(HasBeenResetIntrinsicOp, Unhandled)
HANDLE(SubfieldOp, Unhandled)
HANDLE(DShrPrimOp, Binary)
HANDLE(AsUIntPrimOp, Unary)
HANDLE(LTLDelayIntrinsicOp, Unhandled)
HANDLE(RefCastOp, Unhandled)
HANDLE(ElementwiseOrPrimOp, Unhandled)
HANDLE(MultibitMuxOp, Unhandled)
HANDLE(XorRPrimOp, Unary)
HANDLE(ConstCastOp, Unhandled)
HANDLE(Mux4CellIntrinsicOp, Unhandled)
HANDLE(StringConstantOp, Unhandled)
HANDLE(LTLConcatIntrinsicOp, Unhandled)
HANDLE(TagExtractOp, Unhandled)
HANDLE(UninferredResetCastOp, Unhandled)
HANDLE(XorPrimOp, Binary)
HANDLE(MulPrimOp, Binary)
HANDLE(LTLImplicationIntrinsicOp, Unhandled)
HANDLE(ListConcatOp, Unhandled)
ResultType visitInvalidExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any non-expression operations.
HANDLE(OrPrimOp, Binary)
ResultType dispatchExprVisitor(Operation *op, ExtraArgs... args)
HANDLE(RefSubOp, Unhandled)
HANDLE(ObjectAnyRefCastOp, Unhandled)
HANDLE(LTLIntersectIntrinsicOp, Unhandled)
HANDLE(RemPrimOp, Binary)
HANDLE(IntegerShrOp, Unhandled)
HANDLE(Mux2CellIntrinsicOp, Unhandled)
HANDLE(MuxPrimOp, Unhandled)
HANDLE(BundleCreateOp, Unhandled)
HANDLE(PlusArgsTestIntrinsicOp, Unhandled)
HANDLE(FEnumCreateOp, Unhandled)
HANDLE(RefSendOp, Unhandled)
HANDLE(XMRDerefOp, Unhandled)
HANDLE(ShrPrimOp, Unhandled)
HANDLE(IntegerAddOp, Unhandled)
HANDLE(UnresolvedPathOp, Unhandled)
HANDLE(PlusArgsValueIntrinsicOp, Unhandled)
HANDLE(LTLOrIntrinsicOp, Unhandled)
HANDLE(LTLRepeatIntrinsicOp, Unhandled)
HANDLE(CatPrimOp, Binary)
HANDLE(FIntegerConstantOp, Unhandled)
HANDLE(HWStructCastOp, Unhandled)
HANDLE(ClockGateIntrinsicOp, Unhandled)
HANDLE(OpenSubindexOp, Unhandled)
HANDLE(ObjectSubfieldOp, Unhandled)
HANDLE(InvalidValueOp, Unhandled)
HANDLE(SubaccessOp, Unhandled)
HANDLE(DShlPrimOp, Binary)
HANDLE(ShlPrimOp, Unhandled)
HANDLE(IsXIntrinsicOp, Unhandled)
HANDLE(RefResolveOp, Unhandled)
HANDLE(NotPrimOp, Unary)
HANDLE(XMRRefOp, Unhandled)
HANDLE(TailPrimOp, Unhandled)
HANDLE(IntegerMulOp, Unhandled)
HANDLE(GTPrimOp, Binary)
HANDLE(LTLClockIntrinsicOp, Unhandled)
HANDLE(GEQPrimOp, Binary)
HANDLE(ElementwiseAndPrimOp, Unhandled)
HANDLE(CvtPrimOp, Unary)
ResultType visitUnaryExpr(Operation *op, ExtraArgs... args)
This fallback is invoked on any unary expr that isn't explicitly handled.
HANDLE(SizeOfIntrinsicOp, Unhandled)
ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any expression operations that are not handled by the concrete visitor.
HANDLE(NegPrimOp, Unary)
HANDLE(LEQPrimOp, Binary)
HANDLE(ConstantOp, Unhandled)
HANDLE(AsAsyncResetPrimOp, Unary)
HANDLE(DShlwPrimOp, Binary)
ResultType visitBinaryExpr(Operation *op, ExtraArgs... args)
This fallback is invoked on any binary expr that isn't explicitly handled.
HANDLE(OrRPrimOp, Unary)
HANDLE(AggregateConstantOp, Unhandled)
HANDLE(AndPrimOp, Binary)
HANDLE(AsClockPrimOp, Unary)
HANDLE(SpecialConstantOp, Unhandled)
HANDLE(VectorCreateOp, Unhandled)
HANDLE(LTLEventuallyIntrinsicOp, Unhandled)
HANDLE(DivPrimOp, Binary)
HANDLE(EQPrimOp, Binary)
HANDLE(NEQPrimOp, Binary)
HANDLE(SubtagOp, Unhandled)
HANDLE(VerbatimExprOp, Unhandled)
HANDLE(IsTagOp, Unhandled)
HANDLE(AsSIntPrimOp, Unary)
HANDLE(PathOp, Unhandled)
FIRRTLVisitor allows you to visit all of the expr/stmt/decls with one class declaration.
ResultType dispatchVisitor(Operation *op, ExtraArgs... args)
This is the main entrypoint for the FIRRTLVisitor.
ResultType visitInvalidOp(Operation *op, ExtraArgs... args)
visitInvalidOp is an override point for non-FIRRTL dialect operations.
ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args)
ResultType visitUnhandledOp(Operation *op, ExtraArgs... args)
visitUnhandledOp is an override point for FIRRTL dialect ops that the concrete visitor didn't bother ...
ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args)
ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args)
ResultType visitUnhandledStmtExpr(Operation *op, ExtraArgs... args)
ResultType visitInvalidDecl(Operation *op, ExtraArgs... args)
ResultType visitInvalidExpr(Operation *op, ExtraArgs... args)
ResultType visitInvalidStmtExpr(Operation *op, ExtraArgs... args)
ResultType visitInvalidStmt(Operation *op, ExtraArgs... args)
StmtExprVisitor is a visitor for FIRRTL operation that has an optional result.
HANDLE(DPICallIntrinsicOp, Unhandled)
ResultType visitUnhandledStmtExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any StmtExpr operations that are not handled by the concrete visitor.
ResultType visitInvalidStmtExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any non-StmtExpr operations.
HANDLE(GenericIntrinsicOp, Unhandled)
ResultType dispatchStmtExprVisitor(Operation *op, ExtraArgs... args)
ExprVisitor is a visitor for FIRRTL statement nodes.
HANDLE(VerifCoverIntrinsicOp)
HANDLE(RefForceInitialOp)
ResultType dispatchStmtVisitor(Operation *op, ExtraArgs... args)
HANDLE(UnclockedAssumeIntrinsicOp)
HANDLE(VerifAssertIntrinsicOp)
ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args)
This callback is invoked on any Stmt operations that are not handled by the concrete visitor.
HANDLE(RefReleaseInitialOp)
HANDLE(FPGAProbeIntrinsicOp)
HANDLE(MatchingConnectOp)
ResultType visitInvalidStmt(Operation *op, ExtraArgs... args)
This callback is invoked on any non-Stmt operations.
HANDLE(ViewIntrinsicOp)
HANDLE(VerifAssumeIntrinsicOp)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.