[Mesa-dev] [PATCH 4/6] AMDGPU: New control flow for SI v2

Michel Dänzer michel at daenzer.net
Thu Dec 13 12:10:20 PST 2012

On Die, 2012-12-11 at 18:43 +0100, Christian König wrote: 
> This patch replaces the control flow handling with a new
> pass which structurize the graph before transforming it to
> machine instruction. This has a couple of different advantages
> and currently fixes 20 piglit tests without a single regression.
> It is now a general purpose transformation that could be not
> only be used for SI/R6xx, but also for other hardware
> implementations that use a form of structurized control flow.
> v2: further cleanup, fixes and documentation
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> Tested-by: Michel Dänzer <michel.daenzer at amd.com>


> diff --git a/lib/Target/AMDGPU/AMDGPUStructurizeCFG.cpp b/lib/Target/AMDGPU/AMDGPUStructurizeCFG.cpp
> new file mode 100644
> index 0000000..c11c812
> --- /dev/null
> +++ b/lib/Target/AMDGPU/AMDGPUStructurizeCFG.cpp
> @@ -0,0 +1,732 @@
> [...]
> +  Function *Function;

I just noticed this line fails to build using g++ instead of clang++:

/home/daenzer/src/llvm-git/llvm/lib/Target/AMDGPU/AMDGPUStructurizeCFG.cpp:103:13: error: declaration of ‘llvm::Function* {anonymous}::AMDGPUStructurizeCFG::Function’ [-fpermissive]
In file included from /home/daenzer/src/llvm-git/llvm/include/llvm/Module.h:18:0,
                 from /home/daenzer/src/llvm-git/llvm/lib/Target/AMDGPU/AMDGPUStructurizeCFG.cpp:19:
/home/daenzer/src/llvm-git/llvm/include/llvm/Function.h:70:7: error: changes meaning of ‘Function’ from ‘class llvm::Function’ [-fpermissive]
make[3]: *** [/home/daenzer/src/llvm-git/llvm/build-i386/lib/Target/AMDGPU/Release+Debug+Asserts/AMDGPUStructurizeCFG.o] Error 1

Changing the member name to e.g. 'Func' fixes this.

Other than that, you can add my Tested-by: for the new patches as well.

Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer

More information about the mesa-dev mailing list