[PATCH] D40012: [InstSimplify] More fcmp cases when comparing against negative constants.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 08:57:05 PST 2017


paulwalker-arm added inline comments.


================
Comment at: test/Transforms/InstCombine/cast-int-fcmp-eq-0.ll:342-349
+; unsigned integer cannot possibly round to a negative
 ; CHECK-LABEL: @i32_cast_cmp_oeq_int_i32imin_uitofp(
-; CHECK: uitofp
-; CHECK: fcmp oeq
-; CHECK-NEXT: ret
+; CHECK-NEXT: ret i1 false
 define i1 @i32_cast_cmp_oeq_int_i32imin_uitofp(i32 %i) {
   %f = uitofp i32 %i to float
   %cmp = fcmp oeq float %f, 0xC1E0000000000000
   ret i1 %cmp
----------------
spatel wrote:
> Can you move this and the related tests over to the instsimplify file?
> 
> Nit: I'd prefer to change these constants to '-1.0' or whatever they are rather than trying to decode hex values. :)
Will do.  Are there any objections to me maintaining the same number of tests within InstSimplify/floating-point-compare.ll but replacing some uses of fabs with uitofp?


https://reviews.llvm.org/D40012





More information about the llvm-commits mailing list