From a6000c143b6d088c3d1cf3a11719319a8655f1ab Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 16 Jan 2023 19:41:49 -0500 Subject: [PATCH] llvm-reduce: Account for aliases and ifuncs in IR complexity score --- llvm/tools/llvm-reduce/ReducerWorkItem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp index a608f6f..635bd7e 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); -- 2.7.4