diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-10-12 08:50:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-10-12 08:50:34 +0000 |
commit | 687d1080abc51aac365d4f263ef206162815a86a (patch) | |
tree | 31e4a518a9a2e6d39858b20921f868948a28ec0b /include/llvm/CodeGen/SSARegMap.h | |
parent | ba6246963405f95a9a2b76ff2694136bfdb88a61 (diff) | |
download | external_llvm-687d1080abc51aac365d4f263ef206162815a86a.zip external_llvm-687d1080abc51aac365d4f263ef206162815a86a.tar.gz external_llvm-687d1080abc51aac365d4f263ef206162815a86a.tar.bz2 |
EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
(almost) a register copy. However, it always coalesced to the register of the
RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub-
register uses which adds subtle complications to load folding, spiller rewrite,
etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SSARegMap.h')
-rw-r--r-- | include/llvm/CodeGen/SSARegMap.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SSARegMap.h b/include/llvm/CodeGen/SSARegMap.h index 97d8d69..a92222a 100644 --- a/include/llvm/CodeGen/SSARegMap.h +++ b/include/llvm/CodeGen/SSARegMap.h @@ -26,6 +26,7 @@ class TargetRegisterClass; class SSARegMap { IndexedMap<const TargetRegisterClass*, VirtReg2IndexFunctor> RegClassMap; + IndexedMap<std::pair<unsigned, unsigned>, VirtReg2IndexFunctor> RegSubIdxMap; unsigned NextRegNum; public: @@ -42,12 +43,30 @@ class SSARegMap { assert(RegClass && "Cannot create register without RegClass!"); RegClassMap.grow(NextRegNum); RegClassMap[NextRegNum] = RegClass; + RegSubIdxMap.grow(NextRegNum); + RegSubIdxMap[NextRegNum] = std::make_pair(0,0); return NextRegNum++; } unsigned getLastVirtReg() const { return NextRegNum - 1; } + + void setIsSubRegister(unsigned Reg, unsigned SuperReg, unsigned SubIdx) { + RegSubIdxMap[Reg] = std::make_pair(SuperReg, SubIdx); + } + + bool isSubRegister(unsigned Reg) const { + return RegSubIdxMap[Reg].first != 0; + } + + unsigned getSuperRegister(unsigned Reg) const { + return RegSubIdxMap[Reg].first; + } + + unsigned getSubRegisterIndex(unsigned Reg) const { + return RegSubIdxMap[Reg].second; + } }; } // End llvm namespace |