summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/Passes.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-02-11 07:11:32 +0000
committerAndrew Trick <atrick@apple.com>2012-02-11 07:11:32 +0000
commit746f24b732830f434032de5d2d321e6ad1f8e782 (patch)
tree0b69d42f044b61b42e9620eccad535993f4a0485 /include/llvm/CodeGen/Passes.h
parentfda655ec23f33ad8f9d5ca75608ddf441c76be9a (diff)
downloadllvm-746f24b732830f434032de5d2d321e6ad1f8e782.tar.gz
llvm-746f24b732830f434032de5d2d321e6ad1f8e782.tar.bz2
llvm-746f24b732830f434032de5d2d321e6ad1f8e782.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/Passes.h')
-rw-r--r--include/llvm/CodeGen/Passes.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index dca1e9c2e2..2c49bb1a3d 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/include/llvm/CodeGen/Passes.h
@@ -31,6 +31,8 @@ namespace llvm {
namespace llvm {
+extern char &NoPassID; // Allow targets to choose not to run a pass.
+
/// Target-Independent Code Generator Pass Configuration Options.
///
/// This is an ImmutablePass solely for the purpose of exposing CodeGen options
@@ -136,10 +138,26 @@ protected:
/// LLVMTargetMachine provides standard regalloc passes for most targets.
virtual void addOptimizedRegAlloc(FunctionPass *RegAllocPass);
- /// addPostRegAlloc - This method may be implemented by targets that want
- /// to run passes after register allocation but before prolog-epilog
- /// insertion. This should return true if -print-machineinstrs should print
- /// after these passes.
+ /// getSchedPass - This method may be implemented by target that want to
+ /// completely override the MachineScheduler pass with a new pass, rather than
+ /// inheriting from ScheduleDAGInstrs.
+ virtual char &getSchedPass() { return NoPassID; }
+
+ /// addFinalizeRegAlloc - This method may be implemented by targets that want
+ /// to run passes within the regalloc pipeline, immediately after the register
+ /// allocation pass itself. These passes run as soon as virtual regisiters
+ /// have been rewritten to physical registers but before and other postRA
+ /// optimization happens. Targets that have marked instructions for bundling
+ /// must have finalized those bundles by the time these passes have run,
+ /// because subsequent passes are not guaranteed to be bundle-aware.
+ virtual bool addFinalizeRegAlloc() {
+ return false;
+ }
+
+ /// addPostRegAlloc - This method may be implemented by targets that want to
+ /// run passes after register allocation pass pipeline but before
+ /// prolog-epilog insertion. This should return true if -print-machineinstrs
+ /// should print after these passes.
virtual bool addPostRegAlloc() {
return false;
}