Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | bool Interference = foreachUnit(TRI, VirtReg, PhysReg, | ||||
[&](unsigned Unit, const LiveRange &LR) { | [&](unsigned Unit, const LiveRange &LR) { | ||||
return query(LR, Unit).checkInterference(); | return query(LR, Unit).checkInterference(); | ||||
}); | }); | ||||
if (Interference) | if (Interference) | ||||
return IK_VirtReg; | return IK_VirtReg; | ||||
return IK_Free; | return IK_Free; | ||||
} | } | ||||
bool LiveRegMatrix::checkInterference(SlotIndex Start, SlotIndex End, | |||||
unsigned PhysReg) { | |||||
// Construct artificial live range containing only one segment [Start, End). | |||||
VNInfo valno(0, Start); | |||||
LiveRange::Segment Seg(Start, End, &valno); | |||||
LiveRange LR; | |||||
LR.addSegment(Seg); | |||||
// Check for interference with that segment | |||||
for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { | |||||
if (query(LR, *Units).checkInterference()) | |||||
return true; | |||||
} | |||||
return false; | |||||
} |