This is an archive of the discontinued LLVM Phabricator instance.

[BasicTTIImpl][LoopUnroll] getUnrollingPreferences(): emit ORE remark when advising against unrolling due to a call in a loop
ClosedPublic

Authored by lebedev.ri on Aug 2 2021, 6:17 AM.

Details

Summary

I'm not sure this is the best way to approach this,
but the situation is rather not very detectable unless we explicitly call it out when refusing to advise to unroll.

Diff Detail

Event Timeline

lebedev.ri created this revision.Aug 2 2021, 6:17 AM
lebedev.ri requested review of this revision.Aug 2 2021, 6:17 AM

Probably loop-unroll should have a generic message along the lines of "runtime loop unrolling disabled for this loop due to target heuristic", if we don't already.

If that isn't clear enough, then I guess this is the only way to emit the diagnostic we want without significantly refactoring the code.

Probably loop-unroll should have a generic message along the lines of "runtime loop unrolling disabled for this loop due to target heuristic", if we don't already.

I guess we don't have any such remark currently:
https://godbolt.org/z/K3h6oK4hq

If that isn't clear enough, then I guess this is the only way to emit the diagnostic we want without significantly refactoring the code.

Note that if i wanted a generic remark then that is what i would have added.
I'd specifically like to have a remark for *this* situation.

efriedma accepted this revision.Aug 2 2021, 1:28 PM

LGTM, then.

This revision is now accepted and ready to land.Aug 2 2021, 1:28 PM

LGTM, then.

Thank you for the review!