[llvm] 3c37f92 - [RISCV] Fix comment in compress-opt-branch.ll to match description. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 5 11:52:53 PDT 2024
Author: Craig Topper
Date: 2024-04-05T11:52:46-07:00
New Revision: 3c37f926a153d38852d593c4a7f9062e72ee4b2f
URL: https://github.com/llvm/llvm-project/commit/3c37f926a153d38852d593c4a7f9062e72ee4b2f
DIFF: https://github.com/llvm/llvm-project/commit/3c37f926a153d38852d593c4a7f9062e72ee4b2f.diff
LOG: [RISCV] Fix comment in compress-opt-branch.ll to match description. NFC
Test description says constant does not fit in 12 bits, but the constant
used was -2048 which does fit in 12 bits. Update to -2049.
Also remove uses of -NOT in favor of positive checks. One of the -NOT
should have been using RESBROPT instead of "c.beqz" so that it would
check for the absense of the correct instruction based on the sed
replacement on the RUN line.
Added:
Modified:
llvm/test/CodeGen/RISCV/compress-opt-branch.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/RISCV/compress-opt-branch.ll b/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
index b6ae6419c4cd05..354f180b45a990 100644
--- a/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
+++ b/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
@@ -270,9 +270,14 @@ if.end:
; constant is big and do not fit in 12 bit (imm), fit in i32
; RV32IFDC-LABEL: <f_big_ledge_pos>:
-; RV32IFDC-NOT: RESBROPT
+; RV32IFDC: c.li [[REG:.*]], 0x1
+; RV32IFDC: c.slli [[REG]], 0xb
+; RV32IFDC: RESBRNORMAL [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
; --- no compress extension
-; nothing to check.
+; RV32IFD-LABEL: <f_big_ledge_pos>:
+; RV32IFD: addi [[REG1:.*]], zero, 0x1
+; RV32IFD: slli [[REG2:.*]], [[REG1]], 0xb
+; RV32IFD: RESBRNORMAL [[ANOTHER:.*]], [[REG2]], [[PLACE:.*]]
define i32 @f_big_ledge_pos(i32 %in0) minsize {
%cmp = icmp CMPCOND i32 %in0, 2048
br i1 %cmp, label %if.then, label %if.else
@@ -290,11 +295,16 @@ if.end:
; constant is big and do not fit in 12 bit (imm), fit in i32
; RV32IFDC-LABEL: <f_big_ledge_neg>:
-; RV32IFDC-NOT: c.beqz
+; RV32IFDC: c.lui [[REG1:.*]], 0xfffff
+; RV32IFDC: addi [[REG2:.*]], [[REG1]], 0x7ff
+; RV32IFDC: RESBRNORMAL [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
; --- no compress extension
-; nothing to check.
+; RV32IFD-LABEL: <f_big_ledge_neg>:
+; RV32IFD: lui [[REG1:.*]], 0xfffff
+; RV32IFD: addi [[REG2:.*]], [[REG1]], 0x7ff
+; RV32IFD: RESBRNORMAL [[ANOTHER:.*]], [[REG2]], [[PLACE:.*]]
define i32 @f_big_ledge_neg(i32 %in0) minsize {
- %cmp = icmp CMPCOND i32 %in0, -2048
+ %cmp = icmp CMPCOND i32 %in0, -2049
br i1 %cmp, label %if.then, label %if.else
if.then:
%call = shl i32 %in0, 1
More information about the llvm-commits
mailing list