This is an archive of the discontinued LLVM Phabricator instance.

[IndVars] Convert (fcmp (sitofp x), sitofp(int-con)) to equivelent icmp where possible
AbandonedPublic

Authored by reames on Oct 14 2019, 12:30 PM.

Details

Summary

If we have a known trip count for a loop - either because of an existing integer exit which gives us a useful max or say, https://reviews.llvm.org/D68844 - then we can eliminate fcmps of integer IVs.

The eventual goal of this is to combine w/the patch mentioned to let us generalize handleFloatingPointIV for multi-exit loops, but it's also a useful standalone transform of it's own right. The concept of a precise integer sub-range of floating point types doesn't appear to be cleanly expressed in LLVM, so introducing the concept, and then factoring it into a common place is a nice side benefit.

Diff Detail

Event Timeline

reames created this revision.Oct 14 2019, 12:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2019, 12:30 PM
reames abandoned this revision.Oct 24 2022, 9:42 AM

Closing review I'm not currently working on, and am unlikely to get back to in near future. Will reopen if priorities change.

Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 9:42 AM