[PATCH] D133492: [AMDGPU][MC][GFX11][NFC] Correct VOPD parsing

Dmitry Preobrazhensky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 07:08:20 PDT 2022


dp created this revision.
dp added reviewers: Joe_Nash, foad.
Herald added subscribers: kosarev, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
dp requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Instruction opcode for the Y operation is currently stored as an expression operand. This may cause incorrect detection of error position by `getLitLoc`. Currently, it does not because VOPD instructions are not validated by the parser.

This change is required for VOPD validation which is WIP.


https://reviews.llvm.org/D133492

Files:
  llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp


Index: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -8378,9 +8378,9 @@
     lex();
     lex();
     Operands.push_back(AMDGPUOperand::CreateToken(this, "::", S));
-    const MCExpr *Expr;
-    if (isToken(AsmToken::Identifier) && !Parser.parseExpression(Expr)) {
-      Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
+    StringRef OpYName;
+    if (isToken(AsmToken::Identifier) && !Parser.parseIdentifier(OpYName)) {
+      Operands.push_back(AMDGPUOperand::CreateToken(this, OpYName, S));
       return MatchOperand_Success;
     }
     Error(S, "invalid VOPD :: usage");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133492.458718.patch
Type: text/x-patch
Size: 783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220908/dddfe418/attachment.bin>


More information about the llvm-commits mailing list