Skip to content

Commit 2b58458

Browse files
[MIRLexer][RISCV] Eat a space after the Machine comment (#115365)
The MIRPrinter emits ` :: ` at the start of a MMO. The MIRLexer eats all the white space after the operand and before the `::` when there is no comment. We need to eat the space after the comment to allow MIRLexer to parse comments on a MMO.
1 parent 750247b commit 2b58458

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

llvm/lib/CodeGen/MIRParser/MILexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ StringRef llvm::lexMIToken(StringRef Source, MIToken &Token,
726726
return C.remaining();
727727
}
728728

729-
C = skipMachineOperandComment(C);
729+
C = skipWhitespace(skipMachineOperandComment(C));
730730

731731
if (Cursor R = maybeLexMachineBasicBlock(C, Token, ErrorCallback))
732732
return R.remaining();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# RUN: llc %s -mtriple=riscv64 -mattr=+v -run-pass=none -o - | FileCheck %s
2+
3+
---
4+
name: test_vse8
5+
tracksRegLiveness: true
6+
body: |
7+
bb.0:
8+
; CHECK-LABEL: name: test_vse8{{$}}
9+
; CHECK: PseudoVSE8_V_MF8 %1, %2, %0, 3 /* e8 */ :: (store unknown-size, align 1)
10+
liveins: $x10, $v8, $x11
11+
12+
%0:gprnox0 = COPY $x11
13+
%1:vr = COPY $v8
14+
%2:gpr = COPY $x10
15+
PseudoVSE8_V_MF8 %1, %2, %0, 3 /* e8 */ :: (store unknown-size, align 1)
16+
PseudoRET
17+
...

0 commit comments

Comments
 (0)