|
9 | 9 | #include "mlir/Bytecode/BytecodeWriter.h"
|
10 | 10 | #include "mlir/Bytecode/Encoding.h"
|
11 | 11 | #include "mlir/IR/BuiltinOps.h"
|
| 12 | +#include "mlir/IR/OwningOpRef.h" |
12 | 13 | #include "mlir/Parser/Parser.h"
|
13 | 14 | #include "mlir/Pass/Pass.h"
|
14 | 15 |
|
@@ -46,19 +47,19 @@ class TestPreserveUseListOrders
|
46 | 47 | void runOnOperation() override {
|
47 | 48 | // Clone the module so that we can plug in this pass to any other
|
48 | 49 | // independently.
|
49 |
| - auto cloneModule = getOperation().clone(); |
| 50 | + OwningOpRef<ModuleOp> cloneModule = getOperation().clone(); |
50 | 51 |
|
51 | 52 | // 1. Compute the op numbering of the module.
|
52 |
| - computeOpNumbering(cloneModule); |
| 53 | + computeOpNumbering(*cloneModule); |
53 | 54 |
|
54 | 55 | // 2. Loop over all the values and shuffle the uses. While doing so, check
|
55 | 56 | // that each shuffle is correct.
|
56 |
| - if (failed(shuffleUses(cloneModule))) |
| 57 | + if (failed(shuffleUses(*cloneModule))) |
57 | 58 | return signalPassFailure();
|
58 | 59 |
|
59 | 60 | // 3. Do a bytecode roundtrip to version 3, which supports use-list order
|
60 | 61 | // preservation.
|
61 |
| - auto roundtripModuleOr = doRoundtripToBytecode(cloneModule, 3); |
| 62 | + auto roundtripModuleOr = doRoundtripToBytecode(*cloneModule, 3); |
62 | 63 | // If the bytecode roundtrip failed, try to roundtrip the original module
|
63 | 64 | // to version 2, which does not support use-list. If this also fails, the
|
64 | 65 | // original module had an issue unrelated to uselists.
|
|
0 commit comments