[llvm] r180620 - R600: Initialize AMDGPUMachineFunction::ShaderType to ShaderType::COMPUTE

Tom Stellard thomas.stellard at amd.com
Fri Apr 26 11:32:25 PDT 2013


Author: tstellar
Date: Fri Apr 26 13:32:24 2013
New Revision: 180620

URL: http://llvm.org/viewvc/llvm-project?rev=180620&view=rev
Log:
R600: Initialize AMDGPUMachineFunction::ShaderType to ShaderType::COMPUTE

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.

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

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp
    llvm/trunk/test/CodeGen/R600/elf.ll

Modified: llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp?rev=180620&r1=180619&r2=180620&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp Fri Apr 26 13:32:24 2013
@@ -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::Shade
 
 AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
     MachineFunctionInfo() {
+  ShaderType = ShaderType::COMPUTE;
   AttributeSet Set = MF.getFunction()->getAttributes();
   Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
                                  ShaderTypeAttribute);

Modified: llvm/trunk/test/CodeGen/R600/elf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/elf.ll?rev=180620&r1=180619&r2=180620&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/elf.ll (original)
+++ llvm/trunk/test/CodeGen/R600/elf.ll Fri Apr 26 13:32:24 2013
@@ -8,7 +8,7 @@
 ; CONFIG-CHECK: .section .AMDGPU.config
 ; CONFIG-CHECK-NEXT: .long   45096
 ; CONFIG-CHECK-NEXT: .long   0
-define void @test(i32 %p) {
+define void @test(i32 %p) #0 {
    %i = add i32 %p, 2
    %r = bitcast i32 %i to float
    call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %r, float %r, float %r, float %r)
@@ -16,3 +16,5 @@ define void @test(i32 %p) {
 }
 
 declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
+
+attributes #0 = { "ShaderType"="0" } ; Pixel Shader





More information about the llvm-commits mailing list