diff options
author | David Greene <greened@obbligato.org> | 2007-09-06 16:18:45 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2007-09-06 16:18:45 +0000 |
commit | 2c17c4d8d9f232f0329786ad9abee976bc0f3d27 (patch) | |
tree | 09b4e8895982a1f9e39334d682daf97eb3b177cb /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | 455e176ffb02ec4ad20f03a97534af3df32dfaed (diff) |
Pluggable coalescers inplementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 6929b91645..2859c24743 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/RegAllocRegistry.h" +#include "llvm/CodeGen/RegisterCoalescer.h" #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetMachine.h" @@ -96,7 +97,9 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LiveIntervals>(); - AU.addRequiredID(SimpleRegisterCoalescingID); + // Make sure PassManager knows which analyses to make available + // to coalescing and which analyses coalescing invalidates. + AU.addRequiredTransitive<RegisterCoalescer>(); MachineFunctionPass::getAnalysisUsage(AU); } @@ -194,6 +197,11 @@ bool RALinScan::runOnMachineFunction(MachineFunction &fn) { mri_ = tm_->getRegisterInfo(); li_ = &getAnalysis<LiveIntervals>(); + // We don't run the coalescer here because we have no reason to + // interact with it. If the coalescer requires interaction, it + // won't do anything. If it doesn't require interaction, we assume + // it was run as a separate pass. + // If this is the first function compiled, compute the related reg classes. if (RelatedRegClasses.empty()) ComputeRelatedRegClasses(); |