34 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=instcombine -o - -S %s | FileCheck %s3 4; The constant at %v35 should be shrunk, but this must lead to the nsw flag of5; %v43 getting removed.6 7define i32 @foo(i32 %arg) {8; CHECK-LABEL: @foo(9; CHECK-NEXT: [[V33:%.*]] = and i32 [[ARG:%.*]], 22310; CHECK-NEXT: [[V34:%.*]] = xor i32 [[V33]], 2911; CHECK-NEXT: [[V35:%.*]] = add nuw nsw i32 [[V34]], 136291557512; CHECK-NEXT: [[V40:%.*]] = shl nuw nsw i32 [[V34]], 113; CHECK-NEXT: [[V41:%.*]] = and i32 [[V40]], 29014; CHECK-NEXT: [[V42:%.*]] = sub nuw nsw i32 [[V35]], [[V41]]15; CHECK-NEXT: [[V43:%.*]] = add nuw i32 [[V42]], 153357945016; CHECK-NEXT: [[V45:%.*]] = xor i32 [[V43]], 74901137717; CHECK-NEXT: ret i32 [[V45]]18;19 %v33 = and i32 %arg, 22320 %v34 = xor i32 %v33, 2921 %v35 = add nuw i32 %v34, 351039922322 %v37 = or i32 %v34, 187483691523 %v38 = and i32 %v34, 22124 %v39 = xor i32 %v38, 187483691525 %v40 = xor i32 %v37, %v3926 %v41 = shl nsw nuw i32 %v40, 127 %v42 = sub i32 %v35, %v4128 %v43 = add nsw i32 %v42, 153357945029 %v44 = or i32 %v43, -214748364830 %v45 = xor i32 %v44, 74901137731 ret i32 %v4532}33 34