This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Recognize t2LoopEnd for software pipelining
ClosedPublic

Authored by dpenry on May 24 2022, 1:08 PM.

Details

Summary
  • Add t2LoopEnd to TargetInstrInfo::analyzeBranch and related functions. As there are many side effects of analyzing a branch, only do so if software pipelining is enabled to maintain previous behavior when pipelining is not desired.
  • Make sure that t2LoopEndDec is immediately followed by a t2B when it is synthesized from a t2LoopEnd. This is done because the t2LoopEnd might have acquired a fall-through path, but IfConversion assumes that fall-through are only possible on analyzable branches.

Diff Detail

Event Timeline

dpenry created this revision.May 24 2022, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 1:08 PM
dpenry published this revision for review.May 24 2022, 1:16 PM
dpenry added reviewers: bcahoon, thopre, dmgreen.
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 1:16 PM
dmgreen added inline comments.May 25 2022, 6:08 AM
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
414

Can you add a high-level comment somewhere, maybe above analyzeBranch, that explains the condition - that 2 values is a conditional branch and 3 is a LE.

6801

This can remove the variable for NewCmp.

6853

There is a isVCTP function, which I think can be used here.

6861

if (!LoopDec || LoopDec->getOpcode()... would be a little safer.

llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp
409

This needn't have the brackets around LoopEnd->getParent() I don't think

llvm/test/CodeGen/Thumb2/swp-fixedii-le.mir
4

Can you make this -mtriple=thumbv8.1-m.main-none-eabi. Otherwise the instructions like t2LoopEnd are technically not valid, and should (but currently won't) be giving verifier errors.

dpenry updated this revision to Diff 432083.May 25 2022, 12:31 PM

Responding to review comments from dmgreen

dpenry marked 6 inline comments as done.May 25 2022, 12:33 PM
dpenry updated this revision to Diff 432287.May 26 2022, 7:51 AM

Fix comment

dmgreen accepted this revision.May 26 2022, 9:36 AM

Thanks. LGTM

This revision is now accepted and ready to land.May 26 2022, 9:36 AM
This revision was landed with ongoing or failed builds.May 26 2022, 9:56 AM
This revision was automatically updated to reflect the committed changes.