Skip to content

Commit 3c37f92

Browse files
committed
[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.
1 parent 3989e22 commit 3c37f92

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

llvm/test/CodeGen/RISCV/compress-opt-branch.ll

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,14 @@ if.end:
270270

271271
; constant is big and do not fit in 12 bit (imm), fit in i32
272272
; RV32IFDC-LABEL: <f_big_ledge_pos>:
273-
; RV32IFDC-NOT: RESBROPT
273+
; RV32IFDC: c.li [[REG:.*]], 0x1
274+
; RV32IFDC: c.slli [[REG]], 0xb
275+
; RV32IFDC: RESBRNORMAL [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
274276
; --- no compress extension
275-
; nothing to check.
277+
; RV32IFD-LABEL: <f_big_ledge_pos>:
278+
; RV32IFD: addi [[REG1:.*]], zero, 0x1
279+
; RV32IFD: slli [[REG2:.*]], [[REG1]], 0xb
280+
; RV32IFD: RESBRNORMAL [[ANOTHER:.*]], [[REG2]], [[PLACE:.*]]
276281
define i32 @f_big_ledge_pos(i32 %in0) minsize {
277282
%cmp = icmp CMPCOND i32 %in0, 2048
278283
br i1 %cmp, label %if.then, label %if.else
@@ -290,11 +295,16 @@ if.end:
290295

291296
; constant is big and do not fit in 12 bit (imm), fit in i32
292297
; RV32IFDC-LABEL: <f_big_ledge_neg>:
293-
; RV32IFDC-NOT: c.beqz
298+
; RV32IFDC: c.lui [[REG1:.*]], 0xfffff
299+
; RV32IFDC: addi [[REG2:.*]], [[REG1]], 0x7ff
300+
; RV32IFDC: RESBRNORMAL [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
294301
; --- no compress extension
295-
; nothing to check.
302+
; RV32IFD-LABEL: <f_big_ledge_neg>:
303+
; RV32IFD: lui [[REG1:.*]], 0xfffff
304+
; RV32IFD: addi [[REG2:.*]], [[REG1]], 0x7ff
305+
; RV32IFD: RESBRNORMAL [[ANOTHER:.*]], [[REG2]], [[PLACE:.*]]
296306
define i32 @f_big_ledge_neg(i32 %in0) minsize {
297-
%cmp = icmp CMPCOND i32 %in0, -2048
307+
%cmp = icmp CMPCOND i32 %in0, -2049
298308
br i1 %cmp, label %if.then, label %if.else
299309
if.then:
300310
%call = shl i32 %in0, 1

0 commit comments

Comments
 (0)