Handle rewriting multi-return instrs
commitd1b8937fd1795dcb1cdcd40c6c1a140e6daf2ae0
authorAaron Orenstein <aorenste@meta.com>
Sun, 15 Jan 2023 17:24:52 +0000 (15 09:24 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sun, 15 Jan 2023 17:24:52 +0000 (15 09:24 -0800)
treec40d29f9fe24c42644aa77799c0944d500bb58bb
parentd0ce5bc0d93229bff6ec341dfb24a7e47d84b6f8
Handle rewriting multi-return instrs

Summary:
When performing a rewrite if the instruction being rewritten is multi-return and is followed by Select instructions then the rewriter needs to know how to route the Select InstrIds.

This change
(a) detects if the Selects were not re-routed properly.
(b) automatically reroutes them in simple cases.
(c) allows more complex cases.

Reviewed By: edwinsmith

Differential Revision: D42441069

fbshipit-source-id: 03520b409b1112505f33e469dcbe3dcb16330596
hphp/hack/src/hackc/ir/conversions/textual/lower/instrs.rs
hphp/hack/src/hackc/ir/ir_core/func_builder.rs
hphp/hack/src/hackc/ir/passes/ssa.rs