[llvm] 64720f5 - [IRSim] Don't copy the Mapper for createCandidatesFromSuffixTree

Andrew Litteken via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 14:52:20 PDT 2021


Author: Andrew Litteken
Date: 2021-06-11T16:36:23-05:00
New Revision: 64720f57bea6a6bf033feef4a5751ab9c0c3b401

URL: https://github.com/llvm/llvm-project/commit/64720f57bea6a6bf033feef4a5751ab9c0c3b401
DIFF: https://github.com/llvm/llvm-project/commit/64720f57bea6a6bf033feef4a5751ab9c0c3b401.diff

LOG: [IRSim] Don't copy the Mapper for createCandidatesFromSuffixTree

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

Author: lanza
Reviewers: AndrewLitteken, plofti, paquette,

Differential Review: https://reviews.llvm.org/D92532

Added: 
    

Modified: 
    llvm/lib/Analysis/IRSimilarityIdentifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
index d59383958aab2..dd0f62521aa96 100644
--- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
+++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
@@ -702,7 +702,7 @@ void IRSimilarityIdentifier::populateMapper(
 /// \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) {
 


        


More information about the llvm-commits mailing list