mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 17:36:06 +00:00

Print source location info and demangle the name, compared to the default behavior. Several observations: 1. Specially handling this seems to give source locations without enabling debug info, and also gives columns compared to the backend diagnostic. 2. We're duplicating diagnostic effort in DiagnosticInfo and clang. This feels wrong, but clang can demangle and I guess have better debug info available? Should clang really have any of this code? For the purposes of this diagnostic, the important piece is just reading the source location out of the llvm::Function. 3. lld is not duplicating the same effort as clang with LTO, and just directly printing the DiagnosticInfo as-is. e.g. $ clang -fgpu-rdc lld: error: local memory (480000) exceeds limit (65536) in function '_Z12use_huge_ldsIiEvv' lld: error: local memory (960000) exceeds limit (65536) in function '_Z12use_huge_ldsIdEvv' $ clang -fno-gpu-rdc backend-resource-limit-diagnostics.hip:8:17: error: local memory (480000) exceeds limit (65536) in 'void use_huge_lds<int>()' __global__ void use_huge_lds() { ^ backend-resource-limit-diagnostics.hip:8:17: error: local memory (960000) exceeds limit (65536) in 'void use_huge_lds<double>()' 2 errors generated when compiling for gfx90a. 4. Backend errors are not observed with -save-temps and -fno-gpu-rdc or -flto, and the compile incorrectly succeeds. 5. The backend version prints error: <location info>; clang prints <location info>: error: 6. -emit-codegen-only is totally broken for AMDGPU. MC gets a null target streamer. I do not understand why this is a thing. This just creates a horrible edge case. Just work around this by emitting actual code instead of blocking this patch.
9 lines
317 B
Common Lisp
9 lines
317 B
Common Lisp
// REQUIRES: amdgpu-registered-target
|
|
// RUN: not %clang_cc1 -x cl -emit-codegen-only -triple=amdgcn-- < %s 2>&1 | FileCheck %s
|
|
|
|
// CHECK: <stdin>:[[@LINE+1]]:13: error: local memory (480000) exceeds limit (32768) in 'use_huge_lds'
|
|
kernel void use_huge_lds() {
|
|
volatile local int huge[120000];
|
|
huge[0] = 2;
|
|
}
|