[PATCH] D139465: GISel/Combiner: maintain created instructions in a SetVector

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 14:30:37 PST 2022


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, foad.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This is not a correctness fix because the set is only used for debug
output. However, it helps avoid noise when looking at diffs between
compiler runs.

The set is only maintained with debug output enabled, so the added cost
should be acceptable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139465

Files:
  llvm/lib/CodeGen/GlobalISel/Combiner.cpp


Index: llvm/lib/CodeGen/GlobalISel/Combiner.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -12,6 +12,7 @@
 
 #include "llvm/CodeGen/GlobalISel/Combiner.h"
 #include "llvm/ADT/PostOrderIterator.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/CodeGen/GlobalISel/CSEInfo.h"
 #include "llvm/CodeGen/GlobalISel/CSEMIRBuilder.h"
 #include "llvm/CodeGen/GlobalISel/CombinerInfo.h"
@@ -52,7 +53,7 @@
   WorkListTy &WorkList;
   /// The instructions that have been created but we want to report once they
   /// have their operands. This is only maintained if debug output is requested.
-  SmallPtrSet<const MachineInstr *, 4> CreatedInstrs;
+  SetVector<const MachineInstr *> CreatedInstrs;
 
 public:
   WorkListMaintainer(WorkListTy &WorkList) : WorkList(WorkList) {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139465.480625.patch
Type: text/x-patch
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221206/51b0bb84/attachment.bin>


More information about the llvm-commits mailing list