This is an archive of the discontinued LLVM Phabricator instance.

[ARM][LowOverheadLoops] Fix loop count chain
ClosedPublic

Authored by samparker on Feb 5 2020, 3:37 AM.

Details

Summary

Checking that the use-def chain that performs the loop count isSafeToRemove is not sufficient because it means that we can remove register copies that we need to restore lr to its correct value. This change now prevents the transform from kicking in for the 'remove-elem-moves' test which needs to addressed later on.

Diff Detail

Event Timeline

samparker created this revision.Feb 5 2020, 3:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 3:37 AM

Looks like a good fix to me.

The tests are big, but it's probably good to have some larger tests too.

llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
727

Nit: I think some comments would be good here

SjoerdMeijer accepted this revision.Feb 5 2020, 5:03 AM
This revision is now accepted and ready to land.Feb 5 2020, 5:03 AM
This revision was automatically updated to reflect the committed changes.