[llvm] 4f018e5 - [LV][AArch64] Resolve test failure due use of unordered container

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 03:14:49 PST 2023


Author: sgokhale
Date: 2023-03-07T16:42:21+05:30
New Revision: 4f018e54c45e309bc9cb21bc839f01f4c2ea2a8c

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

LOG: [LV][AArch64] Resolve test failure due use of unordered container

AArch64/reg-usage.ll has an issue with the output ordering due to use of unordered container. This was discovered by -DLLVM_REVERSE_ITERATION:BOOL=ON
cmake option.
This patch tries to address it by making use of ordered container.

Differential Revision: https://reviews.llvm.org/D145472/

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 7fadb5d9a34b7..0149ff3ce26bb 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6072,7 +6072,7 @@ LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<ElementCount> VFs) {
   // Saves the list of values that are used in the loop but are defined outside
   // the loop (not including non-instruction values such as arguments and
   // constants).
-  SmallPtrSet<Instruction *, 8> LoopInvariants;
+  SmallSetVector<Instruction *, 8> LoopInvariants;
 
   for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO())) {
     for (Instruction &I : BB->instructionsWithoutDebug()) {


        


More information about the llvm-commits mailing list