Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MergeFunctions] Merge small functions if possible without a thunk.
This can result in significant code size savings in some cases, e.g. an interrupt table all filled with the same assembly stub in a certain Cortex-M BSP results in code blowup by a factor of 2.5. Differential Revision: https://reviews.llvm.org/D34806 llvm-svn: 315853
- Loading branch information
1 parent
b2ce9ff
commit ae12efa
Showing
2 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
llvm/test/Transforms/MergeFunc/merge-small-unnamed-addr.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; RUN: opt -S -mergefunc < %s | FileCheck %s | ||
|
||
; CHECK-NOT: @b | ||
|
||
@x = constant { void ()*, void ()* } { void ()* @a, void ()* @b } | ||
; CHECK: { void ()* @a, void ()* @a } | ||
|
||
define internal void @a() unnamed_addr { | ||
ret void | ||
} | ||
|
||
define internal void @b() unnamed_addr { | ||
ret void | ||
} |