mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
R600/SI: remove shader type intrinsic
Just encode the type as target specific attribute. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
204a2d32ba
commit
c3c169c884
@ -132,13 +132,6 @@ class FNEG <RegisterClass rc> : AMDGPUShaderInst <
|
||||
[(set rc:$dst, (fneg rc:$src0))]
|
||||
>;
|
||||
|
||||
def SHADER_TYPE : AMDGPUShaderInst <
|
||||
(outs),
|
||||
(ins i32imm:$type),
|
||||
"SHADER_TYPE $type",
|
||||
[(int_AMDGPU_shader_type imm:$type)]
|
||||
>;
|
||||
|
||||
} // usesCustomInserter = 1
|
||||
|
||||
multiclass RegisterLoadStore <RegisterClass dstClass, Operand addrClass,
|
||||
|
@ -50,8 +50,6 @@ let TargetPrefix = "AMDGPU", isTarget = 1 in {
|
||||
def int_AMDGPU_umax : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_umin : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_cube : Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
|
||||
|
||||
def int_AMDGPU_shader_type : Intrinsic<[], [llvm_i32_ty], []>;
|
||||
}
|
||||
|
||||
let TargetPrefix = "TGSI", isTarget = 1 in {
|
||||
|
@ -105,7 +105,6 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter(
|
||||
|
||||
switch (MI->getOpcode()) {
|
||||
default: return AMDGPUTargetLowering::EmitInstrWithCustomInserter(MI, BB);
|
||||
case AMDGPU::SHADER_TYPE: break;
|
||||
case AMDGPU::CLAMP_R600: {
|
||||
MachineInstr *NewMI = TII->buildDefaultInstruction(*BB, I,
|
||||
AMDGPU::MOV,
|
||||
|
@ -83,12 +83,6 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter(
|
||||
default:
|
||||
return AMDGPUTargetLowering::EmitInstrWithCustomInserter(MI, BB);
|
||||
case AMDGPU::BRANCH: return BB;
|
||||
case AMDGPU::SHADER_TYPE:
|
||||
BB->getParent()->getInfo<SIMachineFunctionInfo>()->ShaderType =
|
||||
MI->getOperand(0).getImm();
|
||||
MI->eraseFromParent();
|
||||
break;
|
||||
|
||||
case AMDGPU::SI_INTERP:
|
||||
LowerSI_INTERP(MI, *BB, I, MRI);
|
||||
break;
|
||||
|
@ -10,11 +10,25 @@
|
||||
|
||||
|
||||
#include "SIMachineFunctionInfo.h"
|
||||
#include "llvm/IR/Attributes.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
|
||||
|
||||
SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
|
||||
: MachineFunctionInfo(),
|
||||
SPIPSInputAddr(0),
|
||||
ShaderType(0)
|
||||
{ }
|
||||
ShaderType(0) {
|
||||
|
||||
AttributeSet Set = MF.getFunction()->getAttributes();
|
||||
Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
|
||||
ShaderTypeAttribute);
|
||||
|
||||
if (A.isStringAttribute()) {
|
||||
StringRef Str = A.getValueAsString();
|
||||
if (Str.getAsInteger(0, ShaderType))
|
||||
llvm_unreachable("Can't parse shader type!");
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ namespace llvm {
|
||||
/// tells the hardware which interpolation parameters to load.
|
||||
class SIMachineFunctionInfo : public MachineFunctionInfo {
|
||||
public:
|
||||
static const char *ShaderTypeAttribute;
|
||||
|
||||
SIMachineFunctionInfo(const MachineFunction &MF);
|
||||
unsigned SPIPSInputAddr;
|
||||
unsigned ShaderType;
|
||||
|
Loading…
Reference in New Issue
Block a user