[PATCH] D129756: [IndVars] Directly use unsigned integer induction for FPToUI/FPToSI of float induction

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 16 03:43:09 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM

The last step here would be to deal with different sizes between the itofp and fptoi with trunc or sext/zext.



================
Comment at: llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll:184
+; https://godbolt.org/z/51MrqYjEf
+define void @uitofp_fptoui_range () {
+; CHECK-LABEL: @uitofp_fptoui_range(
----------------
Allen wrote:
> nikic wrote:
> > We should be testing negative ranges as well -- in this case, they would actually be not legal.
> for unsigned type induction, negative ranges  will be determined true at very early pass, so we don't need check it ?
>  https://godbolt.org/z/rerdG58cj
Passes need to be correct in isolation, so I think it is important to still test that case here, even if it gets transformed earlier in the full pipeline.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129756/new/

https://reviews.llvm.org/D129756



More information about the llvm-commits mailing list