[llvm] r258771 - LiveIntervalAnalysis: Improve some comments
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 17:40:48 PST 2016
Author: matze
Date: Mon Jan 25 19:40:48 2016
New Revision: 258771
URL: http://llvm.org/viewvc/llvm-project?rev=258771&view=rev
Log:
LiveIntervalAnalysis: Improve some comments
As recommended by Justin.
Modified:
llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=258771&r1=258770&r2=258771&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Mon Jan 25 19:40:48 2016
@@ -213,7 +213,7 @@ namespace llvm {
return A.listEntry()->getIndex() < B.listEntry()->getIndex();
}
- /// Return true if A referes to the same or an earlier instruction as B.
+ /// Return true if A refers to the same instruction as B or an earlier one.
/// This is equivalent to !isEarlierInstr(B, A).
static bool isEarlierEqualInstr(SlotIndex A, SlotIndex B) {
return !isEarlierInstr(B, A);
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=258771&r1=258770&r2=258771&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Jan 25 19:40:48 2016
@@ -1045,7 +1045,7 @@ private:
if (MO->isReg() && MO->isUse())
MO->setIsKill(false);
// Adjust OldIdxIn->end to reach NewIdx. This may temporarily make LR
- // invalid by overlapping ranges. Case 5 above.
+ // invalid by overlapping ranges.
bool isKill = SlotIndex::isSameInstr(OldIdx, OldIdxIn->end);
OldIdxIn->end = NewIdx.getRegSlot(OldIdxIn->end.isEarlyClobber());
// If this was not a kill, then there was no def and we're done.
@@ -1166,13 +1166,13 @@ private:
"Same value defined more than once?");
// If OldIdx was a dead def remove it.
if (!OldIdxDefIsDead) {
- // Case 3: Remove segment starting at NewIdx and move begin of OldIdxOut
- // to NewIdx so it can take its place.
+ // Remove segment starting at NewIdx and move begin of OldIdxOut to
+ // NewIdx so it can take its place.
OldIdxVNI->def = NewIdxDef;
OldIdxOut->start = NewIdxDef;
LR.removeValNo(NewIdxOut->valno);
} else {
- // Case 4: Remove the dead def at OldIdx.
+ // Simply remove the dead def at OldIdx.
LR.removeValNo(OldIdxVNI);
}
} else {
More information about the llvm-commits
mailing list