2015-11-07 02:17:45 +08:00
|
|
|
//=====-- AMDGPUSubtarget.h - Define Subtarget for AMDGPU ------*- C++ -*-====//
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//==-----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
2018-05-01 23:54:18 +08:00
|
|
|
/// AMDGPU specific subclass of TargetSubtarget.
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-11-07 02:17:45 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H
|
2015-11-07 02:23:00 +08:00
|
|
|
|
2013-06-08 04:37:48 +08:00
|
|
|
#include "AMDGPU.h"
|
2017-08-16 06:31:51 +08:00
|
|
|
#include "AMDGPUCallLowering.h"
|
2016-06-24 14:30:11 +08:00
|
|
|
#include "R600FrameLowering.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "R600ISelLowering.h"
|
|
|
|
#include "R600InstrInfo.h"
|
2016-06-24 14:30:11 +08:00
|
|
|
#include "SIFrameLowering.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "SIISelLowering.h"
|
|
|
|
#include "SIInstrInfo.h"
|
2015-06-27 05:15:07 +08:00
|
|
|
#include "Utils/AMDGPUBaseInfo.h"
|
2016-12-10 06:06:55 +08:00
|
|
|
#include "llvm/ADT/Triple.h"
|
2017-08-16 06:31:51 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
|
|
|
|
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
|
|
|
|
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
|
2016-12-10 06:06:55 +08:00
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
2016-08-12 01:31:42 +08:00
|
|
|
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
|
2016-12-10 06:06:55 +08:00
|
|
|
#include "llvm/MC/MCInstrItineraries.h"
|
|
|
|
#include "llvm/Support/MathExtras.h"
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <memory>
|
|
|
|
#include <utility>
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
|
|
|
#include "AMDGPUGenSubtargetInfo.inc"
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
|
|
|
#include "R600GenSubtargetInfo.inc"
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
class StringRef;
|
2015-01-21 03:33:04 +08:00
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
class AMDGPUSubtarget {
|
|
|
|
public:
|
|
|
|
enum Generation {
|
|
|
|
R600 = 0,
|
|
|
|
R700 = 1,
|
2018-07-20 17:05:08 +08:00
|
|
|
EVERGREEN = 2,
|
2018-07-12 04:59:01 +08:00
|
|
|
NORTHERN_ISLANDS = 3,
|
|
|
|
SOUTHERN_ISLANDS = 4,
|
|
|
|
SEA_ISLANDS = 5,
|
|
|
|
VOLCANIC_ISLANDS = 6,
|
|
|
|
GFX9 = 7
|
|
|
|
};
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
private:
|
|
|
|
Triple TargetTriple;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool Has16BitInsts;
|
|
|
|
bool HasMadMixInsts;
|
|
|
|
bool FP32Denormals;
|
|
|
|
bool FPExceptions;
|
|
|
|
bool HasSDWA;
|
|
|
|
bool HasVOP3PInsts;
|
|
|
|
bool HasMulI24;
|
|
|
|
bool HasMulU24;
|
2018-08-16 05:03:55 +08:00
|
|
|
bool HasInv2PiInlineImm;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool HasFminFmaxLegacy;
|
|
|
|
bool EnablePromoteAlloca;
|
2018-09-14 18:27:19 +08:00
|
|
|
bool HasTrigReducedRange;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
int LocalMemorySize;
|
|
|
|
unsigned WavefrontSize;
|
|
|
|
|
|
|
|
public:
|
2018-09-13 02:50:47 +08:00
|
|
|
AMDGPUSubtarget(const Triple &TT);
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
static const AMDGPUSubtarget &get(const MachineFunction &MF);
|
|
|
|
static const AMDGPUSubtarget &get(const TargetMachine &TM,
|
2018-07-20 17:05:08 +08:00
|
|
|
const Function &F);
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
/// \returns Default range flat work group size for a calling convention.
|
|
|
|
std::pair<unsigned, unsigned> getDefaultFlatWorkGroupSize(CallingConv::ID CC) const;
|
|
|
|
|
|
|
|
/// \returns Subtarget's default pair of minimum/maximum flat work group sizes
|
|
|
|
/// for function \p F, or minimum/maximum flat work group sizes explicitly
|
|
|
|
/// requested using "amdgpu-flat-work-group-size" attribute attached to
|
|
|
|
/// function \p F.
|
|
|
|
///
|
|
|
|
/// \returns Subtarget's default values if explicitly requested values cannot
|
|
|
|
/// be converted to integer, or violate subtarget's specifications.
|
|
|
|
std::pair<unsigned, unsigned> getFlatWorkGroupSizes(const Function &F) const;
|
|
|
|
|
|
|
|
/// \returns Subtarget's default pair of minimum/maximum number of waves per
|
|
|
|
/// execution unit for function \p F, or minimum/maximum number of waves per
|
|
|
|
/// execution unit explicitly requested using "amdgpu-waves-per-eu" attribute
|
|
|
|
/// attached to function \p F.
|
|
|
|
///
|
|
|
|
/// \returns Subtarget's default values if explicitly requested values cannot
|
|
|
|
/// be converted to integer, violate subtarget's specifications, or are not
|
|
|
|
/// compatible with minimum/maximum number of waves limited by flat work group
|
|
|
|
/// size, register usage, and/or lds usage.
|
|
|
|
std::pair<unsigned, unsigned> getWavesPerEU(const Function &F) const;
|
|
|
|
|
|
|
|
/// Return the amount of LDS that can be used that will not restrict the
|
|
|
|
/// occupancy lower than WaveCount.
|
|
|
|
unsigned getMaxLocalMemSizeWithWaveCount(unsigned WaveCount,
|
|
|
|
const Function &) const;
|
|
|
|
|
|
|
|
/// Inverse of getMaxLocalMemWithWaveCount. Return the maximum wavecount if
|
|
|
|
/// the given LDS memory size is the only constraint.
|
|
|
|
unsigned getOccupancyWithLocalMemSize(uint32_t Bytes, const Function &) const;
|
|
|
|
|
|
|
|
unsigned getOccupancyWithLocalMemSize(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
bool isAmdHsaOS() const {
|
|
|
|
return TargetTriple.getOS() == Triple::AMDHSA;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isAmdPalOS() const {
|
|
|
|
return TargetTriple.getOS() == Triple::AMDPAL;
|
|
|
|
}
|
|
|
|
|
2018-07-07 01:16:17 +08:00
|
|
|
bool isMesa3DOS() const {
|
|
|
|
return TargetTriple.getOS() == Triple::Mesa3D;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isMesaKernel(const Function &F) const {
|
|
|
|
return isMesa3DOS() && !AMDGPU::isShader(F.getCallingConv());
|
|
|
|
}
|
|
|
|
|
2018-10-05 05:02:16 +08:00
|
|
|
bool isAmdHsaOrMesa(const Function &F) const {
|
2018-07-07 01:16:17 +08:00
|
|
|
return isAmdHsaOS() || isMesaKernel(F);
|
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool has16BitInsts() const {
|
|
|
|
return Has16BitInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasMadMixInsts() const {
|
|
|
|
return HasMadMixInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFP32Denormals() const {
|
|
|
|
return FP32Denormals;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFPExceptions() const {
|
|
|
|
return FPExceptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSDWA() const {
|
|
|
|
return HasSDWA;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVOP3PInsts() const {
|
|
|
|
return HasVOP3PInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasMulI24() const {
|
|
|
|
return HasMulI24;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasMulU24() const {
|
|
|
|
return HasMulU24;
|
|
|
|
}
|
|
|
|
|
2018-08-16 05:03:55 +08:00
|
|
|
bool hasInv2PiInlineImm() const {
|
|
|
|
return HasInv2PiInlineImm;
|
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool hasFminFmaxLegacy() const {
|
|
|
|
return HasFminFmaxLegacy;
|
|
|
|
}
|
|
|
|
|
2018-09-14 18:27:19 +08:00
|
|
|
bool hasTrigReducedRange() const {
|
|
|
|
return HasTrigReducedRange;
|
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool isPromoteAllocaEnabled() const {
|
|
|
|
return EnablePromoteAlloca;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned getWavefrontSize() const {
|
|
|
|
return WavefrontSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
int getLocalMemorySize() const {
|
|
|
|
return LocalMemorySize;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned getAlignmentForImplicitArgPtr() const {
|
|
|
|
return isAmdHsaOS() ? 8 : 4;
|
|
|
|
}
|
|
|
|
|
2018-07-07 01:16:17 +08:00
|
|
|
/// Returns the offset in bytes from the start of the input buffer
|
|
|
|
/// of the first explicit kernel argument.
|
|
|
|
unsigned getExplicitKernelArgOffset(const Function &F) const {
|
2018-10-05 05:02:16 +08:00
|
|
|
return isAmdHsaOrMesa(F) ? 0 : 36;
|
2018-07-07 01:16:17 +08:00
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
/// \returns Maximum number of work groups per compute unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
2018-09-13 02:50:47 +08:00
|
|
|
virtual unsigned getMaxWorkGroupsPerCU(unsigned FlatWorkGroupSize) const = 0;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
/// \returns Minimum flat work group size supported by the subtarget.
|
2018-09-13 02:50:47 +08:00
|
|
|
virtual unsigned getMinFlatWorkGroupSize() const = 0;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
/// \returns Maximum flat work group size supported by the subtarget.
|
2018-09-13 02:50:47 +08:00
|
|
|
virtual unsigned getMaxFlatWorkGroupSize() const = 0;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of waves per execution unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
2018-09-13 02:50:47 +08:00
|
|
|
virtual unsigned getMaxWavesPerEU(unsigned FlatWorkGroupSize) const = 0;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
/// \returns Minimum number of waves per execution unit supported by the
|
|
|
|
/// subtarget.
|
2018-09-13 02:50:47 +08:00
|
|
|
virtual unsigned getMinWavesPerEU() const = 0;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
unsigned getMaxWavesPerEU() const { return 10; }
|
|
|
|
|
|
|
|
/// Creates value range metadata on an workitemid.* inrinsic call or load.
|
|
|
|
bool makeLIDRangeMetadata(Instruction *I) const;
|
|
|
|
|
2018-07-20 17:05:08 +08:00
|
|
|
/// \returns Number of bytes of arguments that are passed to a shader or
|
|
|
|
/// kernel in addition to the explicit ones declared for the function.
|
|
|
|
unsigned getImplicitArgNumBytes(const Function &F) const {
|
|
|
|
if (isMesaKernel(F))
|
|
|
|
return 16;
|
|
|
|
return AMDGPU::getIntegerAttribute(F, "amdgpu-implicitarg-num-bytes", 0);
|
|
|
|
}
|
|
|
|
uint64_t getExplicitKernArgSize(const Function &F,
|
|
|
|
unsigned &MaxAlign) const;
|
|
|
|
unsigned getKernArgSegmentSize(const Function &F,
|
|
|
|
unsigned &MaxAlign) const;
|
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
virtual ~AMDGPUSubtarget() {}
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
};
|
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
class GCNSubtarget : public AMDGPUGenSubtargetInfo,
|
|
|
|
public AMDGPUSubtarget {
|
2013-06-08 04:37:48 +08:00
|
|
|
public:
|
2015-06-27 05:15:07 +08:00
|
|
|
enum {
|
|
|
|
ISAVersion0_0_0,
|
2017-06-10 11:53:19 +08:00
|
|
|
ISAVersion6_0_0,
|
|
|
|
ISAVersion6_0_1,
|
2015-06-27 05:15:07 +08:00
|
|
|
ISAVersion7_0_0,
|
|
|
|
ISAVersion7_0_1,
|
2016-10-27 00:37:56 +08:00
|
|
|
ISAVersion7_0_2,
|
2017-06-10 11:53:19 +08:00
|
|
|
ISAVersion7_0_3,
|
2017-12-09 04:52:28 +08:00
|
|
|
ISAVersion7_0_4,
|
2016-01-14 04:39:25 +08:00
|
|
|
ISAVersion8_0_1,
|
2016-10-12 00:00:47 +08:00
|
|
|
ISAVersion8_0_2,
|
2016-10-27 00:37:56 +08:00
|
|
|
ISAVersion8_0_3,
|
|
|
|
ISAVersion8_1_0,
|
2017-02-19 02:29:53 +08:00
|
|
|
ISAVersion9_0_0,
|
2018-05-01 03:08:16 +08:00
|
|
|
ISAVersion9_0_2,
|
|
|
|
ISAVersion9_0_4,
|
2018-05-02 02:47:48 +08:00
|
|
|
ISAVersion9_0_6,
|
2015-06-27 05:15:07 +08:00
|
|
|
};
|
|
|
|
|
2017-02-10 10:15:29 +08:00
|
|
|
enum TrapHandlerAbi {
|
|
|
|
TrapHandlerAbiNone = 0,
|
|
|
|
TrapHandlerAbiHsa = 1
|
|
|
|
};
|
|
|
|
|
2017-02-23 07:22:19 +08:00
|
|
|
enum TrapID {
|
|
|
|
TrapIDHardwareReserved = 0,
|
|
|
|
TrapIDHSADebugTrap = 1,
|
|
|
|
TrapIDLLVMTrap = 2,
|
|
|
|
TrapIDLLVMDebugTrap = 3,
|
|
|
|
TrapIDDebugBreakpoint = 7,
|
|
|
|
TrapIDDebugReserved8 = 8,
|
|
|
|
TrapIDDebugReservedFE = 0xfe,
|
|
|
|
TrapIDDebugReservedFF = 0xff
|
2017-02-10 10:15:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum TrapRegValues {
|
2017-02-23 07:22:19 +08:00
|
|
|
LLVMTrapHandlerRegValue = 1
|
2017-02-10 10:15:29 +08:00
|
|
|
};
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
private:
|
|
|
|
/// GlobalISel related APIs.
|
|
|
|
std::unique_ptr<AMDGPUCallLowering> CallLoweringInfo;
|
|
|
|
std::unique_ptr<InstructionSelector> InstSelector;
|
|
|
|
std::unique_ptr<LegalizerInfo> Legalizer;
|
|
|
|
std::unique_ptr<RegisterBankInfo> RegBankInfo;
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
protected:
|
|
|
|
// Basic subtarget description.
|
|
|
|
Triple TargetTriple;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
unsigned Gen;
|
2016-06-24 14:30:11 +08:00
|
|
|
unsigned IsaVersion;
|
2018-09-18 00:04:32 +08:00
|
|
|
InstrItineraryData InstrItins;
|
2016-06-24 14:30:11 +08:00
|
|
|
int LDSBankCount;
|
|
|
|
unsigned MaxPrivateElementSize;
|
|
|
|
|
|
|
|
// Possibly statically set by tablegen, but may want to be overridden.
|
2015-01-30 03:34:25 +08:00
|
|
|
bool FastFMAF32;
|
2016-01-19 05:13:50 +08:00
|
|
|
bool HalfRate64Ops;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
|
|
|
// Dynamially set bits that enable features.
|
2017-01-24 06:31:03 +08:00
|
|
|
bool FP64FP16Denormals;
|
2017-02-22 07:35:48 +08:00
|
|
|
bool DX10Clamp;
|
2015-12-23 04:55:23 +08:00
|
|
|
bool FlatForGlobal;
|
2017-06-03 01:40:26 +08:00
|
|
|
bool AutoWaitcntBeforeBarrier;
|
2017-10-14 23:59:07 +08:00
|
|
|
bool CodeObjectV3;
|
2016-10-15 02:10:39 +08:00
|
|
|
bool UnalignedScratchAccess;
|
2016-07-02 07:03:44 +08:00
|
|
|
bool UnalignedBufferAccess;
|
2017-02-19 02:29:53 +08:00
|
|
|
bool HasApertureRegs;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool EnableXNACK;
|
2017-02-10 10:15:29 +08:00
|
|
|
bool TrapHandler;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool DebuggerInsertNops;
|
2016-06-25 11:11:28 +08:00
|
|
|
bool DebuggerEmitPrologue;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
|
|
|
// Used as options.
|
2017-11-15 08:45:43 +08:00
|
|
|
bool EnableHugePrivateBuffer;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool EnableVGPRSpilling;
|
2014-10-11 06:01:59 +08:00
|
|
|
bool EnableLoadStoreOpt;
|
2015-07-07 00:01:58 +08:00
|
|
|
bool EnableUnsafeDSOffsetFolding;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool EnableSIScheduler;
|
2018-04-11 06:48:23 +08:00
|
|
|
bool EnableDS128;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool DumpCode;
|
|
|
|
|
|
|
|
// Subtarget statically properties set by tablegen
|
|
|
|
bool FP64;
|
2017-12-05 07:07:28 +08:00
|
|
|
bool FMA;
|
2018-02-05 20:45:43 +08:00
|
|
|
bool MIMG_R128;
|
2015-04-08 09:09:26 +08:00
|
|
|
bool IsGCN;
|
|
|
|
bool GCN3Encoding;
|
2015-04-24 03:33:54 +08:00
|
|
|
bool CIInsts;
|
2018-08-07 15:28:46 +08:00
|
|
|
bool VIInsts;
|
2017-02-19 03:12:26 +08:00
|
|
|
bool GFX9Insts;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool SGPRInitBug;
|
2016-02-27 16:53:55 +08:00
|
|
|
bool HasSMemRealTime;
|
2017-08-16 21:51:56 +08:00
|
|
|
bool HasIntClamp;
|
2018-05-01 03:08:16 +08:00
|
|
|
bool HasFmaMixInsts;
|
2016-10-13 02:00:51 +08:00
|
|
|
bool HasMovrel;
|
|
|
|
bool HasVGPRIndexMode;
|
2016-10-29 05:55:15 +08:00
|
|
|
bool HasScalarStores;
|
2018-04-03 00:10:25 +08:00
|
|
|
bool HasScalarAtomics;
|
2017-06-22 14:26:41 +08:00
|
|
|
bool HasSDWAOmod;
|
|
|
|
bool HasSDWAScalar;
|
|
|
|
bool HasSDWASdst;
|
|
|
|
bool HasSDWAMac;
|
[AMDGPU] SDWA: several fixes for V_CVT and VOPC instructions
Summary:
1. Instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here. This fix checks if SDWA pseudo instruction has OMod operand and then copy it.
2. There were several problems with support of VOPC instructions in SDWA peephole pass.
Reviewers: tstellar, arsenm, vpykhtin, airlied, kzhuravl
Subscribers: wdng, nhaehnle, yaxunl, dstuttard, tpr, sarnex, t-tye
Differential Revision: https://reviews.llvm.org/D34626
llvm-svn: 306413
2017-06-27 23:02:23 +08:00
|
|
|
bool HasSDWAOutModsVOPC;
|
2017-01-20 18:01:25 +08:00
|
|
|
bool HasDPP;
|
2018-08-28 23:07:30 +08:00
|
|
|
bool HasR128A16;
|
2018-05-01 03:08:16 +08:00
|
|
|
bool HasDLInsts;
|
2018-05-05 04:06:57 +08:00
|
|
|
bool D16PreservesUnusedBits;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool FlatAddressSpace;
|
2017-05-11 05:19:05 +08:00
|
|
|
bool FlatInstOffsets;
|
|
|
|
bool FlatGlobalInsts;
|
|
|
|
bool FlatScratchInsts;
|
2017-07-21 01:42:47 +08:00
|
|
|
bool AddNoCarryInsts;
|
2018-01-13 05:12:19 +08:00
|
|
|
bool HasUnpackedD16VMem;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool R600ALUInst;
|
|
|
|
bool CaymanISA;
|
|
|
|
bool CFALUBug;
|
|
|
|
bool HasVertexCache;
|
|
|
|
short TexVTXClauseSize;
|
2016-12-09 01:28:47 +08:00
|
|
|
bool ScalarizeGlobal;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
|
|
|
// Dummy feature to use for assembler in tablegen.
|
2015-04-24 03:33:54 +08:00
|
|
|
bool FeatureDisable;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-08-12 01:31:42 +08:00
|
|
|
SelectionDAGTargetInfo TSInfo;
|
2018-07-12 04:59:01 +08:00
|
|
|
private:
|
|
|
|
SIInstrInfo InstrInfo;
|
2018-07-12 06:15:15 +08:00
|
|
|
SITargetLowering TLInfo;
|
2018-07-12 04:59:01 +08:00
|
|
|
SIFrameLowering FrameLowering;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
public:
|
2018-07-12 04:59:01 +08:00
|
|
|
GCNSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
|
|
|
|
const GCNTargetMachine &TM);
|
|
|
|
~GCNSubtarget() override;
|
2016-12-10 06:06:55 +08:00
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
GCNSubtarget &initializeSubtargetDependencies(const Triple &TT,
|
2015-06-10 20:11:26 +08:00
|
|
|
StringRef GPU, StringRef FS);
|
2014-06-28 01:57:00 +08:00
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
const SIInstrInfo *getInstrInfo() const override {
|
|
|
|
return &InstrInfo;
|
|
|
|
}
|
2016-04-15 03:09:28 +08:00
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
const SIFrameLowering *getFrameLowering() const override {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
const SITargetLowering *getTargetLowering() const override {
|
|
|
|
return &TLInfo;
|
|
|
|
}
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
const SIRegisterInfo *getRegisterInfo() const override {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
const CallLowering *getCallLowering() const override {
|
|
|
|
return CallLoweringInfo.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
const InstructionSelector *getInstructionSelector() const override {
|
|
|
|
return InstSelector.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
const LegalizerInfo *getLegalizerInfo() const override {
|
|
|
|
return Legalizer.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
const RegisterBankInfo *getRegBankInfo() const override {
|
|
|
|
return RegBankInfo.get();
|
2014-08-05 05:25:23 +08:00
|
|
|
}
|
2014-06-28 01:57:00 +08:00
|
|
|
|
2016-08-12 01:31:42 +08:00
|
|
|
// Nothing implemented, just prevent crashes on use.
|
|
|
|
const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2018-09-18 00:04:32 +08:00
|
|
|
const InstrItineraryData *getInstrItineraryData() const override {
|
|
|
|
return &InstrItins;
|
|
|
|
}
|
|
|
|
|
2014-04-30 13:53:27 +08:00
|
|
|
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-06-28 01:57:00 +08:00
|
|
|
Generation getGeneration() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return (Generation)Gen;
|
2014-06-28 01:57:00 +08:00
|
|
|
}
|
|
|
|
|
2017-11-14 06:55:05 +08:00
|
|
|
unsigned getWavefrontSizeLog2() const {
|
|
|
|
return Log2_32(WavefrontSize);
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
int getLDSBankCount() const {
|
|
|
|
return LDSBankCount;
|
2014-07-15 07:40:49 +08:00
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
unsigned getMaxPrivateElementSize() const {
|
|
|
|
return MaxPrivateElementSize;
|
2014-07-15 07:40:49 +08:00
|
|
|
}
|
|
|
|
|
2017-08-16 21:51:56 +08:00
|
|
|
bool hasIntClamp() const {
|
|
|
|
return HasIntClamp;
|
|
|
|
}
|
|
|
|
|
2017-12-05 06:57:29 +08:00
|
|
|
bool hasFP64() const {
|
2016-06-24 14:30:11 +08:00
|
|
|
return FP64;
|
2016-01-29 04:53:42 +08:00
|
|
|
}
|
|
|
|
|
2018-02-05 20:45:43 +08:00
|
|
|
bool hasMIMG_R128() const {
|
|
|
|
return MIMG_R128;
|
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool hasHWFP64() const {
|
|
|
|
return FP64;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:34:25 +08:00
|
|
|
bool hasFastFMAF32() const {
|
|
|
|
return FastFMAF32;
|
|
|
|
}
|
|
|
|
|
2016-01-19 05:13:50 +08:00
|
|
|
bool hasHalfRate64Ops() const {
|
|
|
|
return HalfRate64Ops;
|
|
|
|
}
|
|
|
|
|
2016-06-10 07:42:48 +08:00
|
|
|
bool hasAddr64() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return (getGeneration() < AMDGPUSubtarget::VOLCANIC_ISLANDS);
|
2016-06-10 07:42:48 +08:00
|
|
|
}
|
|
|
|
|
2014-03-18 02:58:11 +08:00
|
|
|
bool hasBFE() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2014-03-18 02:58:11 +08:00
|
|
|
}
|
|
|
|
|
2014-06-11 03:00:20 +08:00
|
|
|
bool hasBFI() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2014-06-11 03:00:20 +08:00
|
|
|
}
|
|
|
|
|
2014-03-18 02:58:11 +08:00
|
|
|
bool hasBFM() const {
|
|
|
|
return hasBFE();
|
|
|
|
}
|
|
|
|
|
2014-06-11 03:18:28 +08:00
|
|
|
bool hasBCNT(unsigned Size) const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2014-04-08 03:45:41 +08:00
|
|
|
}
|
|
|
|
|
2014-07-15 23:51:09 +08:00
|
|
|
bool hasFFBL() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2014-07-15 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFFBH() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2014-07-15 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
2017-02-28 06:40:39 +08:00
|
|
|
bool hasMed3_16() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
2017-02-28 06:40:39 +08:00
|
|
|
}
|
|
|
|
|
2017-05-18 03:25:06 +08:00
|
|
|
bool hasMin3Max3_16() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
2017-09-08 02:05:07 +08:00
|
|
|
}
|
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
bool hasFmaMixInsts() const {
|
|
|
|
return HasFmaMixInsts;
|
|
|
|
}
|
|
|
|
|
2015-05-01 01:15:56 +08:00
|
|
|
bool hasCARRY() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return true;
|
2016-06-24 14:30:11 +08:00
|
|
|
}
|
|
|
|
|
2017-12-05 07:07:28 +08:00
|
|
|
bool hasFMA() const {
|
|
|
|
return FMA;
|
|
|
|
}
|
|
|
|
|
2017-02-10 10:15:29 +08:00
|
|
|
TrapHandlerAbi getTrapHandlerAbi() const {
|
|
|
|
return isAmdHsaOS() ? TrapHandlerAbiHsa : TrapHandlerAbiNone;
|
|
|
|
}
|
|
|
|
|
2017-11-15 08:45:43 +08:00
|
|
|
bool enableHugePrivateBuffer() const {
|
|
|
|
return EnableHugePrivateBuffer;
|
|
|
|
}
|
|
|
|
|
2015-07-07 00:01:58 +08:00
|
|
|
bool unsafeDSOffsetFoldingEnabled() const {
|
|
|
|
return EnableUnsafeDSOffsetFolding;
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool dumpCode() const {
|
|
|
|
return DumpCode;
|
2014-06-28 01:57:00 +08:00
|
|
|
}
|
|
|
|
|
2016-05-17 05:19:59 +08:00
|
|
|
/// Return the amount of LDS that can be used that will not restrict the
|
|
|
|
/// occupancy lower than WaveCount.
|
2017-02-02 06:59:50 +08:00
|
|
|
unsigned getMaxLocalMemSizeWithWaveCount(unsigned WaveCount,
|
|
|
|
const Function &) const;
|
2016-05-17 05:19:59 +08:00
|
|
|
|
2016-11-13 15:01:11 +08:00
|
|
|
bool hasFP16Denormals() const {
|
2017-01-24 06:31:03 +08:00
|
|
|
return FP64FP16Denormals;
|
2016-11-13 15:01:11 +08:00
|
|
|
}
|
2016-05-17 05:19:59 +08:00
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool hasFP64Denormals() const {
|
2017-01-24 06:31:03 +08:00
|
|
|
return FP64FP16Denormals;
|
2016-02-12 10:40:47 +08:00
|
|
|
}
|
|
|
|
|
2017-07-14 07:59:15 +08:00
|
|
|
bool supportsMinMaxDenormModes() const {
|
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
|
|
|
}
|
|
|
|
|
2017-02-22 07:35:48 +08:00
|
|
|
bool enableDX10Clamp() const {
|
|
|
|
return DX10Clamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool enableIEEEBit(const MachineFunction &MF) const {
|
2017-12-16 06:22:58 +08:00
|
|
|
return AMDGPU::isCompute(MF.getFunction().getCallingConv());
|
2017-02-22 07:35:48 +08:00
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool useFlatForGlobal() const {
|
|
|
|
return FlatForGlobal;
|
2015-05-26 00:15:54 +08:00
|
|
|
}
|
|
|
|
|
2018-03-10 01:41:39 +08:00
|
|
|
/// \returns If target supports ds_read/write_b128 and user enables generation
|
|
|
|
/// of ds_read/write_b128.
|
2018-04-11 06:48:23 +08:00
|
|
|
bool useDS128() const {
|
|
|
|
return CIInsts && EnableDS128;
|
2018-03-10 01:41:39 +08:00
|
|
|
}
|
|
|
|
|
2017-11-30 08:52:40 +08:00
|
|
|
/// \returns If MUBUF instructions always perform range checking, even for
|
|
|
|
/// buffer resources used for private memory access.
|
|
|
|
bool privateMemoryResourceIsRangeChecked() const {
|
|
|
|
return getGeneration() < AMDGPUSubtarget::GFX9;
|
|
|
|
}
|
|
|
|
|
2017-06-03 01:40:26 +08:00
|
|
|
bool hasAutoWaitcntBeforeBarrier() const {
|
|
|
|
return AutoWaitcntBeforeBarrier;
|
|
|
|
}
|
|
|
|
|
2017-10-14 23:59:07 +08:00
|
|
|
bool hasCodeObjectV3() const {
|
|
|
|
return CodeObjectV3;
|
|
|
|
}
|
|
|
|
|
2016-07-02 07:03:44 +08:00
|
|
|
bool hasUnalignedBufferAccess() const {
|
|
|
|
return UnalignedBufferAccess;
|
|
|
|
}
|
|
|
|
|
2016-10-15 02:10:39 +08:00
|
|
|
bool hasUnalignedScratchAccess() const {
|
|
|
|
return UnalignedScratchAccess;
|
|
|
|
}
|
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
bool hasApertureRegs() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return HasApertureRegs;
|
2017-02-19 02:29:53 +08:00
|
|
|
}
|
|
|
|
|
2017-02-10 10:15:29 +08:00
|
|
|
bool isTrapHandlerEnabled() const {
|
|
|
|
return TrapHandler;
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool isXNACKEnabled() const {
|
|
|
|
return EnableXNACK;
|
|
|
|
}
|
2014-12-03 06:00:07 +08:00
|
|
|
|
2017-01-31 09:20:54 +08:00
|
|
|
bool hasFlatAddressSpace() const {
|
|
|
|
return FlatAddressSpace;
|
|
|
|
}
|
|
|
|
|
2017-05-11 05:19:05 +08:00
|
|
|
bool hasFlatInstOffsets() const {
|
|
|
|
return FlatInstOffsets;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFlatGlobalInsts() const {
|
|
|
|
return FlatGlobalInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFlatScratchInsts() const {
|
|
|
|
return FlatScratchInsts;
|
|
|
|
}
|
|
|
|
|
2018-06-05 00:51:59 +08:00
|
|
|
bool hasFlatLgkmVMemCountInOrder() const {
|
|
|
|
return getGeneration() > GFX9;
|
|
|
|
}
|
|
|
|
|
2017-09-02 02:36:06 +08:00
|
|
|
bool hasD16LoadStore() const {
|
|
|
|
return getGeneration() >= GFX9;
|
|
|
|
}
|
|
|
|
|
2017-11-29 08:55:57 +08:00
|
|
|
/// Return if most LDS instructions have an m0 use that require m0 to be
|
|
|
|
/// iniitalized.
|
|
|
|
bool ldsRequiresM0Init() const {
|
|
|
|
return getGeneration() < GFX9;
|
|
|
|
}
|
|
|
|
|
2017-07-21 01:42:47 +08:00
|
|
|
bool hasAddNoCarry() const {
|
|
|
|
return AddNoCarryInsts;
|
|
|
|
}
|
|
|
|
|
2018-01-13 05:12:19 +08:00
|
|
|
bool hasUnpackedD16VMem() const {
|
|
|
|
return HasUnpackedD16VMem;
|
|
|
|
}
|
|
|
|
|
2017-01-25 09:25:13 +08:00
|
|
|
// Covers VS/PS/CS graphics shaders
|
2018-05-30 01:42:50 +08:00
|
|
|
bool isMesaGfxShader(const Function &F) const {
|
|
|
|
return isMesa3DOS() && AMDGPU::isShader(F.getCallingConv());
|
2017-01-25 09:25:13 +08:00
|
|
|
}
|
|
|
|
|
2017-11-07 01:04:37 +08:00
|
|
|
bool hasMad64_32() const {
|
|
|
|
return getGeneration() >= SEA_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2017-06-22 14:26:41 +08:00
|
|
|
bool hasSDWAOmod() const {
|
|
|
|
return HasSDWAOmod;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSDWAScalar() const {
|
|
|
|
return HasSDWAScalar;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSDWASdst() const {
|
|
|
|
return HasSDWASdst;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSDWAMac() const {
|
|
|
|
return HasSDWAMac;
|
|
|
|
}
|
|
|
|
|
[AMDGPU] SDWA: several fixes for V_CVT and VOPC instructions
Summary:
1. Instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here. This fix checks if SDWA pseudo instruction has OMod operand and then copy it.
2. There were several problems with support of VOPC instructions in SDWA peephole pass.
Reviewers: tstellar, arsenm, vpykhtin, airlied, kzhuravl
Subscribers: wdng, nhaehnle, yaxunl, dstuttard, tpr, sarnex, t-tye
Differential Revision: https://reviews.llvm.org/D34626
llvm-svn: 306413
2017-06-27 23:02:23 +08:00
|
|
|
bool hasSDWAOutModsVOPC() const {
|
|
|
|
return HasSDWAOutModsVOPC;
|
2017-06-22 14:26:41 +08:00
|
|
|
}
|
|
|
|
|
2018-04-27 00:11:19 +08:00
|
|
|
bool vmemWriteNeedsExpWaitcnt() const {
|
|
|
|
return getGeneration() < SEA_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
bool hasDLInsts() const {
|
|
|
|
return HasDLInsts;
|
|
|
|
}
|
|
|
|
|
2018-05-05 04:06:57 +08:00
|
|
|
bool d16PreservesUnusedBits() const {
|
|
|
|
return D16PreservesUnusedBits;
|
|
|
|
}
|
|
|
|
|
2017-04-18 03:48:24 +08:00
|
|
|
// Scratch is allocated in 256 dword per wave blocks for the entire
|
|
|
|
// wavefront. When viewed from the perspecive of an arbitrary workitem, this
|
|
|
|
// is 4-byte aligned.
|
2018-03-30 04:22:04 +08:00
|
|
|
//
|
|
|
|
// Only 4-byte alignment is really needed to access anything. Transformations
|
|
|
|
// on the pointer value itself may rely on the alignment / known low bits of
|
|
|
|
// the pointer. Set this to something above the minimum to avoid needing
|
|
|
|
// dynamic realignment in common cases.
|
2016-06-24 14:30:11 +08:00
|
|
|
unsigned getStackAlignment() const {
|
2018-03-30 04:22:04 +08:00
|
|
|
return 16;
|
2016-06-24 14:30:11 +08:00
|
|
|
}
|
2015-06-27 05:15:07 +08:00
|
|
|
|
2014-04-29 15:57:24 +08:00
|
|
|
bool enableMachineScheduler() const override {
|
2015-01-30 00:55:25 +08:00
|
|
|
return true;
|
2013-09-20 13:14:41 +08:00
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool enableSubRegLiveness() const override {
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-07 04:22:28 +08:00
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
void setScalarizeGlobalBehavior(bool b) { ScalarizeGlobal = b; }
|
|
|
|
bool getScalarizeGlobalBehavior() const { return ScalarizeGlobal; }
|
2017-02-08 22:05:23 +08:00
|
|
|
|
2016-09-07 04:22:28 +08:00
|
|
|
/// \returns Number of execution units per compute unit supported by the
|
|
|
|
/// subtarget.
|
|
|
|
unsigned getEUsPerCU() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getEUsPerCU(this);
|
2016-09-07 04:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum number of waves per compute unit supported by the
|
|
|
|
/// subtarget without any kind of limitation.
|
|
|
|
unsigned getMaxWavesPerCU() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMaxWavesPerCU(this);
|
2016-09-07 04:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum number of waves per compute unit supported by the
|
2017-02-08 22:05:23 +08:00
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
2016-09-07 04:22:28 +08:00
|
|
|
unsigned getMaxWavesPerCU(unsigned FlatWorkGroupSize) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMaxWavesPerCU(this, FlatWorkGroupSize);
|
2016-09-07 04:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum number of waves per execution unit supported by the
|
|
|
|
/// subtarget without any kind of limitation.
|
|
|
|
unsigned getMaxWavesPerEU() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return AMDGPU::IsaInfo::getMaxWavesPerEU();
|
2016-09-07 04:22:28 +08:00
|
|
|
}
|
|
|
|
|
2017-02-08 22:05:23 +08:00
|
|
|
/// \returns Number of waves per work group supported by the subtarget and
|
|
|
|
/// limited by given \p FlatWorkGroupSize.
|
2016-09-07 04:22:28 +08:00
|
|
|
unsigned getWavesPerWorkGroup(unsigned FlatWorkGroupSize) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getWavesPerWorkGroup(this, FlatWorkGroupSize);
|
2014-12-03 01:05:41 +08:00
|
|
|
}
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
// static wrappers
|
|
|
|
static bool hasHalfRate64Ops(const TargetSubtargetInfo &STI);
|
2015-06-27 05:15:03 +08:00
|
|
|
|
2017-01-25 12:25:02 +08:00
|
|
|
// XXX - Why is this here if it isn't in the default pass set?
|
|
|
|
bool enableEarlyIfConversion() const override {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
void overrideSchedPolicy(MachineSchedPolicy &Policy,
|
|
|
|
unsigned NumRegionInstrs) const override;
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
bool isVGPRSpillingEnabled(const Function &F) const;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
2015-12-01 05:16:07 +08:00
|
|
|
unsigned getMaxNumUserSGPRs() const {
|
|
|
|
return 16;
|
|
|
|
}
|
2016-06-24 14:30:11 +08:00
|
|
|
|
|
|
|
bool hasSMemRealTime() const {
|
|
|
|
return HasSMemRealTime;
|
|
|
|
}
|
|
|
|
|
2016-10-13 02:00:51 +08:00
|
|
|
bool hasMovrel() const {
|
|
|
|
return HasMovrel;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVGPRIndexMode() const {
|
|
|
|
return HasVGPRIndexMode;
|
|
|
|
}
|
|
|
|
|
2017-03-22 01:00:32 +08:00
|
|
|
bool useVGPRIndexMode(bool UserEnable) const {
|
|
|
|
return !hasMovrel() || (UserEnable && hasVGPRIndexMode());
|
|
|
|
}
|
|
|
|
|
2016-09-17 10:02:19 +08:00
|
|
|
bool hasScalarCompareEq64() const {
|
|
|
|
return getGeneration() >= VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2016-10-29 05:55:15 +08:00
|
|
|
bool hasScalarStores() const {
|
|
|
|
return HasScalarStores;
|
|
|
|
}
|
|
|
|
|
2018-04-03 00:10:25 +08:00
|
|
|
bool hasScalarAtomics() const {
|
|
|
|
return HasScalarAtomics;
|
|
|
|
}
|
|
|
|
|
2016-10-29 12:05:06 +08:00
|
|
|
|
2017-01-20 18:01:25 +08:00
|
|
|
bool hasDPP() const {
|
|
|
|
return HasDPP;
|
|
|
|
}
|
|
|
|
|
2018-08-28 23:07:30 +08:00
|
|
|
bool hasR128A16() const {
|
|
|
|
return HasR128A16;
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool enableSIScheduler() const {
|
|
|
|
return EnableSIScheduler;
|
|
|
|
}
|
|
|
|
|
2016-06-25 11:11:28 +08:00
|
|
|
bool debuggerSupported() const {
|
2018-06-22 04:28:19 +08:00
|
|
|
return debuggerInsertNops() && debuggerEmitPrologue();
|
2016-06-25 11:11:28 +08:00
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool debuggerInsertNops() const {
|
|
|
|
return DebuggerInsertNops;
|
|
|
|
}
|
|
|
|
|
2016-06-25 11:11:28 +08:00
|
|
|
bool debuggerEmitPrologue() const {
|
|
|
|
return DebuggerEmitPrologue;
|
|
|
|
}
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool loadStoreOptEnabled() const {
|
|
|
|
return EnableLoadStoreOpt;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSGPRInitBug() const {
|
|
|
|
return SGPRInitBug;
|
|
|
|
}
|
2016-08-30 03:42:52 +08:00
|
|
|
|
2016-10-28 07:05:31 +08:00
|
|
|
bool has12DWordStoreHazard() const {
|
|
|
|
return getGeneration() != AMDGPUSubtarget::SOUTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
bool hasSMovFedHazard() const {
|
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
|
|
|
}
|
|
|
|
|
2017-11-18 05:35:32 +08:00
|
|
|
bool hasReadM0MovRelInterpHazard() const {
|
2017-02-19 02:29:53 +08:00
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
|
|
|
}
|
|
|
|
|
2017-11-18 05:35:32 +08:00
|
|
|
bool hasReadM0SendMsgHazard() const {
|
|
|
|
return getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
/// Return the maximum number of waves per SIMD for kernels using \p SGPRs
|
|
|
|
/// SGPRs
|
2016-08-30 03:42:52 +08:00
|
|
|
unsigned getOccupancyWithNumSGPRs(unsigned SGPRs) const;
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
/// Return the maximum number of waves per SIMD for kernels using \p VGPRs
|
|
|
|
/// VGPRs
|
2016-08-30 03:42:52 +08:00
|
|
|
unsigned getOccupancyWithNumVGPRs(unsigned VGPRs) const;
|
2016-10-01 00:50:36 +08:00
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
/// \returns true if the flat_scratch register should be initialized with the
|
|
|
|
/// pointer to the wave's scratch memory rather than a size and offset.
|
|
|
|
bool flatScratchIsPointer() const {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX9;
|
2016-10-01 00:50:36 +08:00
|
|
|
}
|
2016-10-29 04:31:47 +08:00
|
|
|
|
[AMDGPU] Scratch setup fix on AMDPAL gfx9+ merge shader
Summary:
With OS type AMDPAL, the scratch descriptor is hardwired to be loaded
from offset 0 of the global information table, whose low pointer is
passed in s0. For a merge shader on gfx9+, it needs to be s8 instead, as
the hardware reserves s0-s7.
Reviewers: kzhuravl
Subscribers: arsenm, nhaehnle, dstuttard, llvm-commits, t-tye, yaxunl, wdng, kzhuravl
Differential Revision: https://reviews.llvm.org/D42203
llvm-svn: 326088
2018-02-26 22:46:43 +08:00
|
|
|
/// \returns true if the machine has merged shaders in which s0-s7 are
|
|
|
|
/// reserved by the hardware and user SGPRs start at s8
|
|
|
|
bool hasMergedShaders() const {
|
|
|
|
return getGeneration() >= GFX9;
|
|
|
|
}
|
|
|
|
|
2017-02-08 21:02:33 +08:00
|
|
|
/// \returns SGPR allocation granularity supported by the subtarget.
|
|
|
|
unsigned getSGPRAllocGranule() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getSGPRAllocGranule(this);
|
2017-02-08 21:18:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns SGPR encoding granularity supported by the subtarget.
|
|
|
|
unsigned getSGPREncodingGranule() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getSGPREncodingGranule(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Total number of SGPRs supported by the subtarget.
|
|
|
|
unsigned getTotalNumSGPRs() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getTotalNumSGPRs(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Addressable number of SGPRs supported by the subtarget.
|
|
|
|
unsigned getAddressableNumSGPRs() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getAddressableNumSGPRs(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum number of SGPRs that meets the given number of waves per
|
|
|
|
/// execution unit requirement supported by the subtarget.
|
2017-02-08 22:05:23 +08:00
|
|
|
unsigned getMinNumSGPRs(unsigned WavesPerEU) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMinNumSGPRs(this, WavesPerEU);
|
2017-02-08 22:05:23 +08:00
|
|
|
}
|
2017-02-08 21:02:33 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of SGPRs that meets the given number of waves per
|
|
|
|
/// execution unit requirement supported by the subtarget.
|
2017-02-08 22:05:23 +08:00
|
|
|
unsigned getMaxNumSGPRs(unsigned WavesPerEU, bool Addressable) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMaxNumSGPRs(this, WavesPerEU, Addressable);
|
2017-02-08 22:05:23 +08:00
|
|
|
}
|
2017-02-08 21:02:33 +08:00
|
|
|
|
|
|
|
/// \returns Reserved number of SGPRs for given function \p MF.
|
|
|
|
unsigned getReservedNumSGPRs(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
/// \returns Maximum number of SGPRs that meets number of waves per execution
|
|
|
|
/// unit requirement for function \p MF, or number of SGPRs explicitly
|
|
|
|
/// requested using "amdgpu-num-sgpr" attribute attached to function \p MF.
|
|
|
|
///
|
|
|
|
/// \returns Value that meets number of waves per execution unit requirement
|
|
|
|
/// if explicitly requested value cannot be converted to integer, violates
|
|
|
|
/// subtarget's specifications, or does not meet number of waves per execution
|
|
|
|
/// unit requirement.
|
|
|
|
unsigned getMaxNumSGPRs(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
/// \returns VGPR allocation granularity supported by the subtarget.
|
|
|
|
unsigned getVGPRAllocGranule() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getVGPRAllocGranule(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
2017-02-08 21:18:40 +08:00
|
|
|
/// \returns VGPR encoding granularity supported by the subtarget.
|
|
|
|
unsigned getVGPREncodingGranule() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getVGPREncodingGranule(this);
|
2017-02-08 21:18:40 +08:00
|
|
|
}
|
|
|
|
|
2017-02-08 21:02:33 +08:00
|
|
|
/// \returns Total number of VGPRs supported by the subtarget.
|
|
|
|
unsigned getTotalNumVGPRs() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getTotalNumVGPRs(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Addressable number of VGPRs supported by the subtarget.
|
|
|
|
unsigned getAddressableNumVGPRs() const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getAddressableNumVGPRs(this);
|
2017-02-08 21:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum number of VGPRs that meets given number of waves per
|
|
|
|
/// execution unit requirement supported by the subtarget.
|
2017-02-08 22:05:23 +08:00
|
|
|
unsigned getMinNumVGPRs(unsigned WavesPerEU) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMinNumVGPRs(this, WavesPerEU);
|
2017-02-08 22:05:23 +08:00
|
|
|
}
|
2017-02-08 21:02:33 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of VGPRs that meets given number of waves per
|
|
|
|
/// execution unit requirement supported by the subtarget.
|
2017-02-08 22:05:23 +08:00
|
|
|
unsigned getMaxNumVGPRs(unsigned WavesPerEU) const {
|
2018-09-13 02:50:47 +08:00
|
|
|
return AMDGPU::IsaInfo::getMaxNumVGPRs(this, WavesPerEU);
|
2017-02-08 22:05:23 +08:00
|
|
|
}
|
2017-02-08 21:02:33 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of VGPRs that meets number of waves per execution
|
|
|
|
/// unit requirement for function \p MF, or number of VGPRs explicitly
|
|
|
|
/// requested using "amdgpu-num-vgpr" attribute attached to function \p MF.
|
|
|
|
///
|
|
|
|
/// \returns Value that meets number of waves per execution unit requirement
|
|
|
|
/// if explicitly requested value cannot be converted to integer, violates
|
|
|
|
/// subtarget's specifications, or does not meet number of waves per execution
|
|
|
|
/// unit requirement.
|
|
|
|
unsigned getMaxNumVGPRs(const MachineFunction &MF) const;
|
2017-09-20 04:54:38 +08:00
|
|
|
|
|
|
|
void getPostRAMutations(
|
|
|
|
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
|
|
|
|
const override;
|
2018-09-13 02:50:47 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of work groups per compute unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
|
|
|
unsigned getMaxWorkGroupsPerCU(unsigned FlatWorkGroupSize) const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(this, FlatWorkGroupSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum flat work group size supported by the subtarget.
|
|
|
|
unsigned getMinFlatWorkGroupSize() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMinFlatWorkGroupSize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum flat work group size supported by the subtarget.
|
|
|
|
unsigned getMaxFlatWorkGroupSize() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxFlatWorkGroupSize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum number of waves per execution unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
|
|
|
unsigned getMaxWavesPerEU(unsigned FlatWorkGroupSize) const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxWavesPerEU(this, FlatWorkGroupSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum number of waves per execution unit supported by the
|
|
|
|
/// subtarget.
|
|
|
|
unsigned getMinWavesPerEU() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMinWavesPerEU(this);
|
|
|
|
}
|
2012-12-12 05:25:42 +08:00
|
|
|
};
|
|
|
|
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
class R600Subtarget final : public R600GenSubtargetInfo,
|
2018-07-12 04:59:01 +08:00
|
|
|
public AMDGPUSubtarget {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
private:
|
|
|
|
R600InstrInfo InstrInfo;
|
|
|
|
R600FrameLowering FrameLowering;
|
|
|
|
bool FMA;
|
|
|
|
bool CaymanISA;
|
|
|
|
bool CFALUBug;
|
|
|
|
bool DX10Clamp;
|
|
|
|
bool HasVertexCache;
|
|
|
|
bool R600ALUInst;
|
|
|
|
bool FP64;
|
|
|
|
short TexVTXClauseSize;
|
|
|
|
Generation Gen;
|
|
|
|
R600TargetLowering TLInfo;
|
|
|
|
InstrItineraryData InstrItins;
|
|
|
|
SelectionDAGTargetInfo TSInfo;
|
|
|
|
|
|
|
|
public:
|
|
|
|
R600Subtarget(const Triple &TT, StringRef CPU, StringRef FS,
|
|
|
|
const TargetMachine &TM);
|
|
|
|
|
|
|
|
const R600InstrInfo *getInstrInfo() const override { return &InstrInfo; }
|
|
|
|
|
|
|
|
const R600FrameLowering *getFrameLowering() const override {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
|
|
|
|
|
|
|
const R600TargetLowering *getTargetLowering() const override {
|
|
|
|
return &TLInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
const R600RegisterInfo *getRegisterInfo() const override {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
|
|
|
|
const InstrItineraryData *getInstrItineraryData() const override {
|
|
|
|
return &InstrItins;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Nothing implemented, just prevent crashes on use.
|
|
|
|
const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
|
|
|
|
|
|
|
Generation getGeneration() const {
|
|
|
|
return Gen;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned getStackAlignment() const {
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
R600Subtarget &initializeSubtargetDependencies(const Triple &TT,
|
|
|
|
StringRef GPU, StringRef FS);
|
|
|
|
|
|
|
|
bool hasBFE() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasBFI() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasBCNT(unsigned Size) const {
|
|
|
|
if (Size == 32)
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasBORROW() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasCARRY() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasCaymanISA() const {
|
|
|
|
return CaymanISA;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFFBL() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFFBH() const {
|
|
|
|
return (getGeneration() >= EVERGREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFMA() const { return FMA; }
|
|
|
|
|
|
|
|
bool hasCFAluBug() const { return CFALUBug; }
|
|
|
|
|
|
|
|
bool hasVertexCache() const { return HasVertexCache; }
|
|
|
|
|
|
|
|
short getTexVTXClauseSize() const { return TexVTXClauseSize; }
|
|
|
|
|
|
|
|
bool enableMachineScheduler() const override {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool enableSubRegLiveness() const override {
|
|
|
|
return true;
|
|
|
|
}
|
2018-09-13 02:50:47 +08:00
|
|
|
|
|
|
|
/// \returns Maximum number of work groups per compute unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
|
|
|
unsigned getMaxWorkGroupsPerCU(unsigned FlatWorkGroupSize) const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(this, FlatWorkGroupSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum flat work group size supported by the subtarget.
|
|
|
|
unsigned getMinFlatWorkGroupSize() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMinFlatWorkGroupSize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum flat work group size supported by the subtarget.
|
|
|
|
unsigned getMaxFlatWorkGroupSize() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxFlatWorkGroupSize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Maximum number of waves per execution unit supported by the
|
|
|
|
/// subtarget and limited by given \p FlatWorkGroupSize.
|
|
|
|
unsigned getMaxWavesPerEU(unsigned FlatWorkGroupSize) const override {
|
|
|
|
return AMDGPU::IsaInfo::getMaxWavesPerEU(this, FlatWorkGroupSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \returns Minimum number of waves per execution unit supported by the
|
|
|
|
/// subtarget.
|
|
|
|
unsigned getMinWavesPerEU() const override {
|
|
|
|
return AMDGPU::IsaInfo::getMinWavesPerEU(this);
|
|
|
|
}
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
};
|
|
|
|
|
2016-12-10 06:06:55 +08:00
|
|
|
} // end namespace llvm
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-12-10 06:06:55 +08:00
|
|
|
#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H
|