summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/rem.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/rem.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/rem.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/rem.ll b/llvm/test/Transforms/InstCombine/rem.ll
index 7a7a134db9c..00c020fdae8 100644
--- a/llvm/test/Transforms/InstCombine/rem.ll
+++ b/llvm/test/Transforms/InstCombine/rem.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
define i64 @rem_signed(i64 %x1, i64 %y2) {
@@ -571,3 +572,24 @@ rem.is.unsafe:
ret i32 0
}
+define i32 @test22(i32 %A) {
+; CHECK-LABEL: @test22(
+; CHECK-NEXT: [[AND:%.*]] = and i32 [[A:%.*]], 2147483647
+; CHECK-NEXT: [[MUL:%.*]] = urem i32 [[AND]], 2147483647
+; CHECK-NEXT: ret i32 [[MUL]]
+;
+ %and = and i32 %A, 2147483647
+ %mul = srem i32 %and, 2147483647
+ ret i32 %mul
+}
+
+define <2 x i32> @test23(<2 x i32> %A) {
+; CHECK-LABEL: @test23(
+; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[A:%.*]], <i32 2147483647, i32 2147483647>
+; CHECK-NEXT: [[MUL:%.*]] = srem <2 x i32> [[AND]], <i32 2147483647, i32 2147483647>
+; CHECK-NEXT: ret <2 x i32> [[MUL]]
+;
+ %and = and <2 x i32> %A, <i32 2147483647, i32 2147483647>
+ %mul = srem <2 x i32> %and, <i32 2147483647, i32 2147483647>
+ ret <2 x i32> %mul
+}
OpenPOWER on IntegriCloud