[CUDA] Use SetVector for CUDADeviceVarODRUsedByHost for determinism (#188616)

This replaces DenseSet with SetVector to avoid non-deterministic
iteration order
when emitting device variables ODR-used by host.
This commit is contained in:
Artem Belevich 2026-03-26 14:14:28 -07:00 committed by GitHub
parent 1aefe3b111
commit a4ce617c0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1368,7 +1368,7 @@ public:
/// This does not include extern shared variables used by device host
/// functions as addresses of shared variables are per warp, therefore
/// cannot be accessed by host code.
llvm::DenseSet<const VarDecl *> CUDADeviceVarODRUsedByHost;
llvm::SetVector<const VarDecl *> CUDADeviceVarODRUsedByHost;
/// Keep track of CUDA/HIP external kernels or device variables ODR-used by
/// host code. SetVector is used to maintain the order.