summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/Passes.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-08 23:44:45 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-08 23:44:45 +0000
commit1224312f5bd4cbbba11588baef5631037d117379 (patch)
tree6948c39110ade35c6d2b6025860a5fe0059699b4 /llvm/lib/CodeGen/Passes.cpp
parent702b732d6fd2ebab301d5abeedc130b8a3aef9bb (diff)
downloadbcm5719-llvm-1224312f5bd4cbbba11588baef5631037d117379.tar.gz
bcm5719-llvm-1224312f5bd4cbbba11588baef5631037d117379.zip
Reintroduce VirtRegRewriter.
OK, not really. We don't want to reintroduce the old rewriter hacks. This patch extracts virtual register rewriting as a separate pass that runs after the register allocator. This is possible now that CodeGen/Passes.cpp can configure the full optimizing register allocator pipeline. The rewriter pass uses register assignments in VirtRegMap to rewrite virtual registers to physical registers, and it inserts kill flags based on live intervals. These finalization steps are the same for the optimizing register allocators: RABasic, RAGreedy, and PBQP. llvm-svn: 158244
Diffstat (limited to 'llvm/lib/CodeGen/Passes.cpp')
-rw-r--r--llvm/lib/CodeGen/Passes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp
index feac061ffd7..8ee97e6c1b5 100644
--- a/llvm/lib/CodeGen/Passes.cpp
+++ b/llvm/lib/CodeGen/Passes.cpp
@@ -609,6 +609,10 @@ void TargetPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) {
PM->add(RegAllocPass);
printAndVerify("After Register Allocation");
+ // Finally rewrite virtual registers.
+ addPass(VirtRegRewriterID);
+ printAndVerify("After Virtual Register Rewriter");
+
// FinalizeRegAlloc is convenient until MachineInstrBundles is more mature,
// but eventually, all users of it should probably be moved to addPostRA and
// it can go away. Currently, it's the intended place for targets to run
OpenPOWER on IntegriCloud