brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · c3343ed Raw
82 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=instcombine -S < %s | FileCheck %s3 4define i8 @select_condition_implies_highbits_op1(i8 %xx, i8 noundef %y) {5; CHECK-LABEL: @select_condition_implies_highbits_op1(6; CHECK-NEXT:    [[X:%.*]] = and i8 [[XX:%.*]], 157; CHECK-NEXT:    [[COND:%.*]] = icmp ult i8 [[Y:%.*]], 38; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND]], i8 [[Y]], i8 [[X]]9; CHECK-NEXT:    [[R:%.*]] = or disjoint i8 [[SEL]], 3210; CHECK-NEXT:    ret i8 [[R]]11;12  %x = and i8 %xx, 1513  %cond = icmp ult i8 %y, 314  %sel = select i1 %cond, i8 %y, i8 %x15  %r = add i8 %sel, 3216  ret i8 %r17}18 19define i8 @select_condition_implies_highbits_op1_maybe_undef_fail(i8 %xx, i8 %y) {20; CHECK-LABEL: @select_condition_implies_highbits_op1_maybe_undef_fail(21; CHECK-NEXT:    [[X:%.*]] = and i8 [[XX:%.*]], 1522; CHECK-NEXT:    [[COND:%.*]] = icmp ult i8 [[Y:%.*]], 323; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND]], i8 [[Y]], i8 [[X]]24; CHECK-NEXT:    [[R:%.*]] = add i8 [[SEL]], 3225; CHECK-NEXT:    ret i8 [[R]]26;27  %x = and i8 %xx, 1528  %cond = icmp ult i8 %y, 329  %sel = select i1 %cond, i8 %y, i8 %x30  %r = add i8 %sel, 3231  ret i8 %r32}33 34define i8 @select_condition_implies_highbits_op2(i8 %xx, i8 noundef %y) {35; CHECK-LABEL: @select_condition_implies_highbits_op2(36; CHECK-NEXT:    [[X:%.*]] = and i8 [[XX:%.*]], 1537; CHECK-NEXT:    [[COND:%.*]] = icmp ugt i8 [[Y:%.*]], 338; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND]], i8 [[X]], i8 [[Y]]39; CHECK-NEXT:    [[R:%.*]] = or disjoint i8 [[SEL]], 3240; CHECK-NEXT:    ret i8 [[R]]41;42  %x = and i8 %xx, 1543  %cond = icmp ugt i8 %y, 344  %sel = select i1 %cond, i8 %x, i8 %y45  %r = add i8 %sel, 3246  ret i8 %r47}48 49define i8 @select_condition_implies_highbits_op1_and(i8 %xx, i8 noundef %y, i1 %other_cond) {50; CHECK-LABEL: @select_condition_implies_highbits_op1_and(51; CHECK-NEXT:    [[X:%.*]] = and i8 [[XX:%.*]], 1552; CHECK-NEXT:    [[COND0:%.*]] = icmp ult i8 [[Y:%.*]], 353; CHECK-NEXT:    [[COND:%.*]] = and i1 [[COND0]], [[OTHER_COND:%.*]]54; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND]], i8 [[Y]], i8 [[X]]55; CHECK-NEXT:    [[R:%.*]] = or disjoint i8 [[SEL]], 3256; CHECK-NEXT:    ret i8 [[R]]57;58  %x = and i8 %xx, 1559  %cond0 = icmp ult i8 %y, 360  %cond = and i1 %cond0, %other_cond61  %sel = select i1 %cond, i8 %y, i8 %x62  %r = add i8 %sel, 3263  ret i8 %r64}65 66define i8 @select_condition_implies_highbits_op2_or(i8 %xx, i8 noundef %y, i1 %other_cond) {67; CHECK-LABEL: @select_condition_implies_highbits_op2_or(68; CHECK-NEXT:    [[X:%.*]] = and i8 [[XX:%.*]], 1569; CHECK-NEXT:    [[COND0:%.*]] = icmp ugt i8 [[Y:%.*]], 370; CHECK-NEXT:    [[COND:%.*]] = or i1 [[COND0]], [[OTHER_COND:%.*]]71; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND]], i8 [[X]], i8 [[Y]]72; CHECK-NEXT:    [[R:%.*]] = or disjoint i8 [[SEL]], 3273; CHECK-NEXT:    ret i8 [[R]]74;75  %x = and i8 %xx, 1576  %cond0 = icmp ugt i8 %y, 377  %cond = or i1 %cond0, %other_cond78  %sel = select i1 %cond, i8 %x, i8 %y79  %r = add i8 %sel, 3280  ret i8 %r81}82