[llvm] a6000c1 - llvm-reduce: Account for aliases and ifuncs in IR complexity score

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 17:35:35 PST 2023


Author: Matt Arsenault
Date: 2023-01-19T21:35:27-04:00
New Revision: a6000c143b6d088c3d1cf3a11719319a8655f1ab

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

LOG: llvm-reduce: Account for aliases and ifuncs in IR complexity score

Added: 
    

Modified: 
    llvm/tools/llvm-reduce/ReducerWorkItem.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
index a608f6f3b09f..635bd7e67d47 100644
--- a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
+++ b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
@@ -715,6 +715,12 @@ uint64_t ReducerWorkItem::computeIRComplexityScore() const {
     GlobalMetadata.clear();
   }
 
+  for (const GlobalAlias &GA : M.aliases())
+    Score += classifyReductivePower(GA.getAliasee());
+
+  for (const GlobalIFunc &GI : M.ifuncs())
+    Score += classifyReductivePower(GI.getResolver());
+
   for (const Function &F : M)
     Score += computeIRComplexityScoreImpl(F);
 


        


More information about the llvm-commits mailing list