mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-27 18:28:14 +00:00
AMDGPU: Always use VGPR indexing on GFX9
Reviewers: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, dstuttard, tpr Differential Revision: https://reviews.llvm.org/D31157 llvm-svn: 298396
This commit is contained in:
parent
5e7f06f354
commit
e22fdb9cac
@ -406,7 +406,7 @@ def FeatureGFX9 : SubtargetFeatureGeneration<"GFX9",
|
||||
FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
|
||||
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
|
||||
FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
|
||||
FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P
|
||||
FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode
|
||||
]
|
||||
>;
|
||||
|
||||
|
@ -625,6 +625,10 @@ public:
|
||||
return HasVGPRIndexMode;
|
||||
}
|
||||
|
||||
bool useVGPRIndexMode(bool UserEnable) const {
|
||||
return !hasMovrel() || (UserEnable && hasVGPRIndexMode());
|
||||
}
|
||||
|
||||
bool hasScalarCompareEq64() const {
|
||||
return getGeneration() >= VOLCANIC_ISLANDS;
|
||||
}
|
||||
|
@ -1667,7 +1667,7 @@ static MachineBasicBlock *emitIndirectSrc(MachineInstr &MI,
|
||||
std::tie(SubReg, Offset)
|
||||
= computeIndirectRegAndOffset(TRI, VecRC, SrcReg, Offset);
|
||||
|
||||
bool UseGPRIdxMode = ST.hasVGPRIndexMode() && EnableVGPRIndexMode;
|
||||
bool UseGPRIdxMode = ST.useVGPRIndexMode(EnableVGPRIndexMode);
|
||||
|
||||
if (setM0ToIndexFromSGPR(TII, MRI, MI, Offset, UseGPRIdxMode, true)) {
|
||||
MachineBasicBlock::iterator I(&MI);
|
||||
@ -1769,7 +1769,7 @@ static MachineBasicBlock *emitIndirectDst(MachineInstr &MI,
|
||||
std::tie(SubReg, Offset) = computeIndirectRegAndOffset(TRI, VecRC,
|
||||
SrcVec->getReg(),
|
||||
Offset);
|
||||
bool UseGPRIdxMode = ST.hasVGPRIndexMode() && EnableVGPRIndexMode;
|
||||
bool UseGPRIdxMode = ST.useVGPRIndexMode(EnableVGPRIndexMode);
|
||||
|
||||
if (Idx->getReg() == AMDGPU::NoRegister) {
|
||||
MachineBasicBlock::iterator I(&MI);
|
||||
|
@ -1,6 +1,7 @@
|
||||
; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=MOVREL %s
|
||||
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=MOVREL %s
|
||||
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -amdgpu-vgpr-index-mode -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=IDXMODE %s
|
||||
; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=IDXMODE %s
|
||||
|
||||
; Tests for indirect addressing on SI, which is implemented using dynamic
|
||||
; indexing of vectors.
|
||||
|
Loading…
Reference in New Issue
Block a user