1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[StatepointLowering] Move an assertion; NFCI

Instead of running an explicit loop over `gc.relocate` calls hanging off
of a `gc.statepoint`, assert the validity of the type of the value being
relocated in `visitRelocate`.

llvm-svn: 263516
This commit is contained in:
Sanjoy Das 2016-03-15 01:16:31 +00:00
parent ec0101c58a
commit a4372ed421

View File

@ -534,12 +534,6 @@ static void lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops,
"non gc managed derived pointer found in statepoint");
}
}
for (const GCRelocateInst *GCR : Relocations) {
auto Opt = S.isGCManagedPointer(GCR->getType()->getScalarType());
if (Opt.hasValue()) {
assert(Opt.getValue() && "non gc managed pointer relocated");
}
}
#endif
// Before we actually start lowering (and allocating spill slots for values),
@ -872,6 +866,10 @@ void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) {
// different basic blocks.
if (Relocate.getStatepoint()->getParent() == Relocate.getParent())
StatepointLowering.relocCallVisited(Relocate);
auto *Ty = Relocate.getType()->getScalarType();
if (auto IsManaged = GFI->getStrategy().isGCManagedPointer(Ty))
assert(*IsManaged && "Non gc managed pointer relocated!");
#endif
const Value *DerivedPtr = Relocate.getDerivedPtr();