[llvm] e0fe8e6 - [RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 12:21:17 PST 2023


Author: Jessica Clarke
Date: 2023-03-03T20:14:31Z
New Revision: e0fe8e641258cf77fbca79f6c29120c41186db18

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

LOG: [RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w

Sign-extending the input is irrelevant to the test in question, which
merely needs some arbitrary input to switch on. This also removes the
only difference between the RV32I and RV64I cases for @below_threshold
and will allow unifying them.

Added: 
    

Modified: 
    llvm/test/CodeGen/RISCV/jumptable.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/RISCV/jumptable.ll b/llvm/test/CodeGen/RISCV/jumptable.ll
index 82983e2752486..5bb489ff93df3 100644
--- a/llvm/test/CodeGen/RISCV/jumptable.ll
+++ b/llvm/test/CodeGen/RISCV/jumptable.ll
@@ -8,7 +8,7 @@
 ; RUN: llc -mtriple=riscv64 -code-model=medium -verify-machineinstrs < %s \
 ; RUN:   | FileCheck %s -check-prefix=RV64I-MEDIUM
 
-define void @below_threshold(i32 %in, ptr %out) nounwind {
+define void @below_threshold(i32 signext %in, ptr %out) nounwind {
 ; RV32I-SMALL-LABEL: below_threshold:
 ; RV32I-SMALL:       # %bb.0: # %entry
 ; RV32I-SMALL-NEXT:    li a2, 2
@@ -75,7 +75,6 @@ define void @below_threshold(i32 %in, ptr %out) nounwind {
 ;
 ; RV64I-SMALL-LABEL: below_threshold:
 ; RV64I-SMALL:       # %bb.0: # %entry
-; RV64I-SMALL-NEXT:    sext.w a0, a0
 ; RV64I-SMALL-NEXT:    li a2, 2
 ; RV64I-SMALL-NEXT:    blt a2, a0, .LBB0_4
 ; RV64I-SMALL-NEXT:  # %bb.1: # %entry
@@ -108,7 +107,6 @@ define void @below_threshold(i32 %in, ptr %out) nounwind {
 ;
 ; RV64I-MEDIUM-LABEL: below_threshold:
 ; RV64I-MEDIUM:       # %bb.0: # %entry
-; RV64I-MEDIUM-NEXT:    sext.w a0, a0
 ; RV64I-MEDIUM-NEXT:    li a2, 2
 ; RV64I-MEDIUM-NEXT:    blt a2, a0, .LBB0_4
 ; RV64I-MEDIUM-NEXT:  # %bb.1: # %entry
@@ -161,7 +159,7 @@ exit:
   ret void
 }
 
-define void @above_threshold(i32 %in, ptr %out) nounwind {
+define void @above_threshold(i32 signext %in, ptr %out) nounwind {
 ; RV32I-SMALL-LABEL: above_threshold:
 ; RV32I-SMALL:       # %bb.0: # %entry
 ; RV32I-SMALL-NEXT:    addi a0, a0, -1
@@ -233,7 +231,6 @@ define void @above_threshold(i32 %in, ptr %out) nounwind {
 ;
 ; RV64I-SMALL-LABEL: above_threshold:
 ; RV64I-SMALL:       # %bb.0: # %entry
-; RV64I-SMALL-NEXT:    sext.w a0, a0
 ; RV64I-SMALL-NEXT:    addi a0, a0, -1
 ; RV64I-SMALL-NEXT:    li a2, 5
 ; RV64I-SMALL-NEXT:    bltu a2, a0, .LBB1_9
@@ -268,7 +265,6 @@ define void @above_threshold(i32 %in, ptr %out) nounwind {
 ;
 ; RV64I-MEDIUM-LABEL: above_threshold:
 ; RV64I-MEDIUM:       # %bb.0: # %entry
-; RV64I-MEDIUM-NEXT:    sext.w a0, a0
 ; RV64I-MEDIUM-NEXT:    addi a0, a0, -1
 ; RV64I-MEDIUM-NEXT:    li a2, 5
 ; RV64I-MEDIUM-NEXT:    bltu a2, a0, .LBB1_9


        


More information about the llvm-commits mailing list