2015-11-07 02:17:45 +08:00
|
|
|
//=====-- AMDGPUSubtarget.h - Define Subtarget for AMDGPU ------*- C++ -*-====//
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
//==-----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \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,
|
2019-04-25 01:03:15 +08:00
|
|
|
GFX9 = 7,
|
|
|
|
GFX10 = 8
|
2018-07-12 04:59:01 +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:
|
|
|
|
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;
|
2019-07-31 09:07:10 +08:00
|
|
|
unsigned MaxWavesPerEU;
|
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;
|
|
|
|
}
|
|
|
|
|
2019-11-01 09:50:30 +08:00
|
|
|
bool hasFP32Denormals(const Function &F) const {
|
|
|
|
// FIXME: This should not be a property of the subtarget. This should be a
|
|
|
|
// property with a default set by the calling convention which can be
|
|
|
|
// overridden by attributes. For now, use the subtarget feature as a
|
|
|
|
// placeholder attribute. The function arguments only purpose is to
|
|
|
|
// discourage use without a function context until this is removed.
|
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 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;
|
|
|
|
}
|
|
|
|
|
2019-10-15 20:56:24 +08:00
|
|
|
Align getAlignmentForImplicitArgPtr() const {
|
|
|
|
return isAmdHsaOS() ? Align(8) : Align(4);
|
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-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
|
|
|
|
2019-07-31 09:07:10 +08:00
|
|
|
/// \returns Maximum number of waves per execution unit supported by the
|
|
|
|
/// subtarget without any kind of limitation.
|
|
|
|
unsigned getMaxWavesPerEU() const { return MaxWavesPerEU; }
|
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
|
|
|
|
|
|
|
/// 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);
|
|
|
|
}
|
2019-10-15 20:56:24 +08:00
|
|
|
uint64_t getExplicitKernArgSize(const Function &F, Align &MaxAlign) const;
|
|
|
|
unsigned getKernArgSegmentSize(const Function &F, Align &MaxAlign) const;
|
2018-07-20 17:05:08 +08:00
|
|
|
|
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 {
|
2019-07-31 09:07:10 +08:00
|
|
|
|
|
|
|
using AMDGPUSubtarget::getMaxWavesPerEU;
|
|
|
|
|
2013-06-08 04:37:48 +08:00
|
|
|
public:
|
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;
|
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;
|
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;
|
2019-05-16 22:48:34 +08:00
|
|
|
bool DoesNotSupportXNACK;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool EnableCuMode;
|
2017-02-10 10:15:29 +08:00
|
|
|
bool TrapHandler;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
|
|
|
// Used as options.
|
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;
|
[AMDGPU] Add support for TFE/LWE in image intrinsics. 2nd try
TFE and LWE support requires extra result registers that are written in the
event of a failure in order to detect that failure case.
The specific use-case that initiated these changes is sparse texture support.
This means that if image intrinsics are used with either option turned on, the
programmer must ensure that the return type can contain all of the expected
results. This can result in redundant registers since the vector size must be a
power-of-2.
This change takes roughly 6 parts:
1. Modify the instruction defs in tablegen to add new instruction variants that
can accomodate the extra return values.
2. Updates to lowerImage in SIISelLowering.cpp to accomodate setting TFE or LWE
(where the bulk of the work for these instruction types is now done)
3. Extra verification code to catch cases where intrinsics have been used but
insufficient return registers are used.
4. Modification to the adjustWritemask optimisation to account for TFE/LWE being
enabled (requires extra registers to be maintained for error return value).
5. An extra pass to zero initialize the error value return - this is because if
the error does not occur, the register is not written and thus must be zeroed
before use. Also added a new (on by default) option to ensure ALL return values
are zero-initialized that is required for sparse texture support.
6. Disable the inst_combine optimization in the presence of tfe/lwe (later TODO
for this to re-enable and handle correctly).
There's an additional fix now to avoid a dmask=0
For an image intrinsic with tfe where all result channels except tfe
were unused, I was getting an image instruction with dmask=0 and only a
single vgpr result for tfe. That is incorrect because the hardware
assumes there is at least one vgpr result, plus the one for tfe.
Fixed by forcing dmask to 1, which gives the desired two vgpr result
with tfe in the second one.
The TFE or LWE result is returned from the intrinsics using an aggregate
type. Look in the test code provided to see how this works, but in essence IR
code to invoke the intrinsic looks as follows:
%v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 15,
i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
%v.vec = extractvalue {<4 x float>, i32} %v, 0
%v.err = extractvalue {<4 x float>, i32} %v, 1
This re-submit of the change also includes a slight modification in
SIISelLowering.cpp to work-around a compiler bug for the powerpc_le
platform that caused a buildbot failure on a previous submission.
Differential revision: https://reviews.llvm.org/D48826
Change-Id: If222bc03642e76cf98059a6bef5d5bffeda38dda
Work around for ppcle compiler bug
Change-Id: Ie284cf24b2271215be1b9dc95b485fd15000e32b
llvm-svn: 351054
2019-01-14 19:55:24 +08:00
|
|
|
bool EnablePRTStrictNull;
|
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;
|
2019-04-06 02:24:34 +08:00
|
|
|
bool GFX8Insts;
|
2017-02-19 03:12:26 +08:00
|
|
|
bool GFX9Insts;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool GFX10Insts;
|
2019-04-06 02:24:34 +08:00
|
|
|
bool GFX7GFX8GFX9Insts;
|
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;
|
2019-06-13 02:02:41 +08:00
|
|
|
bool HasDPP8;
|
2018-08-28 23:07:30 +08:00
|
|
|
bool HasR128A16;
|
2020-01-29 17:04:36 +08:00
|
|
|
bool HasGFX10A16;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool HasNSAEncoding;
|
2018-05-01 03:08:16 +08:00
|
|
|
bool HasDLInsts;
|
2019-02-09 08:34:21 +08:00
|
|
|
bool HasDot1Insts;
|
|
|
|
bool HasDot2Insts;
|
2019-07-10 02:10:06 +08:00
|
|
|
bool HasDot3Insts;
|
|
|
|
bool HasDot4Insts;
|
2019-06-14 08:33:31 +08:00
|
|
|
bool HasDot5Insts;
|
|
|
|
bool HasDot6Insts;
|
2019-07-10 02:10:06 +08:00
|
|
|
bool HasMAIInsts;
|
|
|
|
bool HasPkFmacF16Inst;
|
|
|
|
bool HasAtomicFaddInsts;
|
2018-11-06 06:44:19 +08:00
|
|
|
bool EnableSRAMECC;
|
2019-04-03 09:58:57 +08:00
|
|
|
bool DoesNotSupportSRAMECC;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool HasNoSdstCMPX;
|
|
|
|
bool HasVscnt;
|
|
|
|
bool HasRegisterBanking;
|
|
|
|
bool HasVOP3Literal;
|
|
|
|
bool HasNoDataDepHazard;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool FlatAddressSpace;
|
2017-05-11 05:19:05 +08:00
|
|
|
bool FlatInstOffsets;
|
|
|
|
bool FlatGlobalInsts;
|
|
|
|
bool FlatScratchInsts;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool ScalarFlatScratchInsts;
|
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;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool LDSMisalignedBug;
|
2019-08-24 06:09:58 +08:00
|
|
|
bool HasMFMAInlineLiteralBug;
|
2016-06-24 14:30:11 +08:00
|
|
|
bool HasVertexCache;
|
|
|
|
short TexVTXClauseSize;
|
2016-12-09 01:28:47 +08:00
|
|
|
bool ScalarizeGlobal;
|
2016-06-24 14:30:11 +08:00
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool HasVcmpxPermlaneHazard;
|
|
|
|
bool HasVMEMtoScalarWriteHazard;
|
|
|
|
bool HasSMEMtoVectorWriteHazard;
|
|
|
|
bool HasInstFwdPrefetchBug;
|
|
|
|
bool HasVcmpxExecWARHazard;
|
|
|
|
bool HasLdsBranchVmemWARHazard;
|
|
|
|
bool HasNSAtoVMEMBug;
|
2019-06-27 01:34:57 +08:00
|
|
|
bool HasOffset3fBug;
|
2019-04-25 01:03:15 +08:00
|
|
|
bool HasFlatSegmentOffsetBug;
|
|
|
|
|
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
|
|
|
|
2019-05-24 03:38:14 +08:00
|
|
|
// See COMPUTE_TMPRING_SIZE.WAVESIZE, 13-bit field in units of 256-dword.
|
|
|
|
static const unsigned MaxWaveScratchSize = (256 * 4) * ((1 << 13) - 1);
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2019-08-13 14:26:59 +08:00
|
|
|
InstructionSelector *getInstructionSelector() 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
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2019-05-24 03:38:14 +08:00
|
|
|
/// Return the number of high bits known to be zero fror a frame index.
|
|
|
|
unsigned getKnownHighZeroBitsForFrameIndex() const {
|
|
|
|
return countLeadingZeros(MaxWaveScratchSize) + getWavefrontSizeLog2();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-05-02 11:47:23 +08:00
|
|
|
unsigned getConstantBusLimit(unsigned Opcode) const;
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
// Return true if the target only has the reverse operand versions of VALU
|
|
|
|
// shift instructions (e.g. v_lshrrev_b32, and no v_lshr_b32).
|
|
|
|
bool hasOnlyRevVALUShifts() const {
|
|
|
|
return getGeneration() >= VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2020-01-24 23:01:15 +08:00
|
|
|
bool hasFractBug() const {
|
|
|
|
return getGeneration() == SOUTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2018-10-30 01:26:01 +08:00
|
|
|
bool hasSwap() const {
|
|
|
|
return GFX9Insts;
|
|
|
|
}
|
|
|
|
|
2019-09-10 01:04:18 +08:00
|
|
|
bool hasScalarPackInsts() const {
|
|
|
|
return GFX9Insts;
|
|
|
|
}
|
|
|
|
|
2019-09-20 00:26:14 +08:00
|
|
|
bool hasScalarMulHiInsts() const {
|
|
|
|
return GFX9Insts;
|
|
|
|
}
|
|
|
|
|
2017-02-10 10:15:29 +08:00
|
|
|
TrapHandlerAbi getTrapHandlerAbi() const {
|
|
|
|
return isAmdHsaOS() ? TrapHandlerAbiHsa : TrapHandlerAbiNone;
|
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
/// True if the offset field of DS instructions works as expected. On SI, the
|
|
|
|
/// offset uses a 16-bit adder and does not always wrap properly.
|
|
|
|
bool hasUsableDSOffset() const {
|
|
|
|
return getGeneration() >= SEA_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2015-07-07 00:01:58 +08:00
|
|
|
bool unsafeDSOffsetFoldingEnabled() const {
|
|
|
|
return EnableUnsafeDSOffsetFolding;
|
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
/// Condition output from div_scale is usable.
|
|
|
|
bool hasUsableDivScaleConditionOutput() const {
|
|
|
|
return getGeneration() != SOUTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Extra wait hazard is needed in some cases before
|
|
|
|
/// s_cbranch_vccnz/s_cbranch_vccz.
|
|
|
|
bool hasReadVCCZBug() const {
|
|
|
|
return getGeneration() <= SEA_ISLANDS;
|
|
|
|
}
|
|
|
|
|
[AMDGPU] Fix vccz after v_readlane/v_readfirstlane to vcc_lo/hi
Summary:
Up to gfx9, writes to vcc_lo and vcc_hi by instructions like
v_readlane and v_readfirstlane do not update vccz to reflect the new
value of vcc. Fix it by reusing part of the existing vccz bug handling
code, which inserts an "s_mov_b64 vcc, vcc" instruction to restore vccz
just before an instruction that needs the correct value.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69661
2019-10-30 20:18:51 +08:00
|
|
|
/// Writes to VCC_LO/VCC_HI update the VCCZ flag.
|
|
|
|
bool partialVCCWritesUpdateVCCZ() const {
|
|
|
|
return getGeneration() >= GFX10;
|
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
/// A read of an SGPR by SMRD instruction requires 4 wait states when the SGPR
|
|
|
|
/// was written by a VALU instruction.
|
|
|
|
bool hasSMRDReadVALUDefHazard() const {
|
|
|
|
return getGeneration() == SOUTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A read of an SGPR by a VMEM instruction requires 5 wait states when the
|
|
|
|
/// SGPR was written by a VALU Instruction.
|
|
|
|
bool hasVMEMReadSGPRVALUDefHazard() const {
|
|
|
|
return getGeneration() >= VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasRFEHazards() const {
|
|
|
|
return getGeneration() >= VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Number of hazard wait states for s_setreg_b32/s_setreg_imm32_b32.
|
|
|
|
unsigned getSetRegWaitStates() const {
|
|
|
|
return getGeneration() <= SEA_ISLANDS ? 1 : 2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2019-11-01 09:50:30 +08:00
|
|
|
/// Alias for hasFP64FP16Denormals
|
|
|
|
bool hasFP16Denormals(const Function &F) 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
|
|
|
|
2019-11-01 09:50:30 +08:00
|
|
|
/// Alias for hasFP64FP16Denormals
|
|
|
|
bool hasFP64Denormals(const Function &F) const {
|
|
|
|
return FP64FP16Denormals;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFP64FP16Denormals(const Function &F) 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;
|
|
|
|
}
|
|
|
|
|
Re-commit: [AMDGPU] Use S_DENORM_MODE for gfx10
Summary: During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.
Reviewers: arsenm, rampitec
Reviewed By: arsenm, rampitec
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65620
llvm-svn: 367969
2019-08-06 10:16:11 +08:00
|
|
|
/// \returns If target supports S_DENORM_MODE.
|
|
|
|
bool hasDenormModeInst() const {
|
|
|
|
return getGeneration() >= AMDGPUSubtarget::GFX10;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
/// Have v_trunc_f64, v_ceil_f64, v_rndne_f64
|
|
|
|
bool haveRoundOpsF64() const {
|
|
|
|
return CIInsts;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
[AMDGPU] Add support for TFE/LWE in image intrinsics. 2nd try
TFE and LWE support requires extra result registers that are written in the
event of a failure in order to detect that failure case.
The specific use-case that initiated these changes is sparse texture support.
This means that if image intrinsics are used with either option turned on, the
programmer must ensure that the return type can contain all of the expected
results. This can result in redundant registers since the vector size must be a
power-of-2.
This change takes roughly 6 parts:
1. Modify the instruction defs in tablegen to add new instruction variants that
can accomodate the extra return values.
2. Updates to lowerImage in SIISelLowering.cpp to accomodate setting TFE or LWE
(where the bulk of the work for these instruction types is now done)
3. Extra verification code to catch cases where intrinsics have been used but
insufficient return registers are used.
4. Modification to the adjustWritemask optimisation to account for TFE/LWE being
enabled (requires extra registers to be maintained for error return value).
5. An extra pass to zero initialize the error value return - this is because if
the error does not occur, the register is not written and thus must be zeroed
before use. Also added a new (on by default) option to ensure ALL return values
are zero-initialized that is required for sparse texture support.
6. Disable the inst_combine optimization in the presence of tfe/lwe (later TODO
for this to re-enable and handle correctly).
There's an additional fix now to avoid a dmask=0
For an image intrinsic with tfe where all result channels except tfe
were unused, I was getting an image instruction with dmask=0 and only a
single vgpr result for tfe. That is incorrect because the hardware
assumes there is at least one vgpr result, plus the one for tfe.
Fixed by forcing dmask to 1, which gives the desired two vgpr result
with tfe in the second one.
The TFE or LWE result is returned from the intrinsics using an aggregate
type. Look in the test code provided to see how this works, but in essence IR
code to invoke the intrinsic looks as follows:
%v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 15,
i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
%v.vec = extractvalue {<4 x float>, i32} %v, 0
%v.err = extractvalue {<4 x float>, i32} %v, 1
This re-submit of the change also includes a slight modification in
SIISelLowering.cpp to work-around a compiler bug for the powerpc_le
platform that caused a buildbot failure on a previous submission.
Differential revision: https://reviews.llvm.org/D48826
Change-Id: If222bc03642e76cf98059a6bef5d5bffeda38dda
Work around for ppcle compiler bug
Change-Id: Ie284cf24b2271215be1b9dc95b485fd15000e32b
llvm-svn: 351054
2019-01-14 19:55:24 +08:00
|
|
|
/// \returns If target requires PRT Struct NULL support (zero result registers
|
|
|
|
/// for sparse texture support).
|
|
|
|
bool usePRTStrictNull() const {
|
|
|
|
return EnablePRTStrictNull;
|
|
|
|
}
|
|
|
|
|
2017-06-03 01:40:26 +08:00
|
|
|
bool hasAutoWaitcntBeforeBarrier() const {
|
|
|
|
return AutoWaitcntBeforeBarrier;
|
|
|
|
}
|
|
|
|
|
2017-10-14 23:59:07 +08:00
|
|
|
bool hasCodeObjectV3() const {
|
2018-11-15 10:32:43 +08:00
|
|
|
// FIXME: Need to add code object v3 support for mesa and pal.
|
|
|
|
return isAmdHsaOS() ? CodeObjectV3 : false;
|
2017-10-14 23:59:07 +08:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool isCuModeEnabled() const {
|
|
|
|
return EnableCuMode;
|
|
|
|
}
|
|
|
|
|
2017-01-31 09:20:54 +08:00
|
|
|
bool hasFlatAddressSpace() const {
|
|
|
|
return FlatAddressSpace;
|
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
bool hasFlatScrRegister() const {
|
|
|
|
return hasFlatAddressSpace();
|
|
|
|
}
|
|
|
|
|
2017-05-11 05:19:05 +08:00
|
|
|
bool hasFlatInstOffsets() const {
|
|
|
|
return FlatInstOffsets;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFlatGlobalInsts() const {
|
|
|
|
return FlatGlobalInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasFlatScratchInsts() const {
|
|
|
|
return FlatScratchInsts;
|
|
|
|
}
|
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool hasScalarFlatScratchInsts() const {
|
|
|
|
return ScalarFlatScratchInsts;
|
|
|
|
}
|
|
|
|
|
2020-01-17 04:43:22 +08:00
|
|
|
bool hasMultiDwordFlatScratchAddressing() const {
|
|
|
|
return getGeneration() >= GFX9;
|
|
|
|
}
|
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool hasFlatSegmentOffsetBug() const {
|
|
|
|
return HasFlatSegmentOffsetBug;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-03-09 04:58:11 +08:00
|
|
|
bool d16PreservesUnusedBits() const {
|
|
|
|
return hasD16LoadStore() && !isSRAMECCEnabled();
|
|
|
|
}
|
|
|
|
|
2019-06-20 07:54:58 +08:00
|
|
|
bool hasD16Images() const {
|
|
|
|
return getGeneration() >= VOLCANIC_ISLANDS;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-06-21 04:54:32 +08:00
|
|
|
// True if the hardware rewinds and replays GWS operations if a wave is
|
|
|
|
// preempted.
|
|
|
|
//
|
|
|
|
// If this is false, a GWS operation requires testing if a nack set the
|
|
|
|
// MEM_VIOL bit, and repeating if so.
|
|
|
|
bool hasGWSAutoReplay() const {
|
|
|
|
return getGeneration() >= GFX9;
|
|
|
|
}
|
|
|
|
|
2019-06-21 05:11:42 +08:00
|
|
|
/// \returns if target has ds_gws_sema_release_all instruction.
|
|
|
|
bool hasGWSSemaReleaseAll() const {
|
|
|
|
return CIInsts;
|
|
|
|
}
|
|
|
|
|
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-05-01 03:08:16 +08:00
|
|
|
bool hasDLInsts() const {
|
|
|
|
return HasDLInsts;
|
|
|
|
}
|
|
|
|
|
2019-02-09 08:34:21 +08:00
|
|
|
bool hasDot1Insts() const {
|
|
|
|
return HasDot1Insts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasDot2Insts() const {
|
|
|
|
return HasDot2Insts;
|
2019-01-10 11:25:20 +08:00
|
|
|
}
|
|
|
|
|
2019-07-10 02:10:06 +08:00
|
|
|
bool hasDot3Insts() const {
|
|
|
|
return HasDot3Insts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasDot4Insts() const {
|
|
|
|
return HasDot4Insts;
|
|
|
|
}
|
|
|
|
|
2019-06-14 08:33:31 +08:00
|
|
|
bool hasDot5Insts() const {
|
|
|
|
return HasDot5Insts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasDot6Insts() const {
|
|
|
|
return HasDot6Insts;
|
|
|
|
}
|
|
|
|
|
2019-07-10 02:10:06 +08:00
|
|
|
bool hasMAIInsts() const {
|
|
|
|
return HasMAIInsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasPkFmacF16Inst() const {
|
|
|
|
return HasPkFmacF16Inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasAtomicFaddInsts() const {
|
|
|
|
return HasAtomicFaddInsts;
|
|
|
|
}
|
|
|
|
|
2018-11-06 06:44:19 +08:00
|
|
|
bool isSRAMECCEnabled() const {
|
|
|
|
return EnableSRAMECC;
|
2018-05-05 04:06:57 +08:00
|
|
|
}
|
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool hasNoSdstCMPX() const {
|
|
|
|
return HasNoSdstCMPX;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVscnt() const {
|
|
|
|
return HasVscnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasRegisterBanking() const {
|
|
|
|
return HasRegisterBanking;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVOP3Literal() const {
|
|
|
|
return HasVOP3Literal;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasNoDataDepHazard() const {
|
|
|
|
return HasNoDataDepHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool vmemWriteNeedsExpWaitcnt() const {
|
|
|
|
return getGeneration() < SEA_ISLANDS;
|
|
|
|
}
|
|
|
|
|
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.
|
[Alignment][NFC] Use Align for TargetFrameLowering/Subtarget
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68993
llvm-svn: 375084
2019-10-17 15:49:39 +08:00
|
|
|
Align getStackAlignment() const { return Align(16); }
|
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
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-01-03 05:45:33 +08:00
|
|
|
bool useVGPRIndexMode() const;
|
2017-03-22 01:00:32 +08:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-01-23 02:36:06 +08:00
|
|
|
bool hasLDSFPAtomics() const {
|
2019-04-06 02:24:34 +08:00
|
|
|
return GFX8Insts;
|
2019-01-23 02:36:06 +08:00
|
|
|
}
|
2016-10-29 12:05:06 +08:00
|
|
|
|
2017-01-20 18:01:25 +08:00
|
|
|
bool hasDPP() const {
|
|
|
|
return HasDPP;
|
|
|
|
}
|
|
|
|
|
[AMDGPU] gfx10 atomic optimizer changes.
Summary:
Add support for gfx10, where all DPP operations are confined to work
within a single row of 16 lanes, and wave32.
Reviewers: arsenm, sheredom, critson, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, jfb, dstuttard, tpr, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65644
llvm-svn: 369745
2019-08-23 18:07:43 +08:00
|
|
|
bool hasDPPBroadcasts() const {
|
|
|
|
return HasDPP && getGeneration() < GFX10;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasDPPWavefrontShifts() const {
|
|
|
|
return HasDPP && getGeneration() < GFX10;
|
|
|
|
}
|
|
|
|
|
2019-06-13 02:02:41 +08:00
|
|
|
bool hasDPP8() const {
|
|
|
|
return HasDPP8;
|
|
|
|
}
|
|
|
|
|
2018-08-28 23:07:30 +08:00
|
|
|
bool hasR128A16() const {
|
|
|
|
return HasR128A16;
|
|
|
|
}
|
|
|
|
|
2020-01-29 17:04:36 +08:00
|
|
|
bool hasGFX10A16() const {
|
|
|
|
return HasGFX10A16;
|
|
|
|
}
|
|
|
|
|
2019-06-27 01:34:57 +08:00
|
|
|
bool hasOffset3fBug() const {
|
|
|
|
return HasOffset3fBug;
|
|
|
|
}
|
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool hasNSAEncoding() const {
|
|
|
|
return HasNSAEncoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasMadF16() const;
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool enableSIScheduler() const {
|
|
|
|
return EnableSIScheduler;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool loadStoreOptEnabled() const {
|
|
|
|
return EnableLoadStoreOpt;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSGPRInitBug() const {
|
|
|
|
return SGPRInitBug;
|
|
|
|
}
|
2016-08-30 03:42:52 +08:00
|
|
|
|
2019-08-24 06:09:58 +08:00
|
|
|
bool hasMFMAInlineLiteralBug() const {
|
|
|
|
return HasMFMAInlineLiteralBug;
|
|
|
|
}
|
|
|
|
|
2016-10-28 07:05:31 +08:00
|
|
|
bool has12DWordStoreHazard() const {
|
|
|
|
return getGeneration() != AMDGPUSubtarget::SOUTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2019-01-11 00:21:08 +08:00
|
|
|
// \returns true if the subtarget supports DWORDX3 load/store instructions.
|
|
|
|
bool hasDwordx3LoadStores() const {
|
|
|
|
return CIInsts;
|
|
|
|
}
|
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
bool hasSMovFedHazard() const {
|
2019-04-06 02:24:34 +08:00
|
|
|
return getGeneration() == AMDGPUSubtarget::GFX9;
|
2017-02-19 02:29:53 +08:00
|
|
|
}
|
|
|
|
|
2017-11-18 05:35:32 +08:00
|
|
|
bool hasReadM0MovRelInterpHazard() const {
|
2019-04-06 02:24:34 +08:00
|
|
|
return getGeneration() == AMDGPUSubtarget::GFX9;
|
2017-02-19 02:29:53 +08:00
|
|
|
}
|
|
|
|
|
2017-11-18 05:35:32 +08:00
|
|
|
bool hasReadM0SendMsgHazard() const {
|
2019-04-06 02:24:34 +08:00
|
|
|
return getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS &&
|
|
|
|
getGeneration() <= AMDGPUSubtarget::GFX9;
|
2017-11-18 05:35:32 +08:00
|
|
|
}
|
|
|
|
|
2019-04-25 01:03:15 +08:00
|
|
|
bool hasVcmpxPermlaneHazard() const {
|
|
|
|
return HasVcmpxPermlaneHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVMEMtoScalarWriteHazard() const {
|
|
|
|
return HasVMEMtoScalarWriteHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasSMEMtoVectorWriteHazard() const {
|
|
|
|
return HasSMEMtoVectorWriteHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasLDSMisalignedBug() const {
|
|
|
|
return LDSMisalignedBug && !EnableCuMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasInstFwdPrefetchBug() const {
|
|
|
|
return HasInstFwdPrefetchBug;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasVcmpxExecWARHazard() const {
|
|
|
|
return HasVcmpxExecWARHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasLdsBranchVmemWARHazard() const {
|
|
|
|
return HasLdsBranchVmemWARHazard;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasNSAtoVMEMBug() const {
|
|
|
|
return HasNSAtoVMEMBug;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2019-07-31 09:07:10 +08:00
|
|
|
/// Return occupancy for the given function. Used LDS and a number of
|
|
|
|
/// registers if provided.
|
|
|
|
/// Note, occupancy can be affected by the scratch allocation as well, but
|
|
|
|
/// we do not have enough information to compute it.
|
|
|
|
unsigned computeOccupancy(const MachineFunction &MF, unsigned LDSSize = 0,
|
|
|
|
unsigned NumSGPRs = 0, unsigned NumVGPRs = 0) const;
|
|
|
|
|
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
|
|
|
|
2019-06-14 07:47:36 +08:00
|
|
|
bool isWave32() const {
|
|
|
|
return WavefrontSize == 32;
|
|
|
|
}
|
|
|
|
|
2019-06-17 01:13:09 +08:00
|
|
|
const TargetRegisterClass *getBoolRC() const {
|
|
|
|
return getRegisterInfo()->getBoolRC();
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
}
|
2020-01-11 04:28:37 +08:00
|
|
|
|
|
|
|
void adjustSchedDependency(SUnit *Src, SUnit *Dst, SDep &Dep) const override;
|
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 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;
|
|
|
|
}
|
|
|
|
|
[Alignment][NFC] Use Align for TargetFrameLowering/Subtarget
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68993
llvm-svn: 375084
2019-10-17 15:49:39 +08:00
|
|
|
Align getStackAlignment() const { return Align(4); }
|
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
|
|
|
|
|
|
|
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
|