aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-03-15 01:16:31 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-03-15 01:16:31 +0000
commitc11460e051121531be94d776954d74e10027f3e9 (patch)
treeee4f3dfc0c07d6ed0fdad3aefda96fb5088d7cc1 /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
parent249c45d92e03fc842175a3998d6a5c4a3d5c4dff (diff)
downloadllvm-c11460e051121531be94d776954d74e10027f3e9.zip
llvm-c11460e051121531be94d776954d74e10027f3e9.tar.gz
llvm-c11460e051121531be94d776954d74e10027f3e9.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 323613f..9d20d0a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -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();