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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 12:37:40 PDT 2019


reames created this revision.
reames added reviewers: nikic, ebrevnov, scanon.
Herald added subscribers: bollu, mcrosier.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D68954

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/floating-point-iv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68954.224891.patch
Type: text/x-patch
Size: 7158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191014/a719fb5e/attachment.bin>


More information about the llvm-commits mailing list