aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-07-05 23:48:07 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-07-05 23:48:07 +0000
commit202eb7b18e220205ec86a03ddf18f2066c70ab15 (patch)
tree332f9568d2bf336c1b50243a6f38cf4ff4e1cdfb
parent1f2415efc3e9f0eb9d50367979d9c8dd6d784658 (diff)
downloadexternal_llvm-202eb7b18e220205ec86a03ddf18f2066c70ab15.zip
external_llvm-202eb7b18e220205ec86a03ddf18f2066c70ab15.tar.gz
external_llvm-202eb7b18e220205ec86a03ddf18f2066c70ab15.tar.bz2
Use modern API to avoid exposing LiveInterval internals.
No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185733 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index 70a2462..f99f1a3 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -743,16 +743,14 @@ bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP,
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;