@@ -40,42 +40,40 @@ def PromotableAllocationOpInterface
40
40
Provides the default Value of this memory slot. The provided Value
41
41
will be used as the reaching definition of loads done before any store.
42
42
This Value must outlive the promotion and dominate all the uses of this
43
- slot's pointer. The provided rewriter can be used to create the default
43
+ slot's pointer. The provided builder can be used to create the default
44
44
value on the fly.
45
45
46
- The rewriter is located at the beginning of the block where the slot
47
- pointer is defined. All IR mutations must happen through the rewriter.
46
+ The builder is located at the beginning of the block where the slot
47
+ pointer is defined.
48
48
}], "::mlir::Value", "getDefaultValue",
49
49
(ins
50
50
"const ::mlir::MemorySlot &":$slot,
51
- "::mlir::RewriterBase &":$rewriter )
51
+ "::mlir::OpBuilder &":$builder )
52
52
>,
53
53
InterfaceMethod<[{
54
54
Hook triggered for every new block argument added to a block.
55
55
This will only be called for slots declared by this operation.
56
56
57
- The rewriter is located at the beginning of the block on call. All IR
58
- mutations must happen through the rewriter .
57
+ The builder is located at the beginning of the block on call. All IR
58
+ mutations must happen through the builder .
59
59
}],
60
60
"void", "handleBlockArgument",
61
61
(ins
62
62
"const ::mlir::MemorySlot &":$slot,
63
63
"::mlir::BlockArgument":$argument,
64
- "::mlir::RewriterBase &":$rewriter
64
+ "::mlir::OpBuilder &":$builder
65
65
)
66
66
>,
67
67
InterfaceMethod<[{
68
68
Hook triggered once the promotion of a slot is complete. This can
69
69
also clean up the created default value if necessary.
70
70
This will only be called for slots declared by this operation.
71
-
72
- All IR mutations must happen through the rewriter.
73
71
}],
74
72
"void", "handlePromotionComplete",
75
73
(ins
76
74
"const ::mlir::MemorySlot &":$slot,
77
75
"::mlir::Value":$defaultValue,
78
- "::mlir::RewriterBase &":$rewriter )
76
+ "::mlir::OpBuilder &":$builder )
79
77
>,
80
78
];
81
79
}
@@ -119,15 +117,14 @@ def PromotableMemOpInterface : OpInterface<"PromotableMemOpInterface"> {
119
117
The returned value must dominate all operations dominated by the storing
120
118
operation.
121
119
122
- If IR must be mutated to extract a concrete value being stored, mutation
123
- must happen through the provided rewriter. The rewriter is located
124
- immediately after the memory operation on call. No IR deletion is
125
- allowed in this method. IR mutations must not introduce new uses of the
126
- memory slot. Existing control flow must not be modified.
120
+ The builder is located immediately after the memory operation on call.
121
+ No IR deletion is allowed in this method. IR mutations must not
122
+ introduce new uses of the memory slot. Existing control flow must not
123
+ be modified.
127
124
}],
128
125
"::mlir::Value", "getStored",
129
126
(ins "const ::mlir::MemorySlot &":$slot,
130
- "::mlir::RewriterBase &":$rewriter ,
127
+ "::mlir::OpBuilder &":$builder ,
131
128
"::mlir::Value":$reachingDef,
132
129
"const ::mlir::DataLayout &":$dataLayout)
133
130
>,
@@ -166,14 +163,13 @@ def PromotableMemOpInterface : OpInterface<"PromotableMemOpInterface"> {
166
163
have been done at the point of calling this method, but it will be done
167
164
eventually.
168
165
169
- The rewriter is located after the promotable operation on call. All IR
170
- mutations must happen through the rewriter.
166
+ The builder is located after the promotable operation on call.
171
167
}],
172
168
"::mlir::DeletionKind",
173
169
"removeBlockingUses",
174
170
(ins "const ::mlir::MemorySlot &":$slot,
175
171
"const ::llvm::SmallPtrSetImpl<mlir::OpOperand *> &":$blockingUses,
176
- "::mlir::RewriterBase &":$rewriter ,
172
+ "::mlir::OpBuilder &":$builder ,
177
173
"::mlir::Value":$reachingDefinition,
178
174
"const ::mlir::DataLayout &":$dataLayout)
179
175
>,
@@ -224,13 +220,12 @@ def PromotableOpInterface : OpInterface<"PromotableOpInterface"> {
224
220
have been done at the point of calling this method, but it will be done
225
221
eventually.
226
222
227
- The rewriter is located after the promotable operation on call. All IR
228
- mutations must happen through the rewriter.
223
+ The builder is located after the promotable operation on call.
229
224
}],
230
225
"::mlir::DeletionKind",
231
226
"removeBlockingUses",
232
227
(ins "const ::llvm::SmallPtrSetImpl<mlir::OpOperand *> &":$blockingUses,
233
- "::mlir::RewriterBase &":$rewriter )
228
+ "::mlir::OpBuilder &":$builder )
234
229
>,
235
230
InterfaceMethod<[{
236
231
This method allows the promoted operation to visit the SSA values used
@@ -254,13 +249,12 @@ def PromotableOpInterface : OpInterface<"PromotableOpInterface"> {
254
249
scheduled for removal and if `requiresReplacedValues` returned
255
250
true.
256
251
257
- The rewriter is located after the promotable operation on call. All IR
258
- mutations must happen through the rewriter. During the transformation,
259
- *no operation should be deleted*.
252
+ The builder is located after the promotable operation on call. During
253
+ the transformation, *no operation should be deleted*.
260
254
}],
261
255
"void", "visitReplacedValues",
262
256
(ins "::llvm::ArrayRef<std::pair<::mlir::Operation*, ::mlir::Value>>":$mutatedDefs,
263
- "::mlir::RewriterBase &":$rewriter ), [{}], [{ return; }]
257
+ "::mlir::OpBuilder &":$builder ), [{}], [{ return; }]
264
258
>,
265
259
];
266
260
}
@@ -293,25 +287,23 @@ def DestructurableAllocationOpInterface
293
287
at the end of this call. Only generates subslots for the indices found in
294
288
`usedIndices` since all other subslots are unused.
295
289
296
- The rewriter is located at the beginning of the block where the slot
297
- pointer is defined. All IR mutations must happen through the rewriter.
290
+ The builder is located at the beginning of the block where the slot
291
+ pointer is defined.
298
292
}],
299
293
"::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot>",
300
294
"destructure",
301
295
(ins "const ::mlir::DestructurableMemorySlot &":$slot,
302
296
"const ::llvm::SmallPtrSetImpl<::mlir::Attribute> &":$usedIndices,
303
- "::mlir::RewriterBase &":$rewriter )
297
+ "::mlir::OpBuilder &":$builder )
304
298
>,
305
299
InterfaceMethod<[{
306
300
Hook triggered once the destructuring of a slot is complete, meaning the
307
301
original slot is no longer being refered to and could be deleted.
308
302
This will only be called for slots declared by this operation.
309
-
310
- All IR mutations must happen through the rewriter.
311
303
}],
312
304
"void", "handleDestructuringComplete",
313
305
(ins "const ::mlir::DestructurableMemorySlot &":$slot,
314
- "::mlir::RewriterBase &":$rewriter )
306
+ "::mlir::OpBuilder &":$builder )
315
307
>,
316
308
];
317
309
}
@@ -376,15 +368,14 @@ def DestructurableAccessorOpInterface
376
368
Rewires the use of a slot to the generated subslots, without deleting
377
369
any operation. Returns whether the accessor should be deleted.
378
370
379
- All IR mutations must happen through the rewriter. Deletion of
380
- operations is not allowed, only the accessor can be scheduled for
381
- deletion by returning the appropriate value.
371
+ Deletion of operations is not allowed, only the accessor can be
372
+ scheduled for deletion by returning the appropriate value.
382
373
}],
383
374
"::mlir::DeletionKind",
384
375
"rewire",
385
376
(ins "const ::mlir::DestructurableMemorySlot &":$slot,
386
377
"::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &":$subslots,
387
- "::mlir::RewriterBase &":$rewriter ,
378
+ "::mlir::OpBuilder &":$builder ,
388
379
"const ::mlir::DataLayout &":$dataLayout)
389
380
>
390
381
];
0 commit comments