From 08bdff862ca6acf749ac5ddda97f5f15e0f619e1 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Fri, 3 Mar 2023 11:46:01 +0000 Subject: [PATCH] [AMDGPU] Fix error message for illegal copy --- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 2 +- .../CodeGen/AMDGPU/illegal-sgpr-to-vgpr-copy.ll | 14 +++++++------- .../test/CodeGen/AMDGPU/lo16-hi16-illegal-copy.mir | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp index 669c6e07a0e3..d75abd8fed75 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -537,7 +537,7 @@ static void reportIllegalCopy(const SIInstrInfo *TII, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc, - const char *Msg = "illegal SGPR to VGPR copy") { + const char *Msg = "illegal VGPR to SGPR copy") { MachineFunction *MF = MBB.getParent(); DiagnosticInfoUnsupported IllegalCopy(MF->getFunction(), Msg, DL, DS_Error); LLVMContext &C = MF->getFunction().getContext(); diff --git a/llvm/test/CodeGen/AMDGPU/illegal-sgpr-to-vgpr-copy.ll b/llvm/test/CodeGen/AMDGPU/illegal-sgpr-to-vgpr-copy.ll index 10adc3f3af9a..0ff7c19d8d7c 100644 --- a/llvm/test/CodeGen/AMDGPU/illegal-sgpr-to-vgpr-copy.ll +++ b/llvm/test/CodeGen/AMDGPU/illegal-sgpr-to-vgpr-copy.ll @@ -1,7 +1,7 @@ ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck -check-prefix=ERR %s ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck -check-prefix=GCN %s -; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_i32 void (): illegal VGPR to SGPR copy ; GCN: ; illegal copy v1 to s9 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_i32() #0 { @@ -10,7 +10,7 @@ define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_i32() #0 { ret void } -; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v2i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v2i32 void (): illegal VGPR to SGPR copy ; GCN: ; illegal copy v[0:1] to s[10:11] define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v2i32() #0 { %vgpr = call <2 x i32> asm sideeffect "; def $0", "=${v[0:1]}"() @@ -18,7 +18,7 @@ define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v2i32() #0 { ret void } -; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v4i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v4i32 void (): illegal VGPR to SGPR copy ; GCN: ; illegal copy v[0:3] to s[8:11] define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v4i32() #0 { %vgpr = call <4 x i32> asm sideeffect "; def $0", "=${v[0:3]}"() @@ -26,7 +26,7 @@ define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v4i32() #0 { ret void } -; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v8i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v8i32 void (): illegal VGPR to SGPR copy ; GCN: ; illegal copy v[0:7] to s[8:15] define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v8i32() #0 { %vgpr = call <8 x i32> asm sideeffect "; def $0", "=${v[0:7]}"() @@ -34,7 +34,7 @@ define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v8i32() #0 { ret void } -; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v16i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_vgpr_to_sgpr_copy_v16i32 void (): illegal VGPR to SGPR copy ; GCN: ; illegal copy v[0:15] to s[16:31] define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v16i32() #0 { %vgpr = call <16 x i32> asm sideeffect "; def $0", "=${v[0:15]}"() @@ -42,7 +42,7 @@ define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v16i32() #0 { ret void } -; ERR: error: :0:0: in function illegal_agpr_to_sgpr_copy_i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_agpr_to_sgpr_copy_i32 void (): illegal VGPR to SGPR copy ; GCN: v_accvgpr_read_b32 [[COPY1:v[0-9]+]], a1 ; GCN: ; illegal copy [[COPY1]] to s9 define amdgpu_kernel void @illegal_agpr_to_sgpr_copy_i32() #1 { @@ -51,7 +51,7 @@ define amdgpu_kernel void @illegal_agpr_to_sgpr_copy_i32() #1 { ret void } -; ERR: error: :0:0: in function illegal_agpr_to_sgpr_copy_v2i32 void (): illegal SGPR to VGPR copy +; ERR: error: :0:0: in function illegal_agpr_to_sgpr_copy_v2i32 void (): illegal VGPR to SGPR copy ; GCN-DAG: v_accvgpr_read_b32 v[[COPY1L:[0-9]+]], a0 ; GCN-DAG: v_accvgpr_read_b32 v[[COPY1H:[0-9]+]], a1 ; GCN: ; illegal copy v[[[COPY1L]]:[[COPY1H]]] to s[10:11] diff --git a/llvm/test/CodeGen/AMDGPU/lo16-hi16-illegal-copy.mir b/llvm/test/CodeGen/AMDGPU/lo16-hi16-illegal-copy.mir index c8d52659a1f0..81449347d578 100644 --- a/llvm/test/CodeGen/AMDGPU/lo16-hi16-illegal-copy.mir +++ b/llvm/test/CodeGen/AMDGPU/lo16-hi16-illegal-copy.mir @@ -7,7 +7,7 @@ # GCN-LABEL: {{^}}lo_to_lo_illegal_vgpr_to_sgpr: # GCN: ; illegal copy v0.l to s1.l -# ERR: error: :0:0: in function lo_to_lo_illegal_vgpr_to_sgpr void (): illegal SGPR to VGPR copy +# ERR: error: :0:0: in function lo_to_lo_illegal_vgpr_to_sgpr void (): illegal VGPR to SGPR copy name: lo_to_lo_illegal_vgpr_to_sgpr tracksRegLiveness: true body: | @@ -32,7 +32,7 @@ body: | # GCN-LABEL: {{^}}lo_to_lo_illegal_agpr_to_sgpr: # GCN: ; illegal copy a0.l to s1.l -# ERR: error: :0:0: in function lo_to_lo_illegal_agpr_to_sgpr void (): illegal SGPR to VGPR copy +# ERR: error: :0:0: in function lo_to_lo_illegal_agpr_to_sgpr void (): illegal VGPR to SGPR copy name: lo_to_lo_illegal_agpr_to_sgpr tracksRegLiveness: true body: | -- 2.34.1