[llvm] 3dd6d5b - [tests] Add coverage for different forms of X - urem X, Y
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 16 09:26:45 PST 2021
Author: Philip Reames
Date: 2021-11-16T09:26:34-08:00
New Revision: 3dd6d5b62825a558655182a970e9ca3bb90e00c8
URL: https://github.com/llvm/llvm-project/commit/3dd6d5b62825a558655182a970e9ca3bb90e00c8
DIFF: https://github.com/llvm/llvm-project/commit/3dd6d5b62825a558655182a970e9ca3bb90e00c8.diff
LOG: [tests] Add coverage for different forms of X - urem X, Y
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/urem-0.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/urem-0.ll b/llvm/test/Analysis/ScalarEvolution/urem-0.ll
index e1fa63c128d0..4d494725b1d9 100644
--- a/llvm/test/Analysis/ScalarEvolution/urem-0.ll
+++ b/llvm/test/Analysis/ScalarEvolution/urem-0.ll
@@ -44,3 +44,45 @@ define i8 @qux(i8 %a) {
%t3 = urem i8 %a, 2
ret i8 %t3
}
+
+define i32 @test_and_not(i32 %arg) {
+; CHECK-LABEL: 'test_and_not'
+; CHECK-NEXT: Classifying expressions for: @test_and_not
+; CHECK-NEXT: %andn = and i32 %arg, -8
+; CHECK-NEXT: --> (8 * (%arg /u 8))<nuw> U: [0,-7) S: [-2147483648,2147483641)
+; CHECK-NEXT: Determining loop execution counts for: @test_and_not
+;
+ %andn = and i32 %arg, -8
+ ret i32 %andn
+}
+
+define i32 @test_sub_urem(i32 %arg) {
+; CHECK-LABEL: 'test_sub_urem'
+; CHECK-NEXT: Classifying expressions for: @test_sub_urem
+; CHECK-NEXT: %urem = urem i32 %arg, 8
+; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8)
+; CHECK-NEXT: %sub = sub i32 %arg, %urem
+; CHECK-NEXT: --> ((-1 * (zext i3 (trunc i32 %arg to i3) to i32))<nsw> + %arg) U: full-set S: full-set
+; CHECK-NEXT: Determining loop execution counts for: @test_sub_urem
+;
+ %urem = urem i32 %arg, 8
+ %sub = sub i32 %arg, %urem
+ ret i32 %sub
+}
+
+define i32 @test_trunc_zext(i32 %arg) {
+; CHECK-LABEL: 'test_trunc_zext'
+; CHECK-NEXT: Classifying expressions for: @test_trunc_zext
+; CHECK-NEXT: %trunc = trunc i32 %arg to i3
+; CHECK-NEXT: --> (trunc i32 %arg to i3) U: full-set S: full-set
+; CHECK-NEXT: %zext = zext i3 %trunc to i32
+; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8)
+; CHECK-NEXT: %sub = sub i32 %arg, %zext
+; CHECK-NEXT: --> ((-1 * (zext i3 (trunc i32 %arg to i3) to i32))<nsw> + %arg) U: full-set S: full-set
+; CHECK-NEXT: Determining loop execution counts for: @test_trunc_zext
+;
+ %trunc = trunc i32 %arg to i3
+ %zext = zext i3 %trunc to i32
+ %sub = sub i32 %arg, %zext
+ ret i32 %sub
+}
More information about the llvm-commits
mailing list