Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ bool SIFixSGPRCopies::run(MachineFunction &MF) {
TII->get(AMDGPU::COPY), NewDst)
.addReg(MO.getReg());
MO.setReg(NewDst);

// FIXME: We are transitively revisiting users of this
// instruction for every input.
analyzeVGPRToSGPRCopy(NewCopy);
}
}
Expand Down Expand Up @@ -928,6 +931,8 @@ void SIFixSGPRCopies::analyzeVGPRToSGPRCopy(MachineInstr* MI) {

V2SCopyInfo Info(getNextVGPRToSGPRCopyId(), MI,
TRI->getRegSizeInBits(*DstRC));
V2SCopies[Info.ID] = Info;

SmallVector<MachineInstr *, 8> AnalysisWorklist;
// Needed because the SSA is not a tree but a graph and may have
// forks and joins. We should not then go same way twice.
Expand Down Expand Up @@ -976,7 +981,6 @@ void SIFixSGPRCopies::analyzeVGPRToSGPRCopy(MachineInstr* MI) {
AnalysisWorklist.push_back(U);
}
}
V2SCopies[Info.ID] = Info;
}

// The main function that computes the VGPR to SGPR copy score
Expand Down
464 changes: 231 additions & 233 deletions llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll

Large diffs are not rendered by default.

Loading