This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen][AArch64] Don't split inline asm goto blocks or their targets
ClosedPublic

Authored by dhoekwater on Aug 23 2023, 11:11 AM.

Details

Summary

Machine function splitting + branch relaxation currently don't properly
handle inline asm goto blocks that conditional branch to cold goto
labels. While such inline asm is technically invalid, machine
function splitting is the only thing that exposes it as such.

Since machine function splitting doesn't help too much in these
circumstances anyway, disable it for asm goto blocks and their targets.

Diff Detail

Event Timeline

dhoekwater created this revision.Aug 23 2023, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 11:11 AM
dhoekwater requested review of this revision.Aug 23 2023, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 11:11 AM
dhoekwater edited the summary of this revision. (Show Details)

Rebase onto main and update test function numbers.

shenhan accepted this revision.Aug 29 2023, 11:04 AM
shenhan added inline comments.
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
8448

This test (MBB.isInlineAsmBrIndirectTarget()) is quicker and cheaper than acquiring and iterating over jump-tbl , we may rearrange the tests so that the quickest and cheapest tests are placed earlier than those less cheap.

This revision is now accepted and ready to land.Aug 29 2023, 11:04 AM

Place cheap checks before expensive ones per reviewer feedback

This revision was landed with ongoing or failed builds.Aug 29 2023, 1:28 PM
This revision was automatically updated to reflect the committed changes.