aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/MergeFunctions.cpp
diff options
context:
space:
mode:
authorOskar Wirga <10386631+oskarwirga@users.noreply.github.com>2023-10-11 17:32:41 -0700
committerGitHub <noreply@github.com>2023-10-11 17:32:41 -0700
commitb48450c2094fa48d3d968536876fa684eb21f330 (patch)
tree87404e795d2b11e4235d9fc10fc90c018f70fb8e /llvm/lib/Transforms/IPO/MergeFunctions.cpp
parentb6043f98673e33f17564dd240be3878c61e22333 (diff)
downloadllvm-b48450c2094fa48d3d968536876fa684eb21f330.zip
llvm-b48450c2094fa48d3d968536876fa684eb21f330.tar.gz
llvm-b48450c2094fa48d3d968536876fa684eb21f330.tar.bz2
[MergeFuncs] Use sizeWithoutDebug to decide if we create a thunk (#68627)
I noticed that when we determine the size of the function to figure out if its profitable, we include debug instructions which can end up making larger functions than necessary.
Diffstat (limited to 'llvm/lib/Transforms/IPO/MergeFunctions.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 89ddd7b..c19cf71 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -653,7 +653,7 @@ static bool canCreateThunkFor(Function *F) {
// Don't merge tiny functions using a thunk, since it can just end up
// making the function larger.
if (F->size() == 1) {
- if (F->front().size() <= 2) {
+ if (F->front().sizeWithoutDebug() < 2) {
LLVM_DEBUG(dbgs() << "canCreateThunkFor: " << F->getName()
<< " is too small to bother creating a thunk for\n");
return false;