Skip to content

Commit 29aa9d0

Browse files
committed
Revert "AMDGPU: Move insertion into V2SCopies map (#130776)"
This reverts commit dea5aa7.
1 parent c30776a commit 29aa9d0

39 files changed

+8132
-7440
lines changed

llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,6 @@ bool SIFixSGPRCopies::run(MachineFunction &MF) {
691691
TII->get(AMDGPU::COPY), NewDst)
692692
.addReg(MO.getReg());
693693
MO.setReg(NewDst);
694-
695-
// FIXME: We are transitively revisiting users of this
696-
// instruction for every input.
697694
analyzeVGPRToSGPRCopy(NewCopy);
698695
}
699696
}
@@ -931,8 +928,6 @@ void SIFixSGPRCopies::analyzeVGPRToSGPRCopy(MachineInstr* MI) {
931928

932929
V2SCopyInfo Info(getNextVGPRToSGPRCopyId(), MI,
933930
TRI->getRegSizeInBits(*DstRC));
934-
V2SCopies[Info.ID] = Info;
935-
936931
SmallVector<MachineInstr *, 8> AnalysisWorklist;
937932
// Needed because the SSA is not a tree but a graph and may have
938933
// forks and joins. We should not then go same way twice.
@@ -981,6 +976,7 @@ void SIFixSGPRCopies::analyzeVGPRToSGPRCopy(MachineInstr* MI) {
981976
AnalysisWorklist.push_back(U);
982977
}
983978
}
979+
V2SCopies[Info.ID] = Info;
984980
}
985981

986982
// The main function that computes the VGPR to SGPR copy score

llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll

Lines changed: 233 additions & 231 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)