This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnswitch] Fix a simple bug which disables loop unswitch for select statement
ClosedPublic

Authored by wmi on Aug 21 2017, 3:36 PM.

Details

Summary

This is to fix PR34257. rL309059 takes an early return when FindLIVLoopCondition fails to find a loop invariant condition. This is wrong and it will disable loop unswitch for select. The patch fixes the bug.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi created this revision.Aug 21 2017, 3:36 PM

Thanks for the fix. I debugged it a little bit yesterday and found the same suspicious place, but was not sure whether that was intended in order to fix the initial wrong optimization or not

davide accepted this revision.Aug 28 2017, 5:16 PM
This revision is now accepted and ready to land.Aug 28 2017, 5:16 PM
This revision was automatically updated to reflect the committed changes.