File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -813,6 +813,24 @@ define <2 x i1> @test46_undef(<2 x i8> %c) {
813
813
ret <2 x i1 > %or
814
814
}
815
815
816
+ ; This is the variant of the above pattern where one of the ranges is
817
+ ; represented with an add.
818
+ define i1 @two_ranges_to_mask_and_range_degenerate (i16 %x ) {
819
+ ; CHECK-LABEL: @two_ranges_to_mask_and_range_degenerate(
820
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i16 [[X:%.*]], 12
821
+ ; CHECK-NEXT: [[TMP1:%.*]] = add i16 [[X]], -16
822
+ ; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i16 [[TMP1]], 12
823
+ ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[TMP2]]
824
+ ; CHECK-NEXT: ret i1 [[OR]]
825
+ ;
826
+ %cmp1 = icmp ult i16 %x , 12
827
+ %cmp2 = icmp uge i16 %x , 16
828
+ %cmp3 = icmp ult i16 %x , 28
829
+ %and = and i1 %cmp2 , %cmp3
830
+ %or = or i1 %cmp1 , %and
831
+ ret i1 %or
832
+ }
833
+
816
834
define i1 @test47 (i8 signext %c ) {
817
835
; CHECK-LABEL: @test47(
818
836
; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[C:%.*]], -33
You can’t perform that action at this time.
0 commit comments