We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 936fe9b commit ed14745Copy full SHA for ed14745
llvm/test/Transforms/InstCombine/select-icmp-and.ll
@@ -794,3 +794,18 @@ define i32 @select_bittest_to_shl_negative_test(i32 %x) {
794
%res = add nuw nsw i32 %y, 2
795
ret i32 %res
796
}
797
+
798
+define i8 @select_bittest_to_xor(i8 %x) {
799
+; CHECK-LABEL: @select_bittest_to_xor(
800
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[X:%.*]], -1
801
+; CHECK-NEXT: call void @use1(i1 [[CMP]])
802
+; CHECK-NEXT: [[MASKSEL:%.*]] = xor i8 [[X]], -128
803
+; CHECK-NEXT: ret i8 [[MASKSEL]]
804
+;
805
+ %cmp = icmp sgt i8 %x, -1
806
+ call void @use1(i1 %cmp)
807
+ %and = and i8 %x, 127
808
+ %or = or i8 %x, -128
809
+ %masksel = select i1 %cmp, i8 %or, i8 %and
810
+ ret i8 %masksel
811
+}
0 commit comments