[PATCH] D26091: [ValueTracking] recognize more variants of smin/smax

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 16:41:22 PDT 2016


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

Code changes look fine.



================
Comment at: test/Transforms/InstCombine/max-of-nots.ll:143
 ; CHECK-LABEL: @max_of_min_swap(
-; CHECK-NEXT:    [[NOT_A:%.*]] = xor i32 %a, -1
-; CHECK-NEXT:    [[C0:%.*]] = icmp slt i32 %a, 0
-; CHECK-NEXT:    [[S0:%.*]] = select i1 [[C0]], i32 -1, i32 [[NOT_A]]
-; CHECK-NEXT:    [[C1:%.*]] = icmp sgt i32 [[S0]], -1
-; CHECK-NEXT:    [[S1:%.*]] = select i1 [[C1]], i32 [[S0]], i32 -1
-; CHECK-NEXT:    ret i32 [[S1]]
+; CHECK-NEXT:    ret i32 -1
 ;
----------------
Is there really no better way to write a testcase for this?  I guess there are a limited number of transforms which use min/max formation, but this seems awkward.


https://reviews.llvm.org/D26091





More information about the llvm-commits mailing list