InstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is positive.
[oota-llvm.git] / test / Transforms / InstCombine / shift.ll
index 871e9fe070e7a27d740d40b728845b2d2343d604..6bebca9cc85f6ea79662eff5cbf8dcead99605ba 100644 (file)
@@ -441,3 +441,14 @@ entry:
 ; CHECK:  %ins = or i128 %tmp23, %A
 ; CHECK:  %tmp46 = trunc i128 %ins to i64
 }
+
+define i32 @test38(i32 %x) nounwind readnone {
+entry:
+  %rem = srem i32 %x, 32
+  %shl = shl i32 1, %rem
+  ret i32 %shl
+; CHECK: @test38
+; CHECK-NOT: srem
+; CHECK: ret i32
+}
+