This is an archive of the discontinued LLVM Phabricator instance.

[HardwareLoops] Optimisation remarks
ClosedPublic

Authored by SjoerdMeijer on Oct 7 2019, 7:59 AM.

Details

Summary

This adds the initial plumbing to support optimisation remarks in
the IR hardware-loop pass.

I have left a TODO in a comment where we can improve the reporting,
but I will iterate on that once we have this initial support in.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Oct 7 2019, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 7:59 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
hiraditya added inline comments.Oct 7 2019, 2:06 PM
llvm/lib/CodeGen/HardwareLoops.cpp
83

if (I)

84

nit, ' '

261–266

Checking ForceHardwareLoops should be cheaper, so we can check that first.

Thanks for taking a look!
Comments addressed.

shchenz added inline comments.Oct 8 2019, 2:27 AM
llvm/lib/CodeGen/HardwareLoops.cpp
246–249

Maybe can add a report here, Parent hardware loop does not support containing a nested hardware loop?

255–257

And also here? Invalid loop for example the one which contains irreducible control flow?

Added two more remarks

Just wanted to check if we are happy with this as an initial commit?

samparker accepted this revision.Oct 15 2019, 8:24 AM

I agree that it would be good to know why a loop isn't a candidate, but this looks like a good start to me!

This revision is now accepted and ready to land.Oct 15 2019, 8:24 AM
This revision was automatically updated to reflect the committed changes.

Thanks for reviewing!