This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Treat a value that has a single base and no derived inputs as base value
AcceptedPublic

Authored by dmakogon on May 5 2022, 4:45 AM.

Details

Summary

With this patch we track a IsDerived state for BDVs.
It is true for a given BDV if any of its operands is not equal to its BDV (stripping pointer casts).
If we find out that a pointer for which we are finding a base has a single base and has no derived inputs, we say that this pointer is actually equal to its base, so it is a base pointer itself, hence there's no need to relocate the original base along with this 'derived' pointer.

Diff Detail

Event Timeline

dmakogon created this revision.May 5 2022, 4:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 4:45 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
dmakogon requested review of this revision.May 5 2022, 4:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 4:45 AM
mkazantsev accepted this revision.May 10 2022, 1:41 AM

LGTM w/ nit.

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
847

I think a clarifying comment is needed here. Does IsDerived = true mean that it must be a derived pointer, or does it simply mean that we haven't proven it's a base?

This revision is now accepted and ready to land.May 10 2022, 1:41 AM
sanjoy resigned from this revision.Oct 10 2022, 2:42 PM