aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-11-07 08:08:25 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-11-07 08:08:25 +0000
commit29121848b912b1e062760e5d14c6fbec63b16d9b (patch)
tree28d4328b072f35f80146ea30bdb8f0f4573255cc
parent881649809b5e934aa566f8bc984f217b824d632e (diff)
downloadexternal_llvm-29121848b912b1e062760e5d14c6fbec63b16d9b.zip
external_llvm-29121848b912b1e062760e5d14c6fbec63b16d9b.tar.gz
external_llvm-29121848b912b1e062760e5d14c6fbec63b16d9b.tar.bz2
Simplify my (il)logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43819 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 929b1e7..5c46978 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -316,6 +316,7 @@ addIntervalsForSpills(const LiveInterval &li, VirtRegMap &vrm, unsigned reg) {
if (!mop.isRegister())
continue;
unsigned Reg = mop.getReg();
+ unsigned RegI = Reg;
if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg))
continue;
bool isSubReg = RegMap->isSubRegister(Reg);
@@ -381,17 +382,7 @@ addIntervalsForSpills(const LiveInterval &li, VirtRegMap &vrm, unsigned reg) {
unsigned RegJ = MI->getOperand(j).getReg();
if (RegJ == 0 || MRegisterInfo::isPhysicalRegister(RegJ))
continue;
- bool isSubRegJ = RegMap->isSubRegister(RegJ);
- if (isSubRegJ) {
- assert(!isSubReg || RegMap->getSubRegisterIndex(RegJ) == SubIdx);
- RegJ = RegMap->getSuperRegister(RegJ);
- }
- // Important to check "isSubRegJ == isSubReg".
- // e.g. %reg1024 = MOVSX32rr16 %reg1025. It's possible that both
- // registers are coalesced to the same register but only %reg1025 is
- // a sub-register use. They should not be rewritten to the same
- // register.
- if (RegJ == li.reg && isSubRegJ == isSubReg) {
+ if (RegJ == RegI) {
MI->getOperand(j).setReg(NewVReg);
HasUse |= MI->getOperand(j).isUse();
HasDef |= MI->getOperand(j).isDef();