[PATCH] D24700: [InstCombine] optimize unsigned icmp of increment

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 13:14:57 PDT 2016


spatel added inline comments.

================
Comment at: test/Transforms/InstCombine/icmp.ll:2799
@@ +2798,3 @@
+; CHECK-LABEL: @cmp_ult_rhs_inc(
+; CHECK-NEXT:    [[CONV:%.*]] = fptosi float %x to i32
+; CHECK-NEXT:    [[CMP:%.*]] = icmp ule i32 [[CONV]], %i
----------------
spatel wrote:
> sanjoy wrote:
> > Ok.
> The commuting happens because of operand complexity canonicalization. It would be nice to add a comment above here to make that clear.
> 
> Please see:
> https://llvm.org/bugs/show_bug.cgi?id=28296 
> https://reviews.llvm.org/D24419
> ...for more info. 
Also note that fptosi is a unary operator, so if we fix PR28296, these tests will silently stop testing the cases that they were hoping to test (sigh). 

It might be better if they used a non-nuw 'add' to match the complexity of 'add nuw'.


https://reviews.llvm.org/D24700





More information about the llvm-commits mailing list