2013-12-10 19:13:32 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
2019-05-24 07:02:56 +08:00
|
|
|
AllTargetsAsmParsers
|
|
|
|
AllTargetsCodeGens
|
2019-05-24 10:15:27 +08:00
|
|
|
AllTargetsDescs
|
2019-05-24 07:02:56 +08:00
|
|
|
AllTargetsInfos
|
2018-01-25 20:06:32 +08:00
|
|
|
AggressiveInstCombine
|
2013-12-10 19:13:32 +08:00
|
|
|
Analysis
|
|
|
|
BitWriter
|
2014-02-22 08:07:45 +08:00
|
|
|
CodeGen
|
2013-12-10 19:13:32 +08:00
|
|
|
Core
|
2016-07-29 05:04:31 +08:00
|
|
|
Coroutines
|
2013-12-10 19:13:32 +08:00
|
|
|
IPO
|
|
|
|
IRReader
|
|
|
|
InstCombine
|
|
|
|
Instrumentation
|
|
|
|
MC
|
|
|
|
ObjCARCOpts
|
2019-05-31 09:04:00 +08:00
|
|
|
Remarks
|
2013-12-10 19:13:32 +08:00
|
|
|
ScalarOpts
|
|
|
|
Support
|
|
|
|
Target
|
|
|
|
TransformUtils
|
|
|
|
Vectorize
|
2015-03-07 17:02:36 +08:00
|
|
|
Passes
|
2013-12-10 19:13:32 +08:00
|
|
|
)
|
2010-09-14 07:59:48 +08:00
|
|
|
|
2013-12-30 11:36:05 +08:00
|
|
|
# Support plugins.
|
|
|
|
set(LLVM_NO_DEAD_STRIP 1)
|
|
|
|
|
2008-09-22 09:08:49 +08:00
|
|
|
add_llvm_tool(opt
|
|
|
|
AnalysisWrappers.cpp
|
2014-02-13 00:48:02 +08:00
|
|
|
BreakpointPrinter.cpp
|
2017-12-09 05:57:28 +08:00
|
|
|
Debugify.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
GraphPrinters.cpp
|
[PM] Add (very skeletal) support to opt for running the new pass
manager. I cannot emphasize enough that this is a WIP. =] I expect it
to change a great deal as things stabilize, but I think its really
important to get *some* functionality here so that the infrastructure
can be tested more traditionally from the commandline.
The current design is looking something like this:
./bin/opt -passes='module(pass_a,pass_b,function(pass_c,pass_d))'
So rather than custom-parsed flags, there is a single flag with a string
argument that is parsed into the pass pipeline structure. This makes it
really easy to have nice structural properties that are very explicit.
There is one obvious and important shortcut. You can start off the
pipeline with a pass, and the minimal context of pass managers will be
built around the entire specified pipeline. This makes the common case
for tests super easy:
./bin/opt -passes=instcombine,sroa,gvn
But this won't introduce any of the complexity of the fully inferred old
system -- we only ever do this for the *entire* argument, and we only
look at the first pass. If the other passes don't fit in the pass
manager selected it is a hard error.
The other interesting aspect here is that I'm not relying on any
registration facilities. Such facilities may be unavoidable for
supporting plugins, but I have alternative ideas for plugins that I'd
like to try first. My plan is essentially to build everything without
registration until we hit an absolute requirement.
Instead of registration of pass names, there will be a library dedicated
to parsing pass names and the pass pipeline strings described above.
Currently, this is directly embedded into opt for simplicity as it is
very early, but I plan to eventually pull this into a library that opt,
bugpoint, and even Clang can depend on. It should end up as a good home
for things like the existing PassManagerBuilder as well.
There are a bunch of FIXMEs in the code for the parts of this that are
just stubbed out to make the patch more incremental. A quick list of
what's coming up directly after this:
- Support for function passes and building the structured nesting.
- Support for printing the pass structure, and FileCheck tests of all of
this code.
- The .def-file based pass name parsing.
- IR priting passes and the corresponding tests.
Some obvious things that I'm not going to do right now, but am
definitely planning on as the pass manager work gets a bit further:
- Pull the parsing into library, including the builders.
- Thread the rest of the target stuff into the new pass manager.
- Wire support for the new pass manager up to llc.
- Plugin support.
Some things that I'd like to have, but are significantly lower on my
priority list. I'll get to these eventually, but they may also be places
where others want to contribute:
- Adding nice error reporting for broken pass pipeline descriptions.
- Typo-correction for pass names.
llvm-svn: 198998
2014-01-11 16:16:35 +08:00
|
|
|
NewPMDriver.cpp
|
2014-02-11 07:34:23 +08:00
|
|
|
PassPrinters.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
PrintSCC.cpp
|
|
|
|
opt.cpp
|
2016-11-19 11:18:50 +08:00
|
|
|
|
|
|
|
DEPENDS
|
|
|
|
intrinsics_gen
|
2008-09-22 09:08:49 +08:00
|
|
|
)
|
2015-03-19 04:09:13 +08:00
|
|
|
export_executable_symbols(opt)
|
2014-03-14 12:04:14 +08:00
|
|
|
|
|
|
|
if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS)
|
[CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.
Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.
Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).
Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.
Differential Revision: https://reviews.llvm.org/D40823
llvm-svn: 319840
2017-12-06 05:49:56 +08:00
|
|
|
target_link_libraries(opt PRIVATE Polly)
|
2014-03-14 12:04:14 +08:00
|
|
|
endif(WITH_POLLY AND LINK_POLLY_INTO_TOOLS)
|