[llvm] [AMDGPU] Fix nondeterminism in SIFixSGPRCopies (PR #70644)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 08:45:40 PDT 2023


jayfoad wrote:

> https://llvm.org/docs/ProgrammersManual.html#llvm-adt-mapvector-h The usage manual recommends removing elements in bulk, since with this container removal is slower. Can you extract the removal at L1043 V2SCopies.erase(C.ID) to a removeList and do it a after the loop?

I'm not totally comfortable doing that myself because I don't fully understand the first couple of loops in `SIFixSGPRCopies::lowerVGPR2SGPRCopies`, where some items from `V2SCopies` are pushed onto `LoweringWorklist` and then items from `LoweringWorklist` are looked up in `V2SCopies` and potentially removed.

@alex-t could you make the change that @Sisyph requested?

https://github.com/llvm/llvm-project/pull/70644


More information about the llvm-commits mailing list