[llvm] 031a67f - [llvm][LoopVectorize] Avoid nondeterministic iteration (#214886)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 8 14:03:56 PDT 2026


Author: Paul Kirth
Date: 2026-08-08T14:03:51-07:00
New Revision: 031a67fbeb49eaee80d25a8d5038084f62d67746

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

LOG: [llvm][LoopVectorize] Avoid nondeterministic iteration (#214886)

The Transforms/LoopVectorize/AArch64/cmp_cost.ll test fails under
LLVM_RERERSE_ITERATION, because iterating over a SmallPtrSet is
nondeterministic. Addresses part of #214872.

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 28237c7d037d4..3c65eda187a6e 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1417,7 +1417,7 @@ class LoopVectorizationCostModel {
 
   /// Holds the instructions (address computations) that are forced to be
   /// scalarized.
-  DenseMap<ElementCount, SmallPtrSet<Instruction *, 4>> ForcedScalars;
+  DenseMap<ElementCount, SmallSetVector<Instruction *, 4>> ForcedScalars;
 
   /// Returns the expected 
diff erence in cost from scalarizing the expression
   /// feeding a predicated instruction \p PredInst. The instructions to


        


More information about the llvm-commits mailing list