1 //===-- AMDGPUSubtarget.cpp - AMDGPU Subtarget Information ----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Implements the AMDGPU specific subclass of TargetSubtarget.
13 //===----------------------------------------------------------------------===//
15 #include "AMDGPUSubtarget.h"
16 #include "R600InstrInfo.h"
17 #include "SIInstrInfo.h"
21 #define DEBUG_TYPE "amdgpu-subtarget"
23 #define GET_SUBTARGETINFO_ENUM
24 #define GET_SUBTARGETINFO_TARGET_DESC
25 #define GET_SUBTARGETINFO_CTOR
26 #include "AMDGPUGenSubtargetInfo.inc"
28 AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef GPU, StringRef FS) :
29 AMDGPUGenSubtargetInfo(TT, GPU, FS),
34 HasVertexCache(false),
36 Gen(AMDGPUSubtarget::R600),
39 EnableIRStructurizer(true),
44 InstrItins(getInstrItineraryForCPU(GPU)) {
45 ParseSubtargetFeatures(GPU, FS);
47 if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
48 InstrInfo.reset(new R600InstrInfo(*this));
50 InstrInfo.reset(new SIInstrInfo(*this));
54 unsigned AMDGPUSubtarget::getStackEntrySize() const {
55 assert(getGeneration() <= NORTHERN_ISLANDS);
56 switch(getWavefrontSize()) {
60 return hasCaymanISA() ? 4 : 8;
64 llvm_unreachable("Illegal wavefront size.");