Lines Matching defs:GC
1 //===- RewriteStatepointsForGC.cpp - Make GC relocations explicit ---------===//
128 // Find the GC strategy for a function, or null if it doesn't have one.
247 GCPtrLivenessData &Data, GCStrategy *GC);
252 StatepointLiveSetTy &out, GCStrategy *GC);
254 static bool isGCPointerType(Type *T, GCStrategy *GC) {
255 assert(GC && "GC Strategy for isGCPointerType cannot be null");
261 return GC->isGCManagedPointer(T).value_or(true);
264 // Return true if this type is one which a) is a gc pointer or contains a GC
268 static bool isHandledGCPointerType(Type *T, GCStrategy *GC) {
270 if (isGCPointerType(T, GC))
275 if (isGCPointerType(VT->getElementType(), GC))
283 static bool containsGCPtrType(Type *Ty, GCStrategy *GC) {
284 if (isGCPointerType(Ty, GC))
287 return isGCPointerType(VT->getScalarType(), GC);
289 return containsGCPtrType(AT->getElementType(), GC);
292 [GC](Type *Ty) { return containsGCPtrType(Ty, GC); });
296 // Returns true if this is a type which a) is a gc pointer or contains a GC
299 static bool isUnhandledGCPointerType(Type *Ty, GCStrategy *GC) {
300 return containsGCPtrType(Ty, GC) && !isHandledGCPointerType(Ty, GC);
317 PartiallyConstructedSafepointRecord &Result, GCStrategy *GC) {
319 findLiveSetAtInst(Call, OriginalLivenessData, LiveSet, GC);
1347 GCStrategy *GC);
1352 PointerToBaseTy &PointerToBase, GCStrategy *GC) {
1356 computeLiveInValues(DT, F, RevisedLivenessData, GC);
1360 GC);
1501 IRBuilder<> &Builder, GCStrategy *GC) {
1522 assert(isHandledGCPointerType(Ty, GC));
1648 GCStrategy *GC) {
1721 // marked as "gc-leaf-function" should be lowered in a GC parseable way.
1728 // accommodate GC. The underlying source and destination objects might be
1729 // relocated during copy operation should the GC occur. To relocate the
1880 CreateGCRelocates(LiveVariables, BasePtrs, ExceptionalToken, Builder, GC);
1926 CreateGCRelocates(LiveVariables, BasePtrs, Token, Builder, GC);
1938 const PointerToBaseTy &PointerToBase, GCStrategy *GC) {
1955 PointerToBase, GC);
2088 // the gc.statepoint. This will turn some subtle GC problems into
2249 GCStrategy *GC) {
2251 computeLiveInValues(DT, F, OriginalLivenessData, GC);
2254 analyzeParsePointLiveness(DT, OriginalLivenessData, toUpdate[i], info, GC);
2652 std::unique_ptr<GCStrategy> GC = findGCStrategy(F);
2688 assert(!isUnhandledGCPointerType(Arg->getType(), GC.get()) &&
2690 if (isHandledGCPointerType(Arg->getType(), GC.get()))
2701 findLiveReferences(F, DT, ToUpdate, Records, GC.get());
2752 recomputeLiveInValues(F, DT, ToUpdate, Records, PointerToBase, GC.get());
2768 // because we assume they won't move at runtime and the GC doesn't need to be
2812 PointerToBase, GC.get());
2867 assert(isHandledGCPointerType(Ptr->getType(), GC.get()) &&
2994 /// Looks up the GC strategy for a given function, returning null if the
2995 /// function doesn't have a GC tag. The strategy is stored in the cache.
3011 assert(Strategy && "GC strategy is required by function, but was not found");
3191 SetVector<Value *> &LiveTmp, GCStrategy *GC) {
3203 assert(!isUnhandledGCPointerType(V->getType(), GC) &&
3205 if (isHandledGCPointerType(V->getType(), GC) && !isa<Constant>(V)) {
3223 GCStrategy *GC) {
3231 assert(!isUnhandledGCPointerType(V->getType(), GC) &&
3233 if (isHandledGCPointerType(V->getType(), GC) && !isa<Constant>(V))
3239 static SetVector<Value *> computeKillSet(BasicBlock *BB, GCStrategy *GC) {
3242 if (isHandledGCPointerType(I.getType(), GC))
3277 GCPtrLivenessData &Data, GCStrategy *GC) {
3282 Data.KillSet[&BB] = computeKillSet(&BB, GC);
3284 computeLiveInValues(BB.rbegin(), BB.rend(), Data.LiveSet[&BB], GC);
3292 computeLiveOutSeed(&BB, Data.LiveOut[&BB], GC);
3344 StatepointLiveSetTy &Out, GCStrategy *GC) {
3356 GC);
3365 GCStrategy *GC) {
3367 findLiveSetAtInst(Call, RevisedLivenessData, Updated, GC);