Skip to content

[AMDGPU] Incorrect error message regarding SCC modifier #65660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4477,11 +4477,17 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
}

if (isGFX90A() && !isGFX940() && (CPol & CPol::SCC)) {
SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
StringRef CStr(S.getPointer());
S = SMLoc::getFromPointer(&CStr.data()[CStr.find("scc")]);
Error(S, "scc is not supported on this GPU");
return false;
const uint64_t AllowSCCModifier = SIInstrFlags::MUBUF |
SIInstrFlags::MTBUF | SIInstrFlags::MIMG |
SIInstrFlags::FLAT;
if (!(TSFlags & AllowSCCModifier)) {
SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
StringRef CStr(S.getPointer());
S = SMLoc::getFromPointer(&CStr.data()[CStr.find("scc")]);
Error(S,
"scc modifier is not supported for this instruction on this GPU");
return false;
}
}

if (!(TSFlags & (SIInstrFlags::IsAtomicNoRet | SIInstrFlags::IsAtomicRet)))
Expand Down
75 changes: 75 additions & 0 deletions llvm/test/MC/AMDGPU/gfx90a_asm_features.s
Original file line number Diff line number Diff line change
Expand Up @@ -1024,3 +1024,78 @@ global_atomic_add_f32 v1, v0, v2, s[0:1] glc ; encoding: [0x00,0x80,0x35,0xdd,0x
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_pk_add_f16 v0, v[0:1], v2, off glc ; encoding: [0x00,0x80,0x39,0xdd,0x00,0x02,0x7f,0x00]
global_atomic_pk_add_f16 v0, v[0:1], v2, off glc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_add_f32 v0, v[0:1], v2, off glc scc
global_atomic_add_f32 v0, v[0:1], v2, off glc scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_add_f32 v[0:1], v2, off scc
global_atomic_add_f32 v[0:1], v2, off scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_add_f32 v0, v2, s[0:1] scc
global_atomic_add_f32 v0, v2, s[0:1] scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_add_f32 v1, v0, v2, s[0:1] glc scc
global_atomic_add_f32 v1, v0, v2, s[0:1] glc scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_pk_add_f16 v0, v[0:1], v2, off glc scc
global_atomic_pk_add_f16 v0, v[0:1], v2, off glc scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: flat_atomic_add_f64 v[0:1], v[0:1], v[2:3] glc scc
flat_atomic_add_f64 v[0:1], v[0:1], v[2:3] glc scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: flat_atomic_add_f64 v[0:1], v[2:3] scc
flat_atomic_add_f64 v[0:1], v[2:3] scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: flat_atomic_min_f64 v[0:1], v[2:3] scc
flat_atomic_min_f64 v[0:1], v[2:3] scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: flat_atomic_max_f64 v[0:1], v[2:3] scc
flat_atomic_max_f64 v[0:1], v[2:3] scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_add_f64 v[0:1], v[2:3], off scc
global_atomic_add_f64 v[0:1], v[2:3], off scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_min_f64 v[0:1], v[2:3], off scc
global_atomic_min_f64 v[0:1], v[2:3], off scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: global_atomic_max_f64 v[0:1], v[2:3], off scc
global_atomic_max_f64 v[0:1], v[2:3], off scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: buffer_atomic_add_f32 v4, off, s[8:11], s3 scc
buffer_atomic_add_f32 v4, off, s[8:11], s3 scc

// GFX908: :[[@LINE+3]]:{{[0-9]+}}: error: scc modifier is not supported on this GPU
// GFX1010: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: buffer_atomic_pk_add_f16 v4, off, s[8:11], s3 scc
buffer_atomic_pk_add_f16 v4, off, s[8:11], s3 scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: buffer_atomic_add_f64 v[4:5], off, s[8:11], s3 scc
buffer_atomic_add_f64 v[4:5], off, s[8:11], s3 scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: buffer_atomic_max_f64 v[4:5], off, s[8:11], s3 scc
buffer_atomic_max_f64 v[4:5], off, s[8:11], s3 scc

// NOT-GFX90A: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
// GFX90A: buffer_atomic_min_f64 v[4:5], off, s[8:11], s3 scc
buffer_atomic_min_f64 v[4:5], off, s[8:11], s3 scc
51 changes: 0 additions & 51 deletions llvm/test/MC/AMDGPU/gfx90a_err.s
Original file line number Diff line number Diff line change
Expand Up @@ -195,57 +195,6 @@ image_sample_cd v[0:3], v[0:1], s[4:11], s[16:19] dmask:0xf
image_sample_b v[0:3], v[0:1], s[4:11], s[16:19] dmask:0xf
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU

global_atomic_add_f32 v0, v[0:1], v2, off glc scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_add_f32 v[0:1], v2, off scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_add_f32 v0, v2, s[0:1] scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_add_f32 v1, v0, v2, s[0:1] glc scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_pk_add_f16 v0, v[0:1], v2, off glc scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

flat_atomic_add_f64 v[0:1], v[0:1], v[2:3] glc scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

flat_atomic_add_f64 v[0:1], v[2:3] scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

flat_atomic_min_f64 v[0:1], v[2:3] scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

flat_atomic_max_f64 v[0:1], v[2:3] scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_add_f64 v[0:1], v[2:3], off scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_min_f64 v[0:1], v[2:3], off scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

global_atomic_max_f64 v[0:1], v[2:3], off scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

buffer_atomic_add_f32 v4, off, s[8:11], s3 scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

buffer_atomic_pk_add_f16 v4, off, s[8:11], s3 scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

buffer_atomic_add_f64 v[4:5], off, s[8:11], s3 scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

buffer_atomic_max_f64 v[4:5], off, s[8:11], s3 scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

buffer_atomic_min_f64 v[4:5], off, s[8:11], s3 scc
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: scc is not supported on this GPU

v_mov_b32_sdwa v1, src_lds_direct dst_sel:DWORD
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: lds_direct is not supported on this GPU

Expand Down