llvm-project/llvm/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll
Bjorn Pettersson acdc419c89 [test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119081
2022-02-07 14:26:59 +01:00

17 lines
423 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=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
}