[llvm] [TableGen][AsmMatcher] Fix optional operand mask indexing when HasMnemonicFirst is false (PR #176868)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 22 05:54:54 PST 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 168716 tests passed
* 3003 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### LLVM
<details>
<summary>LLVM.MC/AMDGPU/gfx10_asm_mimg.s</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-mc -triple=amdgcn -mcpu=gfx1010 -show-encoding /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefixes=GFX10 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-mc -triple=amdgcn -mcpu=gfx1010 -show-encoding /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s
# .---command stderr------------
# | llvm-mc: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallBitVector.h:462: bool llvm::SmallBitVector::operator[](unsigned int) const: Assertion `Idx < size() && "Out-of-bounds Bit access."' failed.
# | 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: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-mc -triple=amdgcn -mcpu=gfx1010 -show-encoding /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s
# | #0 0x0000000002d784e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:842:13
# | #1 0x0000000002d75c55 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
# | #2 0x0000000002d792a1 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:429:38
# | #3 0x00007bdde03a0330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# | #4 0x00007bdde03f9b2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
# | #5 0x00007bdde03a027e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
# | #6 0x00007bdde03838ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
# | #7 0x00007bdde038381b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
# | #8 0x00007bdde0396517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
# | #9 0x00000000027b6385 operator[] /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:297:5
# | #10 0x00000000027b6385 reference /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/BitVector.h:125:18
# | #11 0x00000000027b6385 operator[] /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/BitVector.h:465:12
# | #12 0x00000000027b6385 operator[] /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallBitVector.h:465:26
# | #13 0x00000000027b6385 (anonymous namespace)::AMDGPUAsmParser::convertToMCInst(unsigned int, llvm::MCInst&, unsigned int, llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand>>> const&, llvm::SmallBitVector const&, llvm::ArrayRef<unsigned int>) /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc:0:0
# | #14 0x00000000027b1cfc (anonymous namespace)::AMDGPUAsmParser::MatchInstructionImpl(llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand>>> const&, llvm::MCInst&, unsigned long&, llvm::FeatureBitset&, bool, unsigned int) /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc:117598:5
# | #15 0x000000000277d0a5 (anonymous namespace)::AMDGPUAsmParser::matchAndEmitInstruction(llvm::SMLoc, unsigned int&, llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand>>>&, llvm::MCStreamer&, unsigned long&, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:5783:28
# | #16 0x0000000002ce3e81 (anonymous namespace)::AsmParser::parseAndMatchAndEmitTargetInstruction((anonymous namespace)::ParseStatementInfo&, llvm::StringRef, llvm::AsmToken, llvm::SMLoc) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/MC/MCParser/AsmParser.cpp:2298:27
# | #17 0x0000000002cd7dde (anonymous namespace)::AsmParser::parseStatement((anonymous namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/MC/MCParser/AsmParser.cpp:2231:10
# | #18 0x0000000002cd0fa1 (anonymous namespace)::AsmParser::Run(bool, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/MC/MCParser/AsmParser.cpp:0:0
# | #19 0x0000000002735dfb AssembleInput(char const*, llvm::Target const*, llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo&, llvm::MCSubtargetInfo&, llvm::MCInstrInfo&, llvm::MCTargetOptions const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llvm-mc/llvm-mc.cpp:375:13
# | #20 0x0000000002734ad6 main /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llvm-mc/llvm-mc.cpp:0:0
# | #21 0x00007bdde03851ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #22 0x00007bdde038528b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #23 0x000000000272ec15 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-mc+0x272ec15)
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefixes=GFX10 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s:335:10: error: GFX10: expected string not found in input
# | ; GFX10: image_sample_c_d v[64:66], [v32, v16, v0, v2, v1, v4, v8, v12, v16, v17], s[4:11], s[100:103] dmask:0x7 dim:SQ_RSRC_IMG_3D ; encoding: [0x16,0x07,0xa8,0xf0,0x20,0x40,0x21,0x03,0x10,0x00,0x02,0x01,0x04,0x08,0x0c,0x10,0x11,0x00,0x00,0x00]
# | ^
# | <stdin>:220:178: note: scanning from here
# | image_sample_c_cl v[64:66], [v32, v16, v0, v2, v1], s[4:11], s[100:103] dmask:0x7 dim:SQ_RSRC_IMG_CUBE ; encoding: [0x1a,0x07,0xa4,0xf0,0x20,0x40,0x21,0x03,0x10,0x00,0x02,0x01]
# | ^
# |
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/MC/AMDGPU/gfx10_asm_mimg.s
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 215:
# | 216: image_sample_lz v[64:66], [v32, v16], s[4:11], s[100:103] dmask:0x7 dim:SQ_RSRC_IMG_1D_ARRAY ; encoding: [0x22,0x07,0x9c,0xf0,0x20,0x40,0x21,0x03,0x10,0x00,0x00,0x00]
# | 217:
# | 218: image_sample_c v[64:66], [v32, v16, v0, v2], s[4:11], s[100:103] dmask:0x7 dim:SQ_RSRC_IMG_CUBE ; encoding: [0x1a,0x07,0xa0,0xf0,0x20,0x40,0x21,0x03,0x10,0x00,0x02,0x00]
# | 219:
# | 220: image_sample_c_cl v[64:66], [v32, v16, v0, v2, v1], s[4:11], s[100:103] dmask:0x7 dim:SQ_RSRC_IMG_CUBE ; encoding: [0x1a,0x07,0xa4,0xf0,0x20,0x40,0x21,0x03,0x10,0x00,0x02,0x01]
# | check:335 X error: no match found
# | 221:
# | check:335 ~
# | 222: image_sample_c_d v[64:66], [v32, v16, v0, v2, v1, v4, v8, v12, v16, v17], s[4:11], s[100:103] d
# | check:335 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# 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/176868
More information about the llvm-commits
mailing list