AVR: turn on link time optimisation (LTO).

Following the resounding success on ARMs, let's try LTO on AVRs,
too. Advantage isn't all that well, binary size increases by 462
bytes and even an additional byte of RAM is needed.

According to @Wurstnase's research, this size increase is pretty
unique to the config.h.Profiling configuration. All other
configurations he tried actually showed a size drop.

Anyways, we have 15 to 17 clock cycles less on any step, so an
about 7% general stepping performance increase.

  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  18078 bytes      127%       59%       29%       15%
     Data:   2176 bytes      213%      107%       54%       27%
   EEPROM:     32 bytes        4%        2%        2%        1%

  short-moves.gcode statistics:
  LED on occurences: 888.
  LED on time minimum: 202 clock cycles.
  LED on time maximum: 380 clock cycles.
  LED on time average: 232.092 clock cycles.

  smooth-curves.gcode statistics:
  LED on occurences: 23648.
  LED on time minimum: 220 clock cycles.
  LED on time maximum: 423 clock cycles.
  LED on time average: 255.22 clock cycles.

  triangle-odd.gcode statistics:
  LED on occurences: 1636.
  LED on time minimum: 220 clock cycles.
  LED on time maximum: 380 clock cycles.
  LED on time average: 245.575 clock cycles.
This commit is contained in:
Markus Hitter 2016-12-07 15:24:29 +01:00
parent b7bd1ad3d7
commit aa0ef9a3e0
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ CFLAGS += -Os
CFLAGS += -ffunction-sections CFLAGS += -ffunction-sections
CFLAGS += -finline-functions-called-once CFLAGS += -finline-functions-called-once
CFLAGS += -mcall-prologues CFLAGS += -mcall-prologues
CFLAGS += -flto
CFLAGS += -Wa,-adhlns=$(@:.o=.al) CFLAGS += -Wa,-adhlns=$(@:.o=.al)
#CFLAGS += -dM -E # To list all predefined macros into the .o file. #CFLAGS += -dM -E # To list all predefined macros into the .o file.