[PATCH] D92524: [IRSimilarity] Strip out the findSimilarity call from the constructor

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 16:41:46 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf6dea2e7328b: [IRSim] Strip out the findSimilarity call from the constructor (authored by AndrewLitteken).

Changed prior to commit:
  https://reviews.llvm.org/D92524?vs=309100&id=351582#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92524/new/

https://reviews.llvm.org/D92524

Files:
  llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
  llvm/lib/Analysis/IRSimilarityIdentifier.cpp


Index: llvm/lib/Analysis/IRSimilarityIdentifier.cpp
===================================================================
--- llvm/lib/Analysis/IRSimilarityIdentifier.cpp
+++ llvm/lib/Analysis/IRSimilarityIdentifier.cpp
@@ -891,7 +891,7 @@
 }
 
 bool IRSimilarityIdentifierWrapperPass::doInitialization(Module &M) {
-  IRSI.reset(new IRSimilarityIdentifier(M));
+  IRSI.reset(new IRSimilarityIdentifier());
   return false;
 }
 
@@ -901,8 +901,7 @@
 }
 
 bool IRSimilarityIdentifierWrapperPass::runOnModule(Module &M) {
-  // All the real work is done in the constructor for the pass.
-  IRSI.reset(new IRSimilarityIdentifier(M));
+  IRSI->findSimilarity(M);
   return false;
 }
 
@@ -910,7 +909,9 @@
 IRSimilarityIdentifier IRSimilarityAnalysis::run(Module &M,
                                                ModuleAnalysisManager &) {
 
-  return IRSimilarityIdentifier(M);
+  auto IRSI = IRSimilarityIdentifier();
+  IRSI.findSimilarity(M);
+  return IRSI;
 }
 
 PreservedAnalyses
Index: llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
===================================================================
--- llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
+++ llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
@@ -654,12 +654,6 @@
   IRSimilarityIdentifier()
       : Mapper(&InstDataAllocator, &InstDataListAllocator) {}
 
-  /// \param M the module to find similarity in.
-  explicit IRSimilarityIdentifier(Module &M)
-      : Mapper(&InstDataAllocator, &InstDataListAllocator) {
-    findSimilarity(M);
-  }
-
 private:
   /// Map the instructions in the module to unsigned integers, using mapping
   /// already present in the Mapper if possible.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92524.351582.patch
Type: text/x-patch
Size: 1662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/b543b07d/attachment.bin>


More information about the llvm-commits mailing list