[PATCH] D124099: [AMDGPU][MC][NFC][GFX940] Corrected an error position
Dmitry Preobrazhensky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 04:05:19 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG81af32b9a3ec: [AMDGPU][MC][NFC][GFX940] Corrected an error position (authored by dp).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124099/new/
https://reviews.llvm.org/D124099
Files:
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/test/MC/AMDGPU/gfx940_err_pos.s
Index: llvm/test/MC/AMDGPU/gfx940_err_pos.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AMDGPU/gfx940_err_pos.s
@@ -0,0 +1,14 @@
+// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx940 %s 2>&1 | FileCheck %s --implicit-check-not=error: --strict-whitespace
+
+//==============================================================================
+// instruction must not use sc0
+
+global_atomic_or v[0:1], v2, off sc1 nt sc0
+// CHECK: error: instruction must not use sc0
+// CHECK-NEXT:{{^}}global_atomic_or v[0:1], v2, off sc1 nt sc0
+// CHECK-NEXT:{{^}} ^
+
+global_atomic_or v[0:1], v2, off sc0 sc1 nt
+// CHECK: error: instruction must not use sc0
+// CHECK-NEXT:{{^}}global_atomic_or v[0:1], v2, off sc0 sc1 nt
+// CHECK-NEXT:{{^}} ^
Index: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -4394,7 +4394,8 @@
if (CPol & CPol::GLC) {
SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
StringRef CStr(S.getPointer());
- S = SMLoc::getFromPointer(&CStr.data()[CStr.find("glc")]);
+ S = SMLoc::getFromPointer(
+ &CStr.data()[CStr.find(isGFX940() ? "sc0" : "glc")]);
Error(S, isGFX940() ? "instruction must not use sc0"
: "instruction must not use glc");
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124099.424145.patch
Type: text/x-patch
Size: 1556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220421/6369e515/attachment-0001.bin>
More information about the llvm-commits
mailing list