Commit Graph

8 Commits

Author SHA1 Message Date
Jessica Paquette 33648c335e [MachineOutliner] Properly pass -moutline along to the toolchain
This moves the LTO-specific code for outlining from ToolChains/Clang.cpp to
ToolChains/Darwin.cpp. Passing -mllvm flags isn't sufficient for making sure
that the specified pass will actually run in LTO. This makes sure that when
-moutline is passed, the MachineOutliner will actually be added to the LTO
pass pipeline as expected.

llvm-svn: 336471
2018-07-06 22:24:56 +00:00
Jessica Paquette 36a25677ae [MachineOutliner] Make -mno-outline use -enable-machine-outliner=never
This updates -mno-outline so that it passes -enable-machine-outliner=never
instead of nothing. This puts it in sync with the behaviour in llc and
other tools.

llvm-svn: 336001
2018-06-29 18:06:10 +00:00
Jessica Paquette a67abc83b7 [MachineOutliner] Emit a warning when using -moutline on unsupported targets
Instead of just saying "flag unused", we should tell the user that the
outliner isn't (at least officially) supported for some given architecture.

This adds a warning that will state something like

The 'blah' architecture does not support -moutline; flag ignored

when we call -moutline with the 'blah' architecture.

Since the outliner is still mostly an AArch64 thing, any architecture
other than AArch64 will emit this warning.

llvm-svn: 335672
2018-06-26 22:09:48 +00:00
Jessica Paquette 2c26d776e6 [MachineOutliner] Outline from linkonceodrs by default in LTO when -moutline is passed
Pass -enable-linkonceodr-outlining by default when LTO is enabled.

The outliner shouldn't compete with any sort of linker deduplication
on linkonceodr functions when LTO is enabled. Therefore, this behaviour
should be the default.

llvm-svn: 335504
2018-06-25 17:36:05 +00:00
Jessica Paquette 165e1101ff [MachineOutliner] Make last of -moutline/-mno-outline win
The expected behaviour of command-line flags to clang is to have
the last of -m(whatever) and -mno-(whatever) win. The outliner
didn't do that. This fixes that and updates the test.

llvm-svn: 335503
2018-06-25 17:27:51 +00:00
Jessica Paquette 544bb55a3e Add a mno-outline flag to disable the MachineOutliner
Since we're working on turning the MachineOutliner by default under -Oz for
AArch64, it makes sense to have an -mno-outline flag available. This currently
doesn't do much (it basically just undoes -moutline).

When the MachineOutliner is on by default under AArch64, this flag should
set -mllvm -enable-machine-outliner=never.

llvm-svn: 331810
2018-05-08 20:58:32 +00:00
Jessica Paquette 635af6223b Change -foutline to -moutline
Nitpicky, but the MachineOutliner is a machine-level pass, and so we should
reflect that by using "m" instead of "n".

Figured we should get this in before people get used to the letter f. :)

llvm-svn: 331806
2018-05-08 20:53:19 +00:00
Jessica Paquette 8e71ee3c07 Add -foutline option to enable the MachineOutliner in AArch64
Since we've been working on productizing the MachineOutliner in AArch64, it
makes sense to provide a more user-friendly way to enable it.

This allows users of AArch64 to enable the outliner using -foutline instead
of -mllvm -enable-machine-outliner. Other, less mature implementations (e.g,
x86-64) can still enable the pass using the -mllvm option.

Also add a test to make sure it works.

llvm-svn: 331370
2018-05-02 16:42:51 +00:00