1; NOTE: Assertions have been autogenerated by update_test_checks.py
2; RUN: opt < %s -instcombine -S | FileCheck %s
3
4define i32 @foo(i32 %x, i32 %y) {
5; CHECK-LABEL: @foo(
6; CHECK-NEXT:    [[A:%.*]] = and i32 %x, 7
7; CHECK-NEXT:    [[B:%.*]] = and i32 %y, 7
8; CHECK-NEXT:    [[C:%.*]] = mul nuw nsw i32 [[A]], [[B]]
9; CHECK-NEXT:    [[D:%.*]] = shl nuw i32 [[C]], 26
10; CHECK-NEXT:    [[E:%.*]] = ashr exact i32 [[D]], 26
11; CHECK-NEXT:    ret i32 [[E]]
12;
13  %a = and i32 %x, 7
14  %b = and i32 %y, 7
15  %c = mul i32 %a, %b
16  %d = shl i32 %c, 26
17  %e = ashr i32 %d, 26
18  ret i32 %e
19}
20