[PATCH] R600: Initialize AMDGPUMachineFunction::ShaderType to ShaderType::COMPUTE

Christian König deathsimple at vodafone.de
Thu Apr 25 09:06:18 PDT 2013


Am 25.04.2013 17:51, schrieb Tom Stellard:
> From: Tom Stellard <thomas.stellard at amd.com>
>
> We need to intialize this to something and since clang does not set
> the shader type attribute and clang is used only for compute shaders,
> initializing it to COMPUTE seems like the best choice.

Seems to make sense.

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   lib/Target/R600/AMDGPUMachineFunction.cpp | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/lib/Target/R600/AMDGPUMachineFunction.cpp b/lib/Target/R600/AMDGPUMachineFunction.cpp
> index 0223ec8..0461025 100644
> --- a/lib/Target/R600/AMDGPUMachineFunction.cpp
> +++ b/lib/Target/R600/AMDGPUMachineFunction.cpp
> @@ -1,4 +1,5 @@
>   #include "AMDGPUMachineFunction.h"
> +#include "AMDGPU.h"
>   #include "llvm/IR/Attributes.h"
>   #include "llvm/IR/Function.h"
>   
> @@ -8,6 +9,7 @@ const char *AMDGPUMachineFunction::ShaderTypeAttribute = "ShaderType";
>   
>   AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
>       MachineFunctionInfo() {
> +  ShaderType = ShaderType::COMPUTE;
>     AttributeSet Set = MF.getFunction()->getAttributes();
>     Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
>                                    ShaderTypeAttribute);




More information about the llvm-commits mailing list