Page MenuHomePhabricator

[AArch64] Teach analyzeBranch to remove branch equivelent to fallthrough
ClosedPublic

Authored by reames on Sep 21 2020, 10:21 AM.

Details

Summary

The motivation here is that MachineBlockPlacement relies on analyzeBranch to remove branches to fallthrough blocks when the branch is not fully analyzeable. With the introduction of the FAULTING_OP psuedo for implicit null checking (see D87861), this case becomes important. Note that it's hard to otherwise exercise this path as BranchFolding handle's any fully analyzeable branch sequence without using this interface.

p.s. For anyone who saw my comment in the original review, what I thought was an issue in BranchFolding originally turned out to simply be a bug in my patch. (Now fixed.)

Diff Detail

Event Timeline

reames created this revision.Sep 21 2020, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2020, 10:21 AM
reames requested review of this revision.Sep 21 2020, 10:21 AM
resistor added inline comments.Sep 21 2020, 2:54 PM
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
307

What's the situation where this is needed?

reames added inline comments.Sep 22 2020, 8:07 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
307

Looking at it, that one should be dead. I'll convert to an assert to confirm.

The conditional branch case below is definitely not dead.

reames updated this revision to Diff 293460.Sep 22 2020, 8:22 AM

address review comment

resistor accepted this revision.Sep 22 2020, 12:10 PM

LGTM

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
307

I feel like this assert message could have more context.

This revision is now accepted and ready to land.Sep 22 2020, 12:10 PM