Commit 594787f
authored
[Verif] handle self-referencing operations (llvm#8972)
When cloning self-referencing operations like
%reg = seq.firreg %reg clock %clock reset sync %reset, %c0_i4 : i4
lower-contracts would previously produce something like:
^bb0(%arg0: !seq.clock, %arg1: i1):
...
%5 = seq.firreg(%5, %arg0, %arg1, %4) : i4
...
verif.formal():
...
%3 = seq.firreg(%5, %0, %1, %2) : i4
...
Here we can see that the verif.formal test refers to a value from `bb0`,
namely `%5`, which results in an error.
The problem appears to be that when cloning the operation, we haven't
yet created a mapping for the operation's result (`%5 -> %3`), so `%5`
is left in place.
This change makes us go through all operands of the cloned operations
once more, _after_ adding the mappings for the operations' results,
which means that the `%5` in verif.formal is remapped to `%3`.
This is done after cloning all operations to also handle cycles longer
than one operation.
Fixes llvm#8952.1 parent e698309 commit 594787f
File tree
2 files changed
+55
-4
lines changed- lib/Dialect/Verif/Transforms
- test/Dialect/Verif
2 files changed
+55
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
0 commit comments