[PATCH] D92532: [IRSimilarity] Don't copy the Mapper for createCandidatesFromSuffixTree

Nathan Lanza via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 18:16:51 PST 2020


lanza created this revision.
lanza added reviewers: plotfi, paquette, AndrewLitteken.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
lanza requested review of this revision.

Every invocation this was copying the Mapper for no reason. Take a const
ref instead


https://reviews.llvm.org/D92532

Files:
  llvm/lib/Analysis/IRSimilarityIdentifier.cpp


Index: llvm/lib/Analysis/IRSimilarityIdentifier.cpp
===================================================================
--- llvm/lib/Analysis/IRSimilarityIdentifier.cpp
+++ llvm/lib/Analysis/IRSimilarityIdentifier.cpp
@@ -462,7 +462,7 @@
 /// \param [out] CandsForRepSubstring - The vector to store the generated
 /// IRSimilarityCandidates.
 static void createCandidatesFromSuffixTree(
-    IRInstructionMapper Mapper, std::vector<IRInstructionData *> &InstrList,
+    const IRInstructionMapper& Mapper, std::vector<IRInstructionData *> &InstrList,
     std::vector<unsigned> &IntegerMapping, SuffixTree::RepeatedSubstring &RS,
     std::vector<IRSimilarityCandidate> &CandsForRepSubstring) {
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92532.309119.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/99122de1/attachment.bin>


More information about the llvm-commits mailing list