[llvm] 162aed4 - [test] precommit test for D109786

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 15:28:37 PDT 2021


Author: Philip Reames
Date: 2021-09-14T15:28:26-07:00
New Revision: 162aed482403a4a7d54930d73a4d74e69e1e79db

URL: https://github.com/llvm/llvm-project/commit/162aed482403a4a7d54930d73a4d74e69e1e79db
DIFF: https://github.com/llvm/llvm-project/commit/162aed482403a4a7d54930d73a4d74e69e1e79db.diff

LOG: [test] precommit test for D109786

Added: 
    llvm/test/Analysis/ScalarEvolution/mul.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/ScalarEvolution/mul.ll b/llvm/test/Analysis/ScalarEvolution/mul.ll
new file mode 100644
index 000000000000..7505b6a8839c
--- /dev/null
+++ b/llvm/test/Analysis/ScalarEvolution/mul.ll
@@ -0,0 +1,58 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
+
+define i8 @test(i8 %x, i8 %y) {
+; CHECK-LABEL: 'test'
+; CHECK-NEXT:  Classifying expressions for: @test
+; CHECK-NEXT:    %udiv = udiv i8 %x, %y
+; CHECK-NEXT:    --> (%x /u %y) U: full-set S: full-set
+; CHECK-NEXT:    %res = mul i8 %udiv, %y
+; CHECK-NEXT:    --> ((%x /u %y) * %y) U: full-set S: full-set
+; CHECK-NEXT:  Determining loop execution counts for: @test
+;
+  %udiv = udiv i8 %x, %y
+  %res = mul i8 %udiv, %y
+  ret i8 %res
+}
+
+define i8 @test2(i8 %x) {
+; CHECK-LABEL: 'test2'
+; CHECK-NEXT:  Classifying expressions for: @test2
+; CHECK-NEXT:    %udiv = udiv i8 %x, 2
+; CHECK-NEXT:    --> (%x /u 2) U: [0,-128) S: [0,-128)
+; CHECK-NEXT:    %res = mul i8 %udiv, 2
+; CHECK-NEXT:    --> (2 * (%x /u 2))<nuw> U: [0,-1) S: [-128,127)
+; CHECK-NEXT:  Determining loop execution counts for: @test2
+;
+  %udiv = udiv i8 %x, 2
+  %res = mul i8 %udiv, 2
+  ret i8 %res
+}
+
+define i8 @test3(i8 %x) {
+; CHECK-LABEL: 'test3'
+; CHECK-NEXT:  Classifying expressions for: @test3
+; CHECK-NEXT:    %udiv = udiv i8 %x, -128
+; CHECK-NEXT:    --> (%x /u -128) U: [0,2) S: [0,2)
+; CHECK-NEXT:    %res = mul i8 %udiv, -128
+; CHECK-NEXT:    --> (-128 * (%x /u -128))<nuw><nsw> U: [0,-127) S: [-128,1)
+; CHECK-NEXT:  Determining loop execution counts for: @test3
+;
+  %udiv = udiv i8 %x, 128
+  %res = mul i8 %udiv, 128
+  ret i8 %res
+}
+
+define i8 @test4(i8 %x) {
+; CHECK-LABEL: 'test4'
+; CHECK-NEXT:  Classifying expressions for: @test4
+; CHECK-NEXT:    %udiv = udiv i8 %x, -1
+; CHECK-NEXT:    --> (%x /u -1) U: [0,2) S: [0,2)
+; CHECK-NEXT:    %res = mul i8 %udiv, -1
+; CHECK-NEXT:    --> (-1 * (%x /u -1))<nuw><nsw> U: [-1,1) S: [-1,1)
+; CHECK-NEXT:  Determining loop execution counts for: @test4
+;
+  %udiv = udiv i8 %x, 255
+  %res = mul i8 %udiv, 255
+  ret i8 %res
+}


        


More information about the llvm-commits mailing list