diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-10-18 05:18:55 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-10-18 05:18:55 +0000 |
commit | 99fe34b9b2bb8786da6c7f6134ae17d4c2cd8bf7 (patch) | |
tree | fa56db9087f75602392b8440a09bd679b412f8f1 /lib/CodeGen | |
parent | 4ae14bc1f537d91ddbc8ab0452ac9318a7b465d9 (diff) | |
download | external_llvm-99fe34b9b2bb8786da6c7f6134ae17d4c2cd8bf7.zip external_llvm-99fe34b9b2bb8786da6c7f6134ae17d4c2cd8bf7.tar.gz external_llvm-99fe34b9b2bb8786da6c7f6134ae17d4c2cd8bf7.tar.bz2 |
When creating intervals, leave min(1, numdefs) holes after each instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index ff247ad..1304659 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -130,9 +130,13 @@ void LiveIntervals::computeNumbering() { MIIndex += InstrSlots::NUM; FunctionSize++; - // Insert an empty slot after every instruction. - MIIndex += InstrSlots::NUM; - i2miMap_.push_back(0); + // Insert min(1, numdefs) empty slots after every instruction. + unsigned Slots = I->getDesc().getNumDefs(); + if (Slots == 0) + Slots = 1; + MIIndex += InstrSlots::NUM * Slots; + while (Slots--) + i2miMap_.push_back(0); } // Set the MBB2IdxMap entry for this MBB. @@ -732,8 +736,12 @@ void LiveIntervals::computeIntervals() { handleRegisterDef(MBB, MI, MIIndex, MO, i); } } - - MIIndex += InstrSlots::NUM; + + // Skip over the empty slots after each instruction. + unsigned Slots = MI->getDesc().getNumDefs(); + if (Slots == 0) + Slots = 1; + MIIndex += InstrSlots::NUM * Slots; // Skip over empty indices. while (MIIndex / InstrSlots::NUM < i2miMap_.size() && |