diff options
author | Oskar Wirga <10386631+oskarwirga@users.noreply.github.com> | 2023-10-11 17:32:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 17:32:41 -0700 |
commit | b48450c2094fa48d3d968536876fa684eb21f330 (patch) | |
tree | 87404e795d2b11e4235d9fc10fc90c018f70fb8e /llvm/lib/Transforms/IPO/MergeFunctions.cpp | |
parent | b6043f98673e33f17564dd240be3878c61e22333 (diff) | |
download | llvm-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.cpp | 2 |
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; |