[Mesa-dev] [PATCH] radeonsi: don't print a warning for unhandled registers returned by LLVM

Nicolai Hähnle nhaehnle at gmail.com
Tue Jan 12 21:38:18 PST 2016


On 12.01.2016 22:25, Michel Dänzer wrote:
> On 13.01.2016 03:44, Marek Olšák wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> We don't want apps to flood stderr. New LLVM + old Mesa is a perfectly
>> valid combination (if it doesn't fail to build, of course).
>
> Actually it's not, in general. Maybe you're thinking of stable LLVM
> point releases adding new config registers? If so, that should be
> clarified in the commit log.
>
>
>>   src/gallium/drivers/radeonsi/si_shader.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
>> index 0534788..9a6bd4d 100644
>> --- a/src/gallium/drivers/radeonsi/si_shader.c
>> +++ b/src/gallium/drivers/radeonsi/si_shader.c
>> @@ -3728,6 +3728,7 @@ void si_shader_binary_read_config(struct radeon_shader_binary *binary,
>>   	for (i = 0; i < binary->config_size_per_symbol; i+= 8) {
>>   		unsigned reg = util_le32_to_cpu(*(uint32_t*)(config + i));
>>   		unsigned value = util_le32_to_cpu(*(uint32_t*)(config + i + 4));
>> +
>>   		switch (reg) {
>>   		case R_00B028_SPI_SHADER_PGM_RSRC1_PS:
>>   		case R_00B128_SPI_SHADER_PGM_RSRC1_VS:
>> @@ -3754,10 +3755,6 @@ void si_shader_binary_read_config(struct radeon_shader_binary *binary,
>>   			conf->scratch_bytes_per_wave =
>>   				G_00B860_WAVESIZE(value) * 256 * 4 * 1;
>>   			break;
>> -		default:
>> -			fprintf(stderr, "Warning: Compiler emitted unknown "
>> -				"config register: 0x%x\n", reg);
>> -			break;
>>   		}
>
> Might it make sense to print this only once?

That could be a useful compromise.

In general though I think LLVM should be backwards compatible over a 
long time (minus the interface stability issues that we cannot really 
control). Retiring old intrinsics is something that we will want to do, 
but generally, we should probably consider non-compatibility a bug 
(*especially* when it fails silently on the LLVM side, which missing 
intrinsics won't).

Cheers,
Nicolai


More information about the mesa-dev mailing list