This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Handle empty functions with debug info in load/store opt pass
ClosedPublic

Authored by pbarrio on Aug 24 2016, 11:59 AM.

Details

Summary

In fuctions that contained debug info but were empty otherwise,
the ARM load/store optimizer could abort. This was because
function MergeReturnIntoLDM handled the special case where a
Machine Basic BLock is empty by calling MBB.empty(). However, this
returns false in presence of debug info, although the function
should be considered empty in the eyes of the load/store optimizer.
This has been fixed by handling the case where searching through the
block finds only debug instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

pbarrio updated this revision to Diff 69150.Aug 24 2016, 11:59 AM
pbarrio retitled this revision from to [ARM] Handle empty functions with debug info in load/store opt pass.
pbarrio updated this object.
pbarrio added reviewers: rengolin, dexonsmith, jmolloy.

Hello Renato, Duncan, James,

Would you have a few minutes to review this simple fix? The test case is quite verbose, but that's the debug info to blame :)

I have reduced it as much as I could; please let me know if that could be done better.

Many thanks,
Pablo

t.p.northover added a subscriber: t.p.northover.

Just added llvm-commits as a subscriber so the mailing list gets notified.

Sorry and thanks!

jmolloy accepted this revision.Aug 26 2016, 12:59 AM
jmolloy edited edge metadata.

Hi Pablo,

This LGTM.

Cheers,

James

This revision is now accepted and ready to land.Aug 26 2016, 12:59 AM
This revision was automatically updated to reflect the committed changes.