[llvm] 0fc4147 - [RISCV] Add test coverage for mul X, C where C=2^N*(3,5,9)*(3,5,9)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 14:37:57 PDT 2024
Author: Philip Reames
Date: 2024-09-10T14:37:33-07:00
New Revision: 0fc4147c6d0c5bfb1fd9ed2a9f1c3a70e9281813
URL: https://github.com/llvm/llvm-project/commit/0fc4147c6d0c5bfb1fd9ed2a9f1c3a70e9281813
DIFF: https://github.com/llvm/llvm-project/commit/0fc4147c6d0c5bfb1fd9ed2a9f1c3a70e9281813.diff
LOG: [RISCV] Add test coverage for mul X, C where C=2^N*(3,5,9)*(3,5,9)
Added:
Modified:
llvm/test/CodeGen/RISCV/rv64zba.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/RISCV/rv64zba.ll b/llvm/test/CodeGen/RISCV/rv64zba.ll
index 62595fd4a7ad69..19d7324eeff4a1 100644
--- a/llvm/test/CodeGen/RISCV/rv64zba.ll
+++ b/llvm/test/CodeGen/RISCV/rv64zba.ll
@@ -569,6 +569,60 @@ define i64 @addmul72(i64 %a, i64 %b) {
ret i64 %d
}
+define i64 @mul50(i64 %a) {
+; CHECK-LABEL: mul50:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a1, 50
+; CHECK-NEXT: mul a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 50
+ ret i64 %c
+}
+
+define i64 @addmul50(i64 %a, i64 %b) {
+; CHECK-LABEL: addmul50:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a2, 50
+; CHECK-NEXT: mul a0, a0, a2
+; CHECK-NEXT: add a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 50
+ %d = add i64 %c, %b
+ ret i64 %d
+}
+
+define i64 @mul100(i64 %a) {
+; CHECK-LABEL: mul100:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a1, 100
+; CHECK-NEXT: mul a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 100
+ ret i64 %c
+}
+
+define i64 @addmul100(i64 %a, i64 %b) {
+; CHECK-LABEL: addmul100:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a2, 100
+; CHECK-NEXT: mul a0, a0, a2
+; CHECK-NEXT: add a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 100
+ %d = add i64 %c, %b
+ ret i64 %d
+}
+
+define i64 @mul162(i64 %a) {
+; CHECK-LABEL: mul162:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a1, 162
+; CHECK-NEXT: mul a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 162
+ ret i64 %c
+}
+
define i64 @addmul162(i64 %a, i64 %b) {
; CHECK-LABEL: addmul162:
; CHECK: # %bb.0:
@@ -581,6 +635,16 @@ define i64 @addmul162(i64 %a, i64 %b) {
ret i64 %d
}
+define i64 @mul180(i64 %a) {
+; CHECK-LABEL: mul180:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a1, 180
+; CHECK-NEXT: mul a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 180
+ ret i64 %c
+}
+
define i64 @addmul180(i64 %a, i64 %b) {
; CHECK-LABEL: addmul180:
; CHECK: # %bb.0:
@@ -605,6 +669,27 @@ define i64 @add255mul180(i64 %a) {
ret i64 %d
}
+define i64 @mul200(i64 %a) {
+; CHECK-LABEL: mul200:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a1, 200
+; CHECK-NEXT: mul a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 200
+ ret i64 %c
+}
+
+define i64 @addmul200(i64 %a, i64 %b) {
+; CHECK-LABEL: addmul200:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a2, 200
+; CHECK-NEXT: mul a0, a0, a2
+; CHECK-NEXT: add a0, a0, a1
+; CHECK-NEXT: ret
+ %c = mul i64 %a, 200
+ %d = add i64 %c, %b
+ ret i64 %d
+}
define i64 @addmul4096(i64 %a, i64 %b) {
; CHECK-LABEL: addmul4096:
More information about the llvm-commits
mailing list