[llvm] c300a99 - [LV] Use MapVector for InstsToScalarize for deterministic iter order (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 1 06:30:15 PDT 2025


Author: Florian Hahn
Date: 2025-08-01T14:29:53+01:00
New Revision: c300a99ea89568e18ce7207e42501c79d2b48b92

URL: https://github.com/llvm/llvm-project/commit/c300a99ea89568e18ce7207e42501c79d2b48b92
DIFF: https://github.com/llvm/llvm-project/commit/c300a99ea89568e18ce7207e42501c79d2b48b92.diff

LOG: [LV] Use MapVector for InstsToScalarize for deterministic iter order (NFC)

We iterate over InstsToScalarize when printing costs, and currently the
iteration order is not deterministic. Currently no tests check the
output with multiple instructions in InstsToScalarize, but those will
come soon.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 850c4a11edc67..20528089c0008 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1624,7 +1624,7 @@ class LoopVectorizationCostModel {
   /// presence of a cost for an instruction in the mapping indicates that the
   /// instruction will be scalarized when vectorizing with the associated
   /// vectorization factor. The entries are VF-ScalarCostTy pairs.
-  DenseMap<ElementCount, ScalarCostsTy> InstsToScalarize;
+  MapVector<ElementCount, ScalarCostsTy> InstsToScalarize;
 
   /// Holds the instructions known to be uniform after vectorization.
   /// The data is collected per VF.


        


More information about the llvm-commits mailing list