mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
avr: support ThinLTO
ThinLTO results in a small code size reduction, which is nice (especially on these very small chips). It also brings us one step closer to using ThinLTO everywhere.
This commit is contained in:
committed by
Ron Evans
parent
5c622cfc43
commit
4d14d3cd54
@@ -53,7 +53,7 @@ func CreateStackSizeLoads(mod llvm.Module, config *compileopts.Config) []string
|
||||
stackSizesGlobal.SetInitializer(llvm.ConstArray(functions[0].Type(), defaultStackSizes))
|
||||
|
||||
// Add all relevant values to llvm.used (for LTO).
|
||||
llvmutil.AppendToUsedGlobals(mod, append([]llvm.Value{stackSizesGlobal}, functionValues...)...)
|
||||
llvmutil.AppendToGlobal(mod, "llvm.used", append([]llvm.Value{stackSizesGlobal}, functionValues...)...)
|
||||
|
||||
// Replace the calls with loads from the new global with stack sizes.
|
||||
irbuilder := ctx.NewBuilder()
|
||||
|
||||
Reference in New Issue
Block a user