[llvm] [AMDGPU] Validate barrier ID in S_BARRIER_SIGNAL_ISFIRST (PR #220101)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 14:57:06 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

<details>
<summary>Changes</summary>

Value user_cluster_barrier_id is not supported.


---

Patch is 59.21 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/220101.diff


7 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp (+5) 
- (modified) llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (+23) 
- (modified) llvm/lib/Target/AMDGPU/SOPInstructions.td (+1) 
- (added) llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll (+9) 
- (modified) llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll (+3-36) 
- (modified) llvm/test/MC/AMDGPU/gfx12_err.s (+224-222) 
- (added) llvm/test/MC/AMDGPU/gfx13_err.s (+5) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
index 123d9930fc49e..66b490c397dcc 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
@@ -159,6 +159,11 @@ bool AMDGPULowerIntrinsicsImpl::visitBarrier(IntrinsicInst &I) {
         (BarrierID >= AMDGPU::Barrier::NAMED_BARRIER_FIRST &&
          BarrierID <= AMDGPU::Barrier::NAMED_BARRIER_LAST))
       IsWorkgroupScope = true;
+    else if (I.getIntrinsicID() == Intrinsic::amdgcn_s_barrier_signal_isfirst &&
+             BarrierID == AMDGPU::Barrier::CLUSTER)
+      I.getFunction()->getContext().emitError(
+          "s_barrier_signal_isfirst does not support user_cluster_barrier_id "
+          "(-3)");
   } else {
     assert(I.getIntrinsicID() == Intrinsic::amdgcn_s_barrier);
     IsWorkgroupScope = true;
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index 81bcc4ffaa286..1804056e5f15b 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -1864,6 +1864,8 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
   bool validateTFE(const MCInst &Inst, const OperandVector &Operands);
   bool validateLdsDirect(const MCInst &Inst, const OperandVector &Operands);
   bool validateWMMA(const MCInst &Inst, const OperandVector &Operands);
+  bool validateClusterBarrierIsFirst(const MCInst &Inst,
+                                     const OperandVector &Operands);
   unsigned getConstantBusLimit(unsigned Opcode) const;
   bool usesConstantBus(const MCInst &Inst, unsigned OpIdx);
   bool isInlineConstant(const MCInst &Inst, unsigned OpIdx) const;
@@ -5585,6 +5587,24 @@ bool AMDGPUAsmParser::validateWMMA(const MCInst &Inst,
   return true;
 }
 
+bool AMDGPUAsmParser::validateClusterBarrierIsFirst(
+    const MCInst &Inst, const OperandVector &Operands) {
+  unsigned Opc = Inst.getOpcode();
+  if (Opc != AMDGPU::S_BARRIER_SIGNAL_ISFIRST_IMM_gfx12 &&
+      Opc != AMDGPU::S_BARRIER_SIGNAL_ISFIRST_IMM_gfx13)
+    return true;
+
+  int Src0Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src0);
+  int BarrierID = Inst.getOperand(Src0Idx).getImm();
+  if (BarrierID != AMDGPU::Barrier::CLUSTER)
+    return true;
+
+  Error(
+      getOperandLoc(Operands, Src0Idx),
+      "s_barrier_signal_isfirst does not support user_cluster_barrier_id (-3)");
+  return false;
+}
+
 bool AMDGPUAsmParser::validateInstruction(const MCInst &Inst, SMLoc IDLoc,
                                           const OperandVector &Operands) {
   if (!validateLdsDirect(Inst, Operands))
@@ -5716,6 +5736,9 @@ bool AMDGPUAsmParser::validateInstruction(const MCInst &Inst, SMLoc IDLoc,
   if (!validateWMMA(Inst, Operands)) {
     return false;
   }
+  if (!validateClusterBarrierIsFirst(Inst, Operands)) {
+    return false;
+  }
 
   return true;
 }
diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index 2c5a2b1f7d0d7..590a8bfaa701b 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -68,6 +68,7 @@ class SOP1_Real<bits<8> op, SOP1_Pseudo ps, string real_name = ps.Mnemonic> :
   let Uses               = ps.Uses;
   let Defs               = ps.Defs;
   let isConvergent       = ps.isConvergent;
+  let UseNamedOperandTable = ps.UseNamedOperandTable;
 
   // encoding
   bits<7> sdst;
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll
new file mode 100644
index 0000000000000..e55f578829ae4
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll
@@ -0,0 +1,9 @@
+; RUN: not llc -mtriple=amdgpu12.50 -filetype=null < %s 2>&1 | FileCheck -check-prefix=ERR %s
+
+; ERR: error: s_barrier_signal_isfirst does not support user_cluster_barrier_id (-3)
+
+define i1 @invalid_barrier_id() {
+  %r = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -3)
+  ret i1 %r
+}
+
diff --git a/llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll b/llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll
index 2f1eb6a63f519..4db05e14e8c34 100644
--- a/llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll
+++ b/llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll
@@ -5,39 +5,6 @@
 
 declare void @foo(i1)
 
-; Verify that the explicit use of a split cluster barrier isn't optimized away.
-define amdgpu_kernel void @split_barriers() "amdgpu-flat-work-group-size"="32,32" {
-; NOOPT-LABEL: define amdgpu_kernel void @split_barriers(
-; NOOPT-SAME: ) #[[ATTR0:[0-9]+]] {
-; NOOPT-NEXT:    call void @llvm.amdgcn.s.barrier.signal(i32 -3)
-; NOOPT-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -3)
-; NOOPT-NEXT:    [[ISFIRST:%.*]] = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -3)
-; NOOPT-NEXT:    call void @foo(i1 [[ISFIRST]])
-; NOOPT-NEXT:    ret void
-;
-; OPT-WAVE32-LABEL: define amdgpu_kernel void @split_barriers(
-; OPT-WAVE32-SAME: ) #[[ATTR1:[0-9]+]] {
-; OPT-WAVE32-NEXT:    call void @llvm.amdgcn.s.barrier.signal(i32 -3)
-; OPT-WAVE32-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -3)
-; OPT-WAVE32-NEXT:    [[ISFIRST:%.*]] = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -3)
-; OPT-WAVE32-NEXT:    call void @foo(i1 [[ISFIRST]])
-; OPT-WAVE32-NEXT:    ret void
-;
-; OPT-WAVE64-LABEL: define amdgpu_kernel void @split_barriers(
-; OPT-WAVE64-SAME: ) #[[ATTR1:[0-9]+]] {
-; OPT-WAVE64-NEXT:    call void @llvm.amdgcn.s.barrier.signal(i32 -3)
-; OPT-WAVE64-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -3)
-; OPT-WAVE64-NEXT:    [[ISFIRST:%.*]] = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -3)
-; OPT-WAVE64-NEXT:    call void @foo(i1 [[ISFIRST]])
-; OPT-WAVE64-NEXT:    ret void
-;
-  call void @llvm.amdgcn.s.barrier.signal(i32 -3)
-  call void @llvm.amdgcn.s.barrier.wait(i16 -3)
-  %isfirst = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -3)
-  call void @foo(i1 %isfirst)
-  ret void
-}
-
 define amdgpu_kernel void @s_cluster_barrier() {
 ; NOOPT-LABEL: define amdgpu_kernel void @s_cluster_barrier() {
 ; NOOPT-NEXT:    [[TMP1:%.*]] = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -1)
@@ -80,7 +47,7 @@ define amdgpu_kernel void @s_cluster_barrier() {
 
 define amdgpu_kernel void @s_cluster_barrier_wg32() "amdgpu-flat-work-group-size"="32,32" {
 ; NOOPT-LABEL: define amdgpu_kernel void @s_cluster_barrier_wg32(
-; NOOPT-SAME: ) #[[ATTR0]] {
+; NOOPT-SAME: ) #[[ATTR0:[0-9]+]] {
 ; NOOPT-NEXT:    [[TMP1:%.*]] = call i1 @llvm.amdgcn.s.barrier.signal.isfirst(i32 -1)
 ; NOOPT-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -1)
 ; NOOPT-NEXT:    br i1 [[TMP1]], label %[[BB2:.*]], label %[[BB3:.*]]
@@ -92,14 +59,14 @@ define amdgpu_kernel void @s_cluster_barrier_wg32() "amdgpu-flat-work-group-size
 ; NOOPT-NEXT:    ret void
 ;
 ; OPT-WAVE32-LABEL: define amdgpu_kernel void @s_cluster_barrier_wg32(
-; OPT-WAVE32-SAME: ) #[[ATTR1]] {
+; OPT-WAVE32-SAME: ) #[[ATTR1:[0-9]+]] {
 ; OPT-WAVE32-NEXT:    call void @llvm.amdgcn.wave.barrier()
 ; OPT-WAVE32-NEXT:    call void @llvm.amdgcn.s.barrier.signal(i32 -3)
 ; OPT-WAVE32-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -3)
 ; OPT-WAVE32-NEXT:    ret void
 ;
 ; OPT-WAVE64-LABEL: define amdgpu_kernel void @s_cluster_barrier_wg32(
-; OPT-WAVE64-SAME: ) #[[ATTR1]] {
+; OPT-WAVE64-SAME: ) #[[ATTR1:[0-9]+]] {
 ; OPT-WAVE64-NEXT:    call void @llvm.amdgcn.wave.barrier()
 ; OPT-WAVE64-NEXT:    call void @llvm.amdgcn.s.barrier.signal(i32 -3)
 ; OPT-WAVE64-NEXT:    call void @llvm.amdgcn.s.barrier.wait(i16 -3)
diff --git a/llvm/test/MC/AMDGPU/gfx12_err.s b/llvm/test/MC/AMDGPU/gfx12_err.s
index 56839390e0fb1..b4b08dbf677d1 100644
--- a/llvm/test/MC/AMDGPU/gfx12_err.s
+++ b/llvm/test/MC/AMDGPU/gfx12_err.s
@@ -1,665 +1,664 @@
-// NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 6
 // RUN: not llvm-mc -triple=amdgpu12.00 -filetype=null %s 2>&1 | FileCheck --check-prefixes=GFX12-ERR --implicit-check-not=error: -strict-whitespace %s
 
 v_cubesc_f32_e64_dpp v5, v1, v2, 12345678 row_shr:4 row_mask:0xf bank_mask:0xf
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:34: error: invalid operand for instruction
 
 v_add3_u32_e64_dpp v5, v1, v2, 49812340 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:32: error: invalid operand for instruction
 
 v_cvt_f32_i32_e64_dpp v5, s1 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 v_cvt_f32_i32_e64_dpp v5, s1 row_shl:15 row_mask:0xf bank_mask:0xf
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 v_cvt_f16_u16_e64_dpp v5, s1 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 v_cvt_f16_u16_e64_dpp v5, s1 row_shl:1 row_mask:0xf bank_mask:0xf
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 ; disallow space between colons
+
 v_dual_mul_f32 v0, v0, v2 : : v_dual_mul_f32 v1, v1, v3
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: unknown token in expression
+// GFX12-ERR: :[[@LINE-1]]:27: error: unknown token in expression
 
 v_dot4c_i32_i8 v0, v1, v2
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+// GFX12-ERR: :[[@LINE-1]]:1: error: instruction not supported on this GPU (gfx1200): v_dot4c_i32_i8
 
 v_cmp_class_f16_e64_dpp s105, s2, v2 row_ror:15
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:31: error: invalid operand for instruction
 
 v_cmpx_class_f32_e64_dpp s1, v2 dpp8:[7,6,5,4,3,2,1,0] fi:1
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:26: error: invalid operand for instruction
 
 v_fma_mix_f32_e64_dpp v5, s1, v3, v4 quad_perm:[3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 v_fma_mix_f32_e64_dpp v5, v1, s3, v4 quad_perm:[3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:31: error: invalid operand for instruction
 
 v_fma_mix_f32_e64_dpp v5, s1, v3, v4 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand for instruction
 
 v_fma_mix_f32_e64_dpp v5, v1, s3, v4 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:31: error: invalid operand for instruction
 
 v_fma_mixhi_f16_e64_dpp v5, v1, 0, v4 quad_perm:[3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:33: error: invalid operand for instruction
 
 v_fma_mixlo_f16_e64_dpp v5, v1, 1, v4 dpp8:[7,6,5,4,3,2,1,0]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:33: error: invalid operand for instruction
 
 v_lshlrev_b64 v[5:6], s2, s[0:1]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand (violates constant bus restrictions)
 
 v_lshrrev_b64 v[5:6], s2, s[0:1]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand (violates constant bus restrictions)
 
 v_ashrrev_i64 v[5:6], s2, s[0:1]
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
+// GFX12-ERR: :[[@LINE-1]]:27: error: invalid operand (violates constant bus restrictions)
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:0x7
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected an identifier
+// GFX12-ERR: :[[@LINE-1]]:59: error: expected an identifier
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_STORE_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for load instructions
+// GFX12-ERR: :[[@LINE-1]]:56: error: invalid th value for load instructions
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_ATOMIC_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for load instructions
+// GFX12-ERR: :[[@LINE-1]]:56: error: invalid th value for load instructions
 
 image_store v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_LOAD_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for store instructions
+// GFX12-ERR: :[[@LINE-1]]:57: error: invalid th value for store instructions
 
 image_store v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_ATOMIC_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for store instructions
+// GFX12-ERR: :[[@LINE-1]]:57: error: invalid th value for store instructions
 
 image_atomic_swap v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_LOAD_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for atomic instructions
+// GFX12-ERR: :[[@LINE-1]]:63: error: invalid th value for atomic instructions
 
 image_atomic_swap v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_STORE_NT
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value for atomic instructions
+// GFX12-ERR: :[[@LINE-1]]:63: error: invalid th value for atomic instructions
 
 image_store v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_STORE_LU
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value
+// GFX12-ERR: :[[@LINE-1]]:60: error: invalid th value
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_LOAD_WB
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value
+// GFX12-ERR: :[[@LINE-1]]:59: error: invalid th value
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_LOAD_NT_WB
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid th value
+// GFX12-ERR: :[[@LINE-1]]:59: error: invalid th value
 
 image_store v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_STORE_WB scope:SCOPE_SYS
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: scope and th combination is not valid
+// GFX12-ERR: :[[@LINE-1]]:57: error: scope and th combination is not valid
 
 image_store v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_STORE_BYPASS scope:SCOPE_DEV
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: scope and th combination is not valid
+// GFX12-ERR: :[[@LINE-1]]:57: error: scope and th combination is not valid
 
 s_load_b32 s5, s[4:5], s0 offset:0x0 th:TH_LOAD_NT_RT
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid th value for SMEM instruction
+// GFX12-ERR: :[[@LINE-1]]:38: error: invalid th value for SMEM instruction
 
 s_buffer_load_b64 s[10:11], s[4:7], s0 offset:0x0 th:TH_LOAD_RT_NT
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid th value for SMEM instruction
+// GFX12-ERR: :[[@LINE-1]]:51: error: invalid th value for SMEM instruction
 
 s_load_b128 s[20:23], s[2:3], vcc_lo th:TH_LOAD_NT_HT
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid th value for SMEM instruction
+// GFX12-ERR: :[[@LINE-1]]:38: error: invalid th value for SMEM instruction
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:TH_LOAD_HT scope:SCOPE_SE th:TH_LOAD_HT
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:85: error: invalid operand for instruction
 
 image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D scope:SCOPE_SE th:TH_LOAD_HT scope:SCOPE_SE
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:85: error: invalid operand for instruction
 
 s_prefetch_inst s[14:15], 0xffffff, m0, 7
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: expected a 24-bit signed offset
-// GFX12-ERR: s_prefetch_inst s[14:15], 0xffffff, m0, 7
-// GFX12-ERR:                           ^
+// GFX12-ERR: :[[@LINE-1]]:27: error: expected a 24-bit signed offset
 
 s_endpgm_ordered_ps_done
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+// GFX12-ERR: :[[@LINE-1]]:1: error: instruction not supported on this GPU (gfx1200): s_endpgm_ordered_ps_done
 
 s_barrier_signal 32
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:18: error: invalid operand for instruction
 
 s_barrier_signal -5
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:18: error: invalid operand for instruction
 
 s_barrier_signal 125
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:18: error: invalid operand for instruction
 
 s_barrier_signal 0.5
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:18: error: invalid operand for instruction
 
 s_alloc_vgpr v0
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:14: error: invalid operand for instruction
 
 s_alloc_vgpr exec
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:14: error: invalid operand for instruction
 
 s_alloc_vgpr vcc
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:14: error: invalid operand for instruction
 
 v_cvt_f32_fp8 v1, v3 clamp
-// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// GFX12-ERR: :[[@LINE-1]]:22: error: invalid operand for instruction
 
 buffer_load_dword v0, off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:39: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_dwordx2 v[0:1], off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:45: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_dwordx3 v[0:2], off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:45: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_dwordx4 v[0:3], off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:45: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_short_d16 v0, off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:43: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_format_d16_x v0, off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:46: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_format_d16_xy v0, off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:47: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_format_d16_xyz v[0:1], off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:52: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_format_d16_xyzw v[0:1], off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected a 23-bit unsigned offset for buffer ops
+// GFX12-ERR: :[[@LINE-1]]:53: error: expected a 23-bit unsigned offset for buffer ops
 
 buffer_load_short_d16_hi v0, off, s[4:7], s8 offset:-1
-// GFX12-ERR: [[@LINE-1]]:{{...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list