Commit 778b85a
authored
#167489 did not work properly when MLIR inlining is enabled
(experimental in flang, enabled with `-mllvm -inline-all`).
The reason is that inlining will cause several `fir.dummy_scope` to
coexist inside a same `func.func` (`fir.dummy_scope` of inlined
`func.func` are preserved in order to preserve the relationship between
arguments of the inlined call for better aliasing deductions).
After #167489, the debug info pass creates argument debug info for all
fir.declare with a fir.dummy_scope. This causes arguments from inlined
calls to appear as argument of the procedure where the call was inlined.
To avoid this, only consider that fir.declare are arguments of the
current function if their fir.dummy_scope is the first one created in
the function (fir.dummy_scope cannot be reorder because they have write
effects to the debug memory ressource, and the fir.dummy_scope of the
current functions is always emitted before any calls are lowered, so
before any fir.dummy_scope are inlined).
1 parent 5829bb9 commit 778b85a
File tree
2 files changed
+56
-4
lines changed- flang
- lib/Optimizer/Transforms
- test/Transforms
2 files changed
+56
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
613 | 629 | | |
614 | 630 | | |
615 | 631 | | |
| |||
619 | 635 | | |
620 | 636 | | |
621 | 637 | | |
622 | | - | |
| 638 | + | |
623 | 639 | | |
624 | 640 | | |
625 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments