diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-18 22:03:18 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-18 22:03:18 +0000 |
commit | ba05c01dabc40373760a20c874103fc58d4377f0 (patch) | |
tree | 487731548cc0b61e10b46c9f2c2120148658f9fc /lib/CodeGen/VirtRegMap.h | |
parent | d8c87888a71c4433d76b48bca6c3e03a17890648 (diff) | |
download | external_llvm-ba05c01dabc40373760a20c874103fc58d4377f0.zip external_llvm-ba05c01dabc40373760a20c874103fc58d4377f0.tar.gz external_llvm-ba05c01dabc40373760a20c874103fc58d4377f0.tar.bz2 |
Add VirtRegMap::rewrite() and use it in the new register allocators.
The rewriter works almost identically to -rewriter=trivial, except it also
eliminates any identity copies.
This makes the new register allocators independent of VirtRegRewriter.cpp which
will be going away at the same time as RegAllocLinearScan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index cbc96bb..a43ac5f 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -35,6 +35,7 @@ namespace llvm { class TargetInstrInfo; class TargetRegisterInfo; class raw_ostream; + class SlotIndexes; class VirtRegMap : public MachineFunctionPass { public: @@ -493,6 +494,13 @@ namespace llvm { return 0; } + /// rewrite - Rewrite all instructions in MF to use only physical registers + /// by mapping all virtual register operands to their assigned physical + /// registers. + /// + /// @param Indexes Optionally remove deleted instructions from indexes. + void rewrite(SlotIndexes *Indexes); + void print(raw_ostream &OS, const Module* M = 0) const; void dump() const; }; |