[llvm] [RISC-V][MC] Validate instructions prior to emission in AsmParser (PR #171739)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 16:18:46 PST 2025


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 128544 tests passed
* 2805 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### LLVM
<details>
<summary>LLVM.MC/RISCV/rv32p-valid.s</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s -triple=riscv32 -mattr=+experimental-p -M no-aliases -show-encoding      | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s' -triple=riscv32 -mattr=+experimental-p -M no-aliases -show-encoding
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s:705:1: error: PWADDA_H operand 1 register X6 is not a member of register class GPRPair
# | # CHECK-ASM-AND-OBJ: wadda s2, t1, a0
# | ^
# | LLVM ERROR: Attempting to emit invalid instruction. Incorrect pseudo expansion?
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\llvm-mc.exe C:\\_work\\llvm-project\\llvm-project\\llvm\\test\\MC\\RISCV\\rv32p-valid.s -triple=riscv32 -mattr=+experimental-p -M no-aliases -show-encoding
# | Exception Code: 0xC000001D
# |  #0 0x00007ff7244bd526 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x74d526)
# |  #1 0x00007ffb16b9bb04 (C:\Windows\System32\ucrtbase.dll+0x7bb04)
# |  #2 0x00007ffb16b9cad1 (C:\Windows\System32\ucrtbase.dll+0x7cad1)
# |  #3 0x00007ff72418c72b (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x41c72b)
# |  #4 0x00007ff72418c525 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x41c525)
# |  #5 0x00007ff72418c80b (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x41c80b)
# |  #6 0x00007ff723f05143 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x195143)
# |  #7 0x00007ff723ef7099 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x187099)
# |  #8 0x00007ff724147fb1 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x3d7fb1)
# |  #9 0x00007ff72413a2ab (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x3ca2ab)
# | #10 0x00007ff724132601 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x3c2601)
# | #11 0x00007ff723d783a7 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x83a7)
# | #12 0x00007ff723d76cba (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x6cba)
# | #13 0x00007ff7245e46a0 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x8746a0)
# | #14 0x00007ffb20214cb0 (C:\Windows\System32\KERNEL32.DLL+0x14cb0)
# | #15 0x00007ffb2c2dedcb (C:\Windows\SYSTEM32\ntdll.dll+0x7edcb)
# `-----------------------------
# error: command failed with exit status: 0xc000001d
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ 'C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s:679:14: error: CHECK-ASM: expected string not found in input
# | # CHECK-ASM: encoding: [0x1b,0x27,0xe6,0x4b]
# |              ^
# | <stdin>:226:21: note: scanning from here
# |  pwsla.hs a4, a2, t5 
# |                     ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\MC\RISCV\rv32p-valid.s
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |          221:  plui.dh tp, -412 # encoding: [0x1b,0x22,0x99,0x70] 
# |          222:  pwsll.bs t3, t1, s0 # encoding: [0x1b,0x2e,0x83,0x08] 
# |          223:  pwsll.hs s0, a4, t1 # encoding: [0x1b,0x24,0x67,0x0a] 
# |          224:  wsll a0, s0, s2 # encoding: [0x1b,0x25,0x24,0x0f] 
# |          225:  pwsla.bs s0, s0, s0 # encoding: [0x1b,0x24,0x84,0x48] 
# |          226:  pwsla.hs a4, a2, t5 
# | check:679                         X error: no match found
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/171739


More information about the llvm-commits mailing list