Skip to content

Commit 4dfc7ab

Browse files
committed
Control with flag
Change-Id: I45128d10724a59687edda05a6fcd37302bfe7e6d
1 parent f797b9b commit 4dfc7ab

File tree

2 files changed

+508
-2
lines changed

2 files changed

+508
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUPrepareAGPRAlloc.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ using namespace llvm;
2727

2828
#define DEBUG_TYPE "amdgpu-prepare-agpr-alloc"
2929

30+
static cl::opt<bool> InflateToAVClass(
31+
"amdgpu-avgpr-inflation", cl::Hidden,
32+
cl::desc("Whether to inflate register to the avgpr register "
33+
"class -- which is assignable to either vgpr or agpr."),
34+
cl::init(false));
35+
3036
namespace {
3137

3238
class AMDGPUPrepareAGPRAllocImpl {
@@ -122,6 +128,9 @@ bool AMDGPUPrepareAGPRAllocImpl::run(MachineFunction &MF) {
122128
continue;
123129
}
124130

131+
if (!InflateToAVClass)
132+
continue;
133+
125134
for (MachineOperand &Op : MI.operands()) {
126135
if (!Op.isReg() || !Op.isDef())
127136
continue;
@@ -132,7 +141,7 @@ bool AMDGPUPrepareAGPRAllocImpl::run(MachineFunction &MF) {
132141

133142
const TargetRegisterClass *RC = MRI.getRegClass(DefReg);
134143

135-
if (TRI->isAGPRClass(RC) || TRI->isVGPRClass(RC))
144+
if (TRI->hasVectorRegisters(RC))
136145
Changed |= MRI.recomputeRegClass(DefReg);
137146
}
138147
}

0 commit comments

Comments
 (0)