Page MenuHomePhabricator

Teach TargetMachines about -Oz and -Os

Authored by paquette on Apr 20 2018, 6:31 PM.



This is the first in a series of patches to turn the MachineOutliner on by default under -Oz for AArch64.

Currently, TargetMachines only know about -O0...-O3. They don't know anything about -Oz or -Os, and size optimization is managed solely by function attributes.

The outliner should be added only at -Oz under only AArch64 by default. With the way things currently work, that would mean the outliner, by default, would have to walk over every function in the module all of the time, and see if any minsize functions exist. This would incur a completely unnecessary compile-time overhead. Thus, this patch teaches Target Machines about size optimization levels.

Diff Detail

Event Timeline

paquette created this revision.Apr 20 2018, 6:31 PM
paquette edited the summary of this revision. (Show Details)Apr 20 2018, 6:32 PM
paquette edited the summary of this revision. (Show Details)Apr 20 2018, 6:59 PM
paquette added a subscriber: llvm-commits.
sabuasal removed a subscriber: sabuasal.Apr 21 2018, 9:30 PM
nhaehnle removed a subscriber: nhaehnle.Apr 23 2018, 4:07 AM
paquette updated this revision to Diff 143581.Apr 23 2018, 9:46 AM

Updated diff to use -U999999 for context

paquette abandoned this revision.Apr 26 2018, 10:47 AM

We decided it'd be better to just use function attributes for the outliner, so I'm abandoning this.