diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-09-13 20:36:13 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-13 20:36:13 +0000 |
| commit | ab40f9d0ef9d8e8afefce9a4f44239fa23e76250 (patch) | |
| tree | 4b03d3aa6d2a421c3b18af76f40cf69b17832bd9 /llvm | |
| parent | 024bb4b136d73c7b9032e953da39c7536f7cda00 (diff) | |
| download | bcm5719-llvm-ab40f9d0ef9d8e8afefce9a4f44239fa23e76250.tar.gz bcm5719-llvm-ab40f9d0ef9d8e8afefce9a4f44239fa23e76250.zip | |
add tests for PR28672
I'm not sure if we actually want to transform all of these in InstCombine yet,
so I'm not labeling these with FIXME.
llvm-svn: 281386
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/urem.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/urem.ll b/llvm/test/Transforms/InstCombine/urem.ll index 32aa033ce41..8990732e390 100644 --- a/llvm/test/Transforms/InstCombine/urem.ll +++ b/llvm/test/Transforms/InstCombine/urem.ll @@ -11,3 +11,33 @@ define i64 @rem_unsigned(i64 %x1, i64 %y2) { %r8 = sub i64 %x1, %r7 ret i64 %r8 } + +; PR28672 - https://llvm.org/bugs/show_bug.cgi?id=28672 + +define i8 @big_divisor(i8 %x) { +; CHECK-LABEL: @big_divisor( +; CHECK-NEXT: [[REM:%.*]] = urem i8 %x, -127 +; CHECK-NEXT: ret i8 [[REM]] +; + %rem = urem i8 %x, 129 + ret i8 %rem +} + +define i5 @biggest_divisor(i5 %x) { +; CHECK-LABEL: @biggest_divisor( +; CHECK-NEXT: [[REM:%.*]] = urem i5 %x, -1 +; CHECK-NEXT: ret i5 [[REM]] +; + %rem = urem i5 %x, -1 + ret i5 %rem +} + +define <2 x i4> @big_divisor_vec(<2 x i4> %x) { +; CHECK-LABEL: @big_divisor_vec( +; CHECK-NEXT: [[REM:%.*]] = urem <2 x i4> %x, <i4 -3, i4 -3> +; CHECK-NEXT: ret <2 x i4> [[REM]] +; + %rem = urem <2 x i4> %x, <i4 13, i4 13> + ret <2 x i4> %rem +} + |

