diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-03-01 20:05:10 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-03-01 20:05:10 +0000 |
commit | 5f37502bfbadfa65de087627bd67fd58bb03725c (patch) | |
tree | 392001560e863f4185de7675bacd447bf49d133c /lib/CodeGen/VirtRegMap.h | |
parent | 9d0802e7dd165dd9b7372f12799f248e7f133287 (diff) | |
download | external_llvm-5f37502bfbadfa65de087627bd67fd58bb03725c.zip external_llvm-5f37502bfbadfa65de087627bd67fd58bb03725c.tar.gz external_llvm-5f37502bfbadfa65de087627bd67fd58bb03725c.tar.bz2 |
Add the long awaited memory operand folding support for linear scan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index b0af8c5..90cc44d 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -22,18 +22,23 @@ #include "llvm/CodeGen/SSARegMap.h" #include "Support/DenseMap.h" #include <climits> +#include <map> namespace llvm { + class MachineInstr; + class VirtRegMap { public: typedef DenseMap<unsigned, VirtReg2IndexFunctor> Virt2PhysMap; typedef DenseMap<int, VirtReg2IndexFunctor> Virt2StackSlotMap; + typedef std::multimap<MachineInstr*, unsigned> MI2VirtMap; private: MachineFunction* mf_; Virt2PhysMap v2pMap_; Virt2StackSlotMap v2ssMap_; + MI2VirtMap mi2vMap_; // do not implement VirtRegMap(const VirtRegMap& rhs); @@ -89,6 +94,15 @@ namespace llvm { int assignVirt2StackSlot(unsigned virtReg); + void virtFolded(unsigned virtReg, + MachineInstr* oldMI, + MachineInstr* newMI); + + std::pair<MI2VirtMap::const_iterator, MI2VirtMap::const_iterator> + getFoldedVirts(MachineInstr* MI) const { + return mi2vMap_.equal_range(MI); + } + friend std::ostream& operator<<(std::ostream& os, const VirtRegMap& li); }; |