This is an archive of the discontinued LLVM Phabricator instance.

[CleanUp] Remove NumInstructions field from LoopVectorizer's RegisterUsage struct.
ClosedPublic

Authored by mattd on Mar 14 2018, 2:45 PM.

Details

Summary

This variable is largely going unused; aside from reporting number of instructions for in DEBUG builds.

The only use of NumInstructions is in debug output to represent the LoopSize. That value can be can be misleading as it also includes metadata instructions (e.g., DBG_VALUE) which have no real impact. If we do choose to keep this around, we probably should guard it by a DEBUG macro, as it's not used in production builds.

Diff Detail

Event Timeline

mattd created this revision.Mar 14 2018, 2:45 PM
rengolin accepted this revision.Mar 14 2018, 3:19 PM

The original code was calculating the unroll factor by NumInstructions like:

UF = std::min(UF, (32 / R.NumInstructions));

which has been replaced a long time ago, so yeah, left overs. :)

LGTM, thanks!

This revision is now accepted and ready to land.Mar 14 2018, 3:19 PM
mattd added a comment.Mar 14 2018, 3:23 PM

The original code was calculating the unroll factor by NumInstructions like:

UF = std::min(UF, (32 / R.NumInstructions));

which has been replaced a long time ago, so yeah, left overs. :)

LGTM, thanks!

Great, thank you!

This revision was automatically updated to reflect the committed changes.