@@ -26,7 +26,7 @@ using namespace mlir;
26
26
27
27
static void
28
28
getForwardSliceImpl (Operation *op, SetVector<Operation *> *forwardSlice,
29
- SliceOptions::TransitiveFilter filter = nullptr ) {
29
+ const SliceOptions::TransitiveFilter & filter = nullptr ) {
30
30
if (!op)
31
31
return ;
32
32
@@ -51,7 +51,7 @@ getForwardSliceImpl(Operation *op, SetVector<Operation *> *forwardSlice,
51
51
}
52
52
53
53
void mlir::getForwardSlice (Operation *op, SetVector<Operation *> *forwardSlice,
54
- ForwardSliceOptions options) {
54
+ const ForwardSliceOptions & options) {
55
55
getForwardSliceImpl (op, forwardSlice, options.filter );
56
56
if (!options.inclusive ) {
57
57
// Don't insert the top level operation, we just queried on it and don't
@@ -67,7 +67,7 @@ void mlir::getForwardSlice(Operation *op, SetVector<Operation *> *forwardSlice,
67
67
}
68
68
69
69
void mlir::getForwardSlice (Value root, SetVector<Operation *> *forwardSlice,
70
- SliceOptions options) {
70
+ const SliceOptions & options) {
71
71
for (Operation *user : root.getUsers ())
72
72
getForwardSliceImpl (user, forwardSlice, options.filter );
73
73
@@ -80,7 +80,7 @@ void mlir::getForwardSlice(Value root, SetVector<Operation *> *forwardSlice,
80
80
81
81
static void getBackwardSliceImpl (Operation *op,
82
82
SetVector<Operation *> *backwardSlice,
83
- BackwardSliceOptions options) {
83
+ const BackwardSliceOptions & options) {
84
84
if (!op || op->hasTrait <OpTrait::IsIsolatedFromAbove>())
85
85
return ;
86
86
@@ -119,7 +119,7 @@ static void getBackwardSliceImpl(Operation *op,
119
119
120
120
void mlir::getBackwardSlice (Operation *op,
121
121
SetVector<Operation *> *backwardSlice,
122
- BackwardSliceOptions options) {
122
+ const BackwardSliceOptions & options) {
123
123
getBackwardSliceImpl (op, backwardSlice, options);
124
124
125
125
if (!options.inclusive ) {
@@ -130,7 +130,7 @@ void mlir::getBackwardSlice(Operation *op,
130
130
}
131
131
132
132
void mlir::getBackwardSlice (Value root, SetVector<Operation *> *backwardSlice,
133
- BackwardSliceOptions options) {
133
+ const BackwardSliceOptions & options) {
134
134
if (Operation *definingOp = root.getDefiningOp ()) {
135
135
getBackwardSlice (definingOp, backwardSlice, options);
136
136
return ;
@@ -139,9 +139,9 @@ void mlir::getBackwardSlice(Value root, SetVector<Operation *> *backwardSlice,
139
139
getBackwardSlice (bbAargOwner, backwardSlice, options);
140
140
}
141
141
142
- SetVector<Operation *> mlir::getSlice (Operation *op,
143
- BackwardSliceOptions backwardSliceOptions,
144
- ForwardSliceOptions forwardSliceOptions) {
142
+ SetVector<Operation *>
143
+ mlir::getSlice (Operation *op, const BackwardSliceOptions & backwardSliceOptions,
144
+ const ForwardSliceOptions & forwardSliceOptions) {
145
145
SetVector<Operation *> slice;
146
146
slice.insert (op);
147
147
0 commit comments