This is an archive of the discontinued LLVM Phabricator instance.

[RewriteStatepointsForGC] Fix an incorrect assertion
ClosedPublic

Authored by DaniilSuchkov on Feb 16 2022, 4:53 PM.

Details

Summary

The assertion verifying that a newly computed value matches what is
already cached used stripPointerCasts() to strip bitcasts, however the
values can be not only pointers, but also vectors of pointers. That is
problematic because stripPointerCasts() doesn't handle vectors of
pointers. This patch introduces an ad-hoc utility function to strip all
bitcasts regardless of the value type.

Diff Detail

Event Timeline

DaniilSuchkov created this revision.Feb 16 2022, 4:53 PM
DaniilSuchkov requested review of this revision.Feb 16 2022, 4:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2022, 4:53 PM

The change itself looks good to me.

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

Just wonder, don't you want to eliminate the reason for this assert?:)

LGTM as well.

DaniilSuchkov added inline comments.Feb 17 2022, 10:17 AM
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
1180

I guess we can just wait for opaque pointers, then this problem simply won't exist.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 17 2022, 10:45 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.