[MachineOutliner] Fix label outlining regression introduced in D125072
authorduk <37@cmail.nu>
Thu, 30 Mar 2023 18:43:12 +0000 (14:43 -0400)
committerduk <37@cmail.nu>
Thu, 30 Mar 2023 18:43:12 +0000 (14:43 -0400)
commite8bc77ec085cf23a743bf203d526000df8f45946
treeff1b849ed7609e42fa075166a6b82e872df1e95b
parenta590d8634308aadc96e71c8dbbcbd4348f2efd1d
[MachineOutliner] Fix label outlining regression introduced in D125072

Due to a change in the APIs used to determine what instructions can be outlined, the check for label outling was never hit. Instead, all labels were considered invisible, which is the opposite of the intended behavior and causes obscure crashes down the line. We now replicate the original behavior more closely, with explicit checks for known-good and known-bad instruction types.

Reviewed by: paquette

Differential Revision: https://reviews.llvm.org/D147178
llvm/lib/CodeGen/TargetInstrInfo.cpp
llvm/test/CodeGen/AArch64/machine-outliner-labels.mir [new file with mode: 0644]