[llvm] [CGData] Global Merge Functions (PR #112671)
Kyungwoo Lee via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 17 13:04:10 PST 2024
================
@@ -117,7 +149,38 @@ static void removeIdenticalIndexPair(
SF->IndexOperandHashMap->erase(Pair);
}
-void StableFunctionMap::finalize() {
+static bool isProfitable(
+ const SmallVector<std::unique_ptr<StableFunctionMap::StableFunctionEntry>>
+ &SFS) {
+ unsigned StableFunctionCount = SFS.size();
+ if (StableFunctionCount < GlobalMergingMinMerges)
+ return false;
+
+ unsigned InstCount = SFS[0]->InstCount;
----------------
kyulee-com wrote:
I added `-global-merging-inst-overhead` to tune this parameter.
https://github.com/llvm/llvm-project/pull/112671
More information about the llvm-commits
mailing list