brintos

brintos / llvm-project-archived public Read only

0
0
Text · 602 B · addcdb1 Raw
18 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2;RUN: opt -passes=instcombine -S %s | FileCheck %s3 4; We shouldn't remove the select before the srem5define i32 @foo(i1 %a, i32 %b, i32 %c) {6; CHECK-LABEL: @foo(7; CHECK-NEXT:    [[SEL1:%.*]] = select i1 [[A:%.*]], i32 [[B:%.*]], i32 -18; CHECK-NEXT:    [[REM:%.*]] = srem i32 [[C:%.*]], [[SEL1]]9; CHECK-NEXT:    [[SEL2:%.*]] = select i1 [[A]], i32 [[REM]], i32 010; CHECK-NEXT:    ret i32 [[SEL2]]11;12  %sel1 = select i1 %a, i32 %b, i32 -113  %rem = srem i32 %c, %sel114  %sel2 = select i1 %a, i32 %rem, i32 015  ret i32 %sel216}17 18