Skip to content

Commit ce031fc

Browse files
authored
[AMDGPU] Fix non-deterministic iteration order in SIFixSGPRCopies (#66617)
Use of DenseSet was causing some non-deteminism in SIFixSGPRSopies. Changing to SetVector fixes the problem.
1 parent 03be486 commit ce031fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class V2SCopyInfo {
8888
// VGPR to SGPR copy being processed
8989
MachineInstr *Copy;
9090
// All SALU instructions reachable from this copy in SSA graph
91-
DenseSet<MachineInstr *> SChain;
91+
SetVector<MachineInstr *> SChain;
9292
// Number of SGPR to VGPR copies that are used to put the SALU computation
9393
// results back to VALU.
9494
unsigned NumSVCopies;
@@ -1009,7 +1009,7 @@ void SIFixSGPRCopies::lowerVGPR2SGPRCopies(MachineFunction &MF) {
10091009
V2SCopyInfo &SI = SibInfoIt->getSecond();
10101010
LLVM_DEBUG(dbgs() << "Sibling:\n"; SI.dump());
10111011
if (!SI.NeedToBeConvertedToVALU) {
1012-
set_subtract(SI.SChain, C.SChain);
1012+
SI.SChain.set_subtract(C.SChain);
10131013
if (needToBeConvertedToVALU(&SI))
10141014
LoweringWorklist.push_back(SI.ID);
10151015
}

0 commit comments

Comments
 (0)