Page MenuHomePhabricator

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

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



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, - 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