summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll
blob: 8730b4e08e60b2bc79462fc966bccffd1f4521fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
; PR3439

define i32 @a(i32 %x) nounwind {
; CHECK-LABEL: @a(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[REM:%.*]] = srem i32 [[X:%.*]], 2
; CHECK-NEXT:    [[AND:%.*]] = and i32 [[REM]], 2
; CHECK-NEXT:    ret i32 [[AND]]
;
entry:
  %rem = srem i32 %x, 2
  %and = and i32 %rem, 2
  ret i32 %and
}
OpenPOWER on IntegriCloud