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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 09:09:35 PST 2017


spatel 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
----------------
paulwalker-arm wrote:
> 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?
Sounds ok to me. As long we're covering all of the predicates and have some vector tests too, that should keep the fold tested well enough. Might want to vary double/float/half as well just to be sure we hit more types.


https://reviews.llvm.org/D40012





More information about the llvm-commits mailing list