1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Transforms/InstSimplify/rem.ll
Sanjay Patel 1ee8ccb61a [InstSimplify] regenerate checks using a script
I didn't notice any significant changes in the actual checks here;
all of these tests already used FileCheck, so a script can batch
update them in one shot.

This commit is just to show the value of automating this process: 
We have uniform formatting as opposed to a mish-mash of check
structure that changes based on individual prefs and the current
fashion. This makes it simpler to update when we find a bug or
make an enhancement.

llvm-svn: 264457
2016-03-25 20:12:25 +00:00

52 lines
1.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
define i32 @select1(i32 %x, i1 %b) {
; CHECK-LABEL: @select1(
; CHECK: ret i32 0
;
%rhs = select i1 %b, i32 %x, i32 1
%rem = srem i32 %x, %rhs
ret i32 %rem
}
define i32 @select2(i32 %x, i1 %b) {
; CHECK-LABEL: @select2(
; CHECK: ret i32 0
;
%rhs = select i1 %b, i32 %x, i32 1
%rem = urem i32 %x, %rhs
ret i32 %rem
}
define i32 @rem1(i32 %x, i32 %n) {
; CHECK-LABEL: @rem1(
; CHECK: [[MOD:%.*]] = srem i32 %x, %n
; CHECK-NEXT: ret i32 [[MOD]]
;
%mod = srem i32 %x, %n
%mod1 = srem i32 %mod, %n
ret i32 %mod1
}
define i32 @rem2(i32 %x, i32 %n) {
; CHECK-LABEL: @rem2(
; CHECK: [[MOD:%.*]] = urem i32 %x, %n
; CHECK-NEXT: ret i32 [[MOD]]
;
%mod = urem i32 %x, %n
%mod1 = urem i32 %mod, %n
ret i32 %mod1
}
define i32 @rem3(i32 %x, i32 %n) {
; CHECK-LABEL: @rem3(
; CHECK: [[MOD:%.*]] = srem i32 %x, %n
; CHECK-NEXT: [[MOD1:%.*]] = urem i32 [[MOD]], %n
; CHECK-NEXT: ret i32 [[MOD1]]
;
%mod = srem i32 %x, %n
%mod1 = urem i32 %mod, %n
ret i32 %mod1
}