[llvm] r185733 - Use modern API to avoid exposing LiveInterval internals.

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jul 5 16:48:07 PDT 2013


Author: stoklund
Date: Fri Jul  5 18:48:07 2013
New Revision: 185733

URL: http://llvm.org/viewvc/llvm-project?rev=185733&view=rev
Log:
Use modern API to avoid exposing LiveInterval internals.

No functional change intended.

Modified:
    llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp

Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=185733&r1=185732&r2=185733&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Fri Jul  5 18:48:07 2013
@@ -743,16 +743,14 @@ bool RegisterCoalescer::reMaterializeTri
     return false;
 
   LiveInterval &SrcInt = LIS->getInterval(SrcReg);
-  SlotIndex CopyIdx = LIS->getInstructionIndex(CopyMI).getRegSlot(true);
-  LiveInterval::iterator SrcLR = SrcInt.FindLiveRangeContaining(CopyIdx);
-  assert(SrcLR != SrcInt.end() && "Live range not found!");
-  VNInfo *ValNo = SrcLR->valno;
+  SlotIndex CopyIdx = LIS->getInstructionIndex(CopyMI);
+  VNInfo *ValNo = LiveRangeQuery(SrcInt, CopyIdx).valueIn();
+  assert(ValNo && "CopyMI input register not live");
   if (ValNo->isPHIDef() || ValNo->isUnused())
     return false;
   MachineInstr *DefMI = LIS->getInstructionFromIndex(ValNo->def);
   if (!DefMI)
     return false;
-  assert(DefMI && "Defining instruction disappeared");
   if (DefMI->isCopyLike()) {
     IsDefCopy = true;
     return false;





More information about the llvm-commits mailing list