From: Craig Topper Date: Sat, 20 Feb 2021 21:48:18 +0000 (-0800) Subject: [RISCV] Add another test case showing failure to use remw when the RHS has been zero... X-Git-Tag: llvmorg-14-init~14498 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=038bd14712d149cb51a8e95eb7bbdcfa7753a555;p=platform%2Fupstream%2Fllvm.git [RISCV] Add another test case showing failure to use remw when the RHS has been zero extended from less than i32. NFC --- diff --git a/llvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll b/llvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll index a60714f..c5b5472 100644 --- a/llvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll +++ b/llvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll @@ -1123,6 +1123,18 @@ define signext i32 @sext_i32_remw_zext_sext_i16(i16 zeroext %0, i16 signext %1) ret i32 %5 } +define signext i32 @sext_i32_remw_sext_zext_i16(i16 signext %a, i16 zeroext %b) nounwind { +; RV64IM-LABEL: sext_i32_remw_sext_zext_i16: +; RV64IM: # %bb.0: +; RV64IM-NEXT: rem a0, a0, a1 +; RV64IM-NEXT: sext.w a0, a0 +; RV64IM-NEXT: ret + %1 = sext i16 %a to i32 + %2 = zext i16 %b to i32 + %3 = srem i32 %1, %2 + ret i32 %3 +} + define i32 @aext_remuw_aext_aext(i32 %a, i32 %b) nounwind { ; RV64IM-LABEL: aext_remuw_aext_aext: ; RV64IM: # %bb.0: