1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

50 Commits

Author SHA1 Message Date
Andrew Trick
57f0f255cf Allow CodeGen (llc) command line options to work as expected.
The llc command line options for enabling/disabling passes are local to CodeGen/Passes.cpp. This patch associates those options with standard pass IDs so they work regardless of how the target configures the passes.

A target has two ways of overriding standard passes:
1) Redefine the pass pipeline (override TargetPassConfig::add%Stage)
2) Replace or suppress individiual passes with TargetPassConfig::substitutePass.

In both cases, the command line options associated with the pass override the target default.

For example, say a target wants to disable machine instruction scheduling by default:

- The target calls disablePass(MachineSchedulerID) but otherwise does not override any TargetPassConfig methods.

- Without any llc options, no scheduler is run.

- With -enable-misched, the standard machine scheduler is run and honors the -misched=... flag to select the scheduler variant, which may be used for performance evaluation or testing.

Sorry overridePass is ugly. I haven't thought of a better way without replacing the cl::opt framework. I hope to do that one day...

I haven't figured out why CodeGen uses char& for pass IDs. AnalysisID is much easier to use and less bug prone. I'm using it wherever I can for internal implementation. Maybe later we can change the global pass ID definitions as well.

llvm-svn: 150563
2012-02-15 03:21:51 +00:00
Andrew Trick
3a4ed52447 Added TargetPassConfig::disablePass/substitutePass as a general mechanism to override specific passes.
llvm-svn: 150562
2012-02-15 03:21:47 +00:00
Andrew Trick
f8d8f89c1c Add TargetPassConfig hooks for scheduling/bundling.
In case the MachineScheduling pass I'm working on doesn't work well
for another target, they can completely override it. This also adds a
hook immediately after the RegAlloc pass to cleanup immediately after
vregs go away. We may want to fold it into the postRA hook later.

llvm-svn: 150298
2012-02-11 07:11:32 +00:00
Andrew Trick
1893eb6083 comment grammar
llvm-svn: 150233
2012-02-10 07:08:25 +00:00
Andrew Trick
c3cc8fa604 RegAlloc superpass: includes phi elimination, coalescing, and scheduling.
Creates a configurable regalloc pipeline.

Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.

When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.

CodeGen transformation passes are never "required" as an analysis

ProcessImplicitDefs does not require LiveVariables.

We have a plan to massively simplify some of the early passes within the regalloc superpass.

llvm-svn: 150226
2012-02-10 04:10:36 +00:00
Andrew Trick
74c2f12214 Improve TargetPassConfig. No intended functionality.
Split CodeGen into stages.
Distinguish between optimization and correctness.

llvm-svn: 150122
2012-02-09 00:40:55 +00:00
Andrew Trick
b9d2e9e81d Codegen pass definition cleanup. No functionality.
Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

llvm-svn: 150100
2012-02-08 21:23:13 +00:00
Andrew Trick
8f7cc1b245 Move pass configuration out of pass constructors: MachineLICM.
llvm-svn: 150099
2012-02-08 21:23:03 +00:00
Andrew Trick
c210c552ee Move pass configuration out of pass constructors: StackSlotColoring.
llvm-svn: 150097
2012-02-08 21:22:57 +00:00
Andrew Trick
a6dea8798a Move pass configuration out of pass constructors: PostRAScheduler.
llvm-svn: 150096
2012-02-08 21:22:53 +00:00
Andrew Trick
9da1cc8ddd Move pass configuration out of pass constructors: BranchFolderPass
llvm-svn: 150095
2012-02-08 21:22:48 +00:00
Andrew Trick
fb24596a02 Added TargetPassConfig::setOpt
llvm-svn: 150093
2012-02-08 21:22:39 +00:00
Andrew Trick
135effe79b Added Pass::createPass(ID) to handle pass configuration by ID
llvm-svn: 150092
2012-02-08 21:22:34 +00:00
Andrew Trick
e696d2f01f Move pass configuration out of pass constructors: TailDuplicate::PreRegAlloc
llvm-svn: 150091
2012-02-08 21:22:30 +00:00
Andrew Trick
fb574d1c19 TargetPassConfig: confine the MC configuration to TargetMachine.
Passes prior to instructon selection are now split into separate configurable stages.
Header dependencies are simplified.
The bulk of this diff is simply removal of the silly DisableVerify flags.

Sorry for the target header churn. Attempting to stabilize them.

llvm-svn: 149754
2012-02-04 02:56:59 +00:00
Andrew Trick
4af2e787de Move TargetPassConfig implementation into Passes.cpp
llvm-svn: 149753
2012-02-04 02:56:48 +00:00
Andrew Trick
7bc6010af2 Make TargetPassConfig an ImmutablePass so CodeGenPasses can query options
llvm-svn: 149752
2012-02-04 02:56:45 +00:00
Jakob Stoklund Olesen
78902f9088 Delete the linear scan register allocator.
RegAllocGreedy has been the default for six months now.

Deleting RegAllocLinearScan makes it possible to also delete
VirtRegRewriter and clean up the spiller code.

llvm-svn: 144475
2011-11-12 22:39:45 +00:00
Jakob Stoklund Olesen
720ec44d13 Update comment.
llvm-svn: 130582
2011-04-30 03:13:08 +00:00
Jakob Stoklund Olesen
a397ddfd59 Use a greedy algorithm for allocating registers.
llvm-svn: 130568
2011-04-30 01:37:54 +00:00
Jakob Stoklund Olesen
dceb96c62d Force the greedy register allocator to be linked alongside linear scan.
This means that the new register allocator can be used with 'clang -mllvm -regalloc=greedy'.

llvm-svn: 129764
2011-04-19 17:17:58 +00:00
Jakob Stoklund Olesen
11ebdd61d0 Use the fast register allocator by default for -O0 builds.
This affects both llvm-gcc and clang.

llvm-svn: 105372
2010-06-03 00:39:06 +00:00
Jakob Stoklund Olesen
d76041cf58 Add a -regalloc=default option that chooses a register allocator based on the -O
optimization level.

This only really affects llc for now because both the llvm-gcc and clang front
ends override the default register allocator. I intend to remove that code later.

llvm-svn: 104904
2010-05-27 23:57:25 +00:00
Duncan Sands
b7bb8ab12e Uniformize the way these options are printed. Requested by
Russell Wallace.

llvm-svn: 96580
2010-02-18 14:37:52 +00:00
Dan Gohman
bab18cae46 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Dan Gohman
d4a670284c Make several variable declarations static.
llvm-svn: 50696
2008-05-06 01:53:16 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Bill Wendling
49d6a1169f *** empty log message ***
llvm-svn: 31789
2006-11-16 20:11:33 +00:00
Chris Lattner
992020cd59 Work around a bug in gcc 3.3.5, reported by a user
llvm-svn: 29489
2006-08-03 00:16:56 +00:00
Jim Laskey
6d121090d3 Final polish on machine pass registries.
llvm-svn: 29471
2006-08-02 12:30:23 +00:00
Jim Laskey
f5e160063e 1. Change use of "Cache" to "Default".
2. Added argument to instruction scheduler creators so the creators can do
special things.
3. Repaired target hazard code.
4. Misc.

More to follow.

llvm-svn: 29450
2006-08-01 18:29:48 +00:00
Jim Laskey
b92b14f422 Introducing plugable register allocators and instruction schedulers.
llvm-svn: 29434
2006-08-01 14:21:23 +00:00
Jim Laskey
f77eeceeba Working toward registration of register allocators.
llvm-svn: 29360
2006-07-27 20:05:00 +00:00
Andrew Lenharth
c1074954fb Reduce number of exported symbols
llvm-svn: 29220
2006-07-20 17:28:38 +00:00
Chris Lattner
e3bfc9618d Alkis agrees that that iterative scan allocator isn't going to be worked on
in the future, remove it.

llvm-svn: 23952
2005-10-24 04:14:30 +00:00
Misha Brukman
774e55c446 Remove trailing whitespace
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
0fbe7e1e60 The default has not been 'simple' for AGES!
llvm-svn: 15114
2004-07-22 21:46:02 +00:00
Chris Lattner
767638fe6d Make linear scan the default
llvm-svn: 15111
2004-07-22 18:42:00 +00:00
Alkis Evlogimenos
4b4712b58d Put variable name to a separate line.
llvm-svn: 15108
2004-07-22 15:30:33 +00:00
Alkis Evlogimenos
717d6cd988 Fit to 80 columns.
llvm-svn: 15105
2004-07-22 14:29:31 +00:00
Alkis Evlogimenos
b5f60641f4 Add Iterative scan register allocator.
llvm-svn: 15068
2004-07-21 08:24:35 +00:00
Alkis Evlogimenos
75dbcf6d06 Linearscan is no longer experimental.
llvm-svn: 15067
2004-07-21 08:18:50 +00:00
Chris Lattner
c014005d53 Fix IA64 compatibility
llvm-svn: 14866
2004-07-16 00:06:01 +00:00
Alkis Evlogimenos
c4ad8080f7 Add a spiller option to llc. A simple spiller will come soon. When we get CFG in the machine code represenation a global spiller will also be possible. Also document the linear scan register allocator but mark it as experimental for now.
llvm-svn: 12062
2004-03-01 23:18:15 +00:00
Chris Lattner
a8c942c188 finegrainify namespacification
minor cleanups

llvm-svn: 10619
2003-12-28 07:59:53 +00:00
Alkis Evlogimenos
6627a32ff9 Merging the linear scan register allocator in trunk. It currently passes most tests under test/Programs/SingleSource/Benchmarks/Shootout so development will continue on trunk. The allocator is not enabled by default. You will need to pass -regallo=linearscan to lli or llc to use it.
llvm-svn: 10103
2003-11-20 03:32:25 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Alkis Evlogimenos
a37b58ce09 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
llvm-svn: 8819
2003-10-02 16:57:49 +00:00