[LV][AArch64] Resolve test failure due use of unordered container
authorsgokhale <sgokhale@nvidia.com>
Tue, 7 Mar 2023 11:12:21 +0000 (16:42 +0530)
committersgokhale <sgokhale@nvidia.com>
Tue, 7 Mar 2023 11:12:21 +0000 (16:42 +0530)
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/

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index 7fadb5d..0149ff3 100644 (file)
@@ -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()) {