[clang] [CUDA] Emit used function list in deterministic order. (PR #102661)

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 14:40:00 PDT 2024


================
@@ -950,6 +950,9 @@ void CodeGenModule::Release() {
       UsedArray.push_back(llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
           GetAddrOfGlobal(GD), Int8PtrTy));
     }
+    // Sort decls by name to always emit them in deterministic order.
----------------
rnk wrote:

nit: it looks like the map is `CUDAExternalDeviceDeclODRUsedByHost`. Can that be turned into a `MapVector` instead, which makes any other loops over the map deterministic? More, correct by construction, rather than having to do an extra sort.

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


More information about the cfe-commits mailing list