This is an archive of the discontinued LLVM Phabricator instance.

[MachineOutliner] Fix label outlining regression introduced in D125072
ClosedPublic

Authored by duck-37 on Mar 29 2023, 1:12 PM.

Details

Summary

Discovered by @zjaffal

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.

Diff Detail

Event Timeline

duck-37 created this revision.Mar 29 2023, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 1:12 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
duck-37 requested review of this revision.Mar 29 2023, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 1:12 PM

Thanks for the fix, code looks good, but do you think you could write a MIR testcase instead of an IR testcase for this?

llvm/test/CodeGen/AArch64/machine-outliner-overlap.mir is a more recent test you could base it off of.

duck-37 updated this revision to Diff 509741.Mar 30 2023, 11:16 AM

Much better test.

duck-37 updated this revision to Diff 509742.Mar 30 2023, 11:18 AM

Fix diff.

duck-37 updated this revision to Diff 509744.Mar 30 2023, 11:20 AM

Fix diff, take two.

paquette accepted this revision.Mar 30 2023, 11:38 AM

LGTM, thanks!

This revision is now accepted and ready to land.Mar 30 2023, 11:38 AM
This revision was landed with ongoing or failed builds.Mar 30 2023, 11:45 AM
This revision was automatically updated to reflect the committed changes.

@zjaffal can you confirm that this version of the patch also fixes your issue?