@@ -87,9 +87,9 @@ class AbstractDenseForwardDataFlowAnalysis : public DataFlowAnalysis {
87
87
protected:
88
88
// / Propagate the dense lattice before the execution of an operation to the
89
89
// / lattice after its execution.
90
- virtual void visitOperationImpl (Operation *op,
91
- const AbstractDenseLattice &before,
92
- AbstractDenseLattice *after) = 0;
90
+ virtual LogicalResult visitOperationImpl (Operation *op,
91
+ const AbstractDenseLattice &before,
92
+ AbstractDenseLattice *after) = 0;
93
93
94
94
// / Get the dense lattice after the execution of the given program point.
95
95
virtual AbstractDenseLattice *getLattice (ProgramPoint point) = 0;
@@ -114,7 +114,7 @@ class AbstractDenseForwardDataFlowAnalysis : public DataFlowAnalysis {
114
114
// / operation, then the state after the execution of the operation is set by
115
115
// / control-flow or the callgraph. Otherwise, this function invokes the
116
116
// / operation transfer function.
117
- virtual void processOperation (Operation *op);
117
+ virtual LogicalResult processOperation (Operation *op);
118
118
119
119
// / Propagate the dense lattice forward along the control flow edge from
120
120
// / `regionFrom` to `regionTo` regions of the `branch` operation. `nullopt`
@@ -191,8 +191,8 @@ class DenseForwardDataFlowAnalysis
191
191
// / Visit an operation with the dense lattice before its execution. This
192
192
// / function is expected to set the dense lattice after its execution and
193
193
// / trigger change propagation in case of change.
194
- virtual void visitOperation (Operation *op, const LatticeT &before,
195
- LatticeT *after) = 0;
194
+ virtual LogicalResult visitOperation (Operation *op, const LatticeT &before,
195
+ LatticeT *after) = 0;
196
196
197
197
// / Hook for customizing the behavior of lattice propagation along the call
198
198
// / control flow edges. Two types of (forward) propagation are possible here:
@@ -263,10 +263,11 @@ class DenseForwardDataFlowAnalysis
263
263
264
264
// / Type-erased wrappers that convert the abstract dense lattice to a derived
265
265
// / lattice and invoke the virtual hooks operating on the derived lattice.
266
- void visitOperationImpl (Operation *op, const AbstractDenseLattice &before,
267
- AbstractDenseLattice *after) final {
268
- visitOperation (op, static_cast <const LatticeT &>(before),
269
- static_cast <LatticeT *>(after));
266
+ LogicalResult visitOperationImpl (Operation *op,
267
+ const AbstractDenseLattice &before,
268
+ AbstractDenseLattice *after) final {
269
+ return visitOperation (op, static_cast <const LatticeT &>(before),
270
+ static_cast <LatticeT *>(after));
270
271
}
271
272
void visitCallControlFlowTransfer (CallOpInterface call,
272
273
CallControlFlowAction action,
@@ -326,9 +327,9 @@ class AbstractDenseBackwardDataFlowAnalysis : public DataFlowAnalysis {
326
327
protected:
327
328
// / Propagate the dense lattice after the execution of an operation to the
328
329
// / lattice before its execution.
329
- virtual void visitOperationImpl (Operation *op,
330
- const AbstractDenseLattice &after,
331
- AbstractDenseLattice *before) = 0;
330
+ virtual LogicalResult visitOperationImpl (Operation *op,
331
+ const AbstractDenseLattice &after,
332
+ AbstractDenseLattice *before) = 0;
332
333
333
334
// / Get the dense lattice before the execution of the program point. That is,
334
335
// / before the execution of the given operation or after the execution of the
@@ -353,7 +354,7 @@ class AbstractDenseBackwardDataFlowAnalysis : public DataFlowAnalysis {
353
354
// / Visit an operation. Dispatches to specialized methods for call or region
354
355
// / control-flow operations. Otherwise, this function invokes the operation
355
356
// / transfer function.
356
- virtual void processOperation (Operation *op);
357
+ virtual LogicalResult processOperation (Operation *op);
357
358
358
359
// / Propagate the dense lattice backwards along the control flow edge from
359
360
// / `regionFrom` to `regionTo` regions of the `branch` operation. `nullopt`
@@ -442,8 +443,8 @@ class DenseBackwardDataFlowAnalysis
442
443
// / Transfer function. Visits an operation with the dense lattice after its
443
444
// / execution. This function is expected to set the dense lattice before its
444
445
// / execution and trigger propagation in case of change.
445
- virtual void visitOperation (Operation *op, const LatticeT &after,
446
- LatticeT *before) = 0;
446
+ virtual LogicalResult visitOperation (Operation *op, const LatticeT &after,
447
+ LatticeT *before) = 0;
447
448
448
449
// / Hook for customizing the behavior of lattice propagation along the call
449
450
// / control flow edges. Two types of (back) propagation are possible here:
@@ -513,10 +514,11 @@ class DenseBackwardDataFlowAnalysis
513
514
514
515
// / Type-erased wrappers that convert the abstract dense lattice to a derived
515
516
// / lattice and invoke the virtual hooks operating on the derived lattice.
516
- void visitOperationImpl (Operation *op, const AbstractDenseLattice &after,
517
- AbstractDenseLattice *before) final {
518
- visitOperation (op, static_cast <const LatticeT &>(after),
519
- static_cast <LatticeT *>(before));
517
+ LogicalResult visitOperationImpl (Operation *op,
518
+ const AbstractDenseLattice &after,
519
+ AbstractDenseLattice *before) final {
520
+ return visitOperation (op, static_cast <const LatticeT &>(after),
521
+ static_cast <LatticeT *>(before));
520
522
}
521
523
void visitCallControlFlowTransfer (CallOpInterface call,
522
524
CallControlFlowAction action,
0 commit comments