[PATCH] D145472: [LV] Resolve test failure due use of unordered container

Sushant Gokhale via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 22:30:14 PST 2023


sushgokh created this revision.
sushgokh added reviewers: fhahn, SjoerdMeijer, madhur13490, sdesmalen.
Herald added subscribers: StephenFan, hiraditya, kristof.beyls.
Herald added a project: All.
sushgokh requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

D143422 <https://reviews.llvm.org/D143422> test 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145472

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


Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6072,7 +6072,7 @@
   // 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()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145472.502928.patch
Type: text/x-patch
Size: 656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230307/3d1b238f/attachment.bin>


More information about the llvm-commits mailing list