File tree Expand file tree Collapse file tree 2 files changed +508
-2
lines changed
Expand file tree Collapse file tree 2 files changed +508
-2
lines changed Original file line number Diff line number Diff 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+
3036namespace {
3137
3238class 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 }
You can’t perform that action at this time.
0 commit comments