mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-22 13:26:03 +00:00

As we introduced target triple environment amdgiz and amdgizcl, the address space values are no longer enums. We have to decide the value by target triple. The basic idea is to use struct AMDGPUAS to represent address space values. For address space values which are not depend on target triple, use static const members, so that they don't occupy extra memory space and is equivalent to a compile time constant. Since the struct is lightweight and cheap, it can be created on the fly at the point of usage. Or it can be added as member to a pass and created at the beginning of the run* function. Differential Revision: https://reviews.llvm.org/D31284 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298846 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
//===- lib/Target/AMDGPU/AMDGPUCallLowering.h - Call lowering -*- C++ -*---===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
///
|
|
/// \file
|
|
/// This file describes how to lower LLVM calls to machine code calls.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
|
|
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
|
|
|
|
#include "AMDGPU.h"
|
|
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
|
|
|
|
namespace llvm {
|
|
|
|
class AMDGPUTargetLowering;
|
|
|
|
class AMDGPUCallLowering: public CallLowering {
|
|
AMDGPUAS AMDGPUASI;
|
|
|
|
unsigned lowerParameterPtr(MachineIRBuilder &MIRBuilder, Type *ParamTy,
|
|
unsigned Offset) const;
|
|
|
|
void lowerParameter(MachineIRBuilder &MIRBuilder, Type *ParamTy,
|
|
unsigned Offset, unsigned DstReg) const;
|
|
|
|
public:
|
|
AMDGPUCallLowering(const AMDGPUTargetLowering &TLI);
|
|
|
|
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
|
|
unsigned VReg) const override;
|
|
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
|
ArrayRef<unsigned> VRegs) const override;
|
|
CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const;
|
|
};
|
|
} // End of namespace llvm;
|
|
#endif
|