This is an archive of the discontinued LLVM Phabricator instance.

[SimpleLoopUnswitch] Increment stats counter for unswitching switch instruction
ClosedPublic

Authored by qianzhen on Jan 7 2019, 1:18 PM.

Details

Summary

Increment statistics counter NumSwitches at unswitchNontrivialInvariants() for unswitching a non-trivial switch instruction. This is to fix a bug that it increments NumBranches even for the case of switch instruction.
There is no functional change in this patch.

Diff Detail

Event Timeline

qianzhen created this revision.Jan 7 2019, 1:18 PM
qianzhen edited the summary of this revision. (Show Details)Jan 7 2019, 1:23 PM
asbirlea accepted this revision.Jan 7 2019, 2:38 PM

One nit, otherwise LGTM.

llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
2286

The if(SI) is redundant.
Lines 1923 and 2028 above already confirm either SI or BI exist.

This revision is now accepted and ready to land.Jan 7 2019, 2:38 PM
qianzhen updated this revision to Diff 180677.Jan 8 2019, 8:25 AM

Removed "if (SI)" as comment suggested. Thanks for the review!

This revision was automatically updated to reflect the committed changes.