Commit fd1e0af
Replace removeUnreachableBlocks with a targeted inliner fix
Summary:
D110056992 fixed a JIT crash when inlining a callee with no reachable `return`
by running `removeUnreachableBlocks` over the whole caller after the inlining
loop. This replaces that with a more targeted fix at the point where the bad IR
is produced.
When `HIRBuilder::inlineHIR` merges the callee's returns into a single exit
block, a callee with no reachable `return` leaves that exit block with no
predecessors, so nothing flows into the merged `return_val`. We now define
`return_val` with a `LoadConst<Bottom>` in that case, so the inliner's `Return`
-> `Assign`+`Branch` rewrite never references an undefined register. The
resulting dead blocks are dropped by the `CleanCFG` that already runs at the end
of `InlineFunctionCalls::Run`, so the explicit `removeUnreachableBlocks(irfunc)`
call is no longer needed.
Reviewed By: mpage
Differential Revision: D110145444
fbshipit-source-id: 9260014528d9f0b41ac37bef10ec8222c4847b651 parent 18479f8 commit fd1e0af
2 files changed
Lines changed: 25 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
| 735 | + | |
735 | 736 | | |
736 | | - | |
| 737 | + | |
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
| 741 | + | |
745 | 742 | | |
746 | 743 | | |
747 | 744 | | |
748 | 745 | | |
749 | 746 | | |
750 | 747 | | |
751 | 748 | | |
| 749 | + | |
752 | 750 | | |
753 | 751 | | |
754 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
755 | 766 | | |
756 | 767 | | |
757 | 768 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
| 298 | + | |
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| |||
603 | 604 | | |
604 | 605 | | |
605 | 606 | | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| |||
0 commit comments