radeonsi: Allow dumping LLVM IR before optimization passes
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 4 Feb 2016 07:59:39 +0000 (08:59 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 5 Feb 2016 14:22:04 +0000 (09:22 -0500)
commit4b672b831080c5bc1d379e9645e9ccef28939b56
treea55a2e0c9faadeef1acd3af1b55d8f2be030dd68
parent5aafc169ca80885ee5e6cde9f590c10a2ae629fe
radeonsi: Allow dumping LLVM IR before optimization passes

Set R600_DEBUG=preoptir to dump the LLVM IR before optimization passes,
to allow diagnosing problems caused by optimization passes.

Note that in order to compile the resulting IR with llc, you will first
have to run at least the mem2reg pass, e.g.

opt -mem2reg -S < shader.ll | llc -march=amdgcn -mcpu=bonaire

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> (original patch)
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (w/ debug flag)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_shader.c