diff options
author | Andrew Trick <atrick@apple.com> | 2012-02-15 03:21:51 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-02-15 03:21:51 +0000 |
commit | e9a951c00b2d395d36ae15526e30e3c066256bbe (patch) | |
tree | bcdf9cdfdc55289cbeed5647ad2a31323d260678 /llvm/lib/CodeGen/MachineLICM.cpp | |
parent | c9ce9d23151bd12fdabf04aece025b55c3e6c614 (diff) | |
download | bcm5719-llvm-e9a951c00b2d395d36ae15526e30e3c066256bbe.tar.gz bcm5719-llvm-e9a951c00b2d395d36ae15526e30e3c066256bbe.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
0 files changed, 0 insertions, 0 deletions