This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Delay reverting WLS in arm-block-placement
ClosedPublic

Authored by dmgreen on Sep 27 2021, 10:13 AM.

Details

Summary

If we cannot fix up the block placement of WLS branches we revert WLS to DLS instructions. But in doing so can create new blocks, invalidating loop analyses and potentially running into invalid iterators. Prevent that by creating a list of all WLS instructions to revert and reverting them after processing all loops.

The test case it fairly large, but I have not managed to simplify it any further due to the issue coming up from invalid iterators.

Diff Detail

Event Timeline

dmgreen created this revision.Sep 27 2021, 10:13 AM
dmgreen requested review of this revision.Sep 27 2021, 10:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2021, 10:13 AM
SjoerdMeijer accepted this revision.Sep 28 2021, 3:39 AM

Looks like a good fix to me.

The test is indeed big, but I guess it is what it is if it's difficult to reduce.

llvm/lib/Target/ARM/ARMBlockPlacement.cpp
34

Nit: perhaps add a comment why we are adding/doing this bookkeeping (i.e. the description of this patch).

89

Unrelated nit: perhaps time to rename this to revertWhileToDoLoop while we are at it?

This revision is now accepted and ready to land.Sep 28 2021, 3:39 AM
This revision was landed with ongoing or failed builds.Sep 28 2021, 7:38 AM
This revision was automatically updated to reflect the committed changes.