This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Handle call/invoke instructions as base defining values of vectors
ClosedPublic

Authored by dneilson on Jan 29 2018, 11:34 AM.

Details

Summary

There's an asymmetry in the definitions of findBaseDefiningValueOfVector() and
findBaseDefiningValue() of RS4GC. The later handles call and invoke instructions,
and the former does not. This appears to be simple oversight. This patch remedies
the oversight by adding the call and invoke cases to findBaseDefiningValueOfVector().

Diff Detail

Repository
rL LLVM

Event Timeline

dneilson created this revision.Jan 29 2018, 11:34 AM

I wonder is it possible to handle this two instructions, GEPs, bitcasts, loads, and other in findBaseDefiningValue to avoid code duplication and such oversights?

anna added a comment.Jan 30 2018, 4:30 AM

I wonder is it possible to handle this two instructions, GEPs, bitcasts, loads, and other in findBaseDefiningValue to avoid code duplication and such oversights?

We could, but I guess the idea is to explicitly think about vector and scalar code separately.

anna accepted this revision.Jan 30 2018, 4:35 AM

lgtm w/ comment addressed.

test/Transforms/RewriteStatepointsForGC/base-vector.ll
267 ↗(On Diff #131834)

please add a testcase for invoke as well. We should exercise that code path (there's a testcase in invokes.ll for the scalar version).

This revision is now accepted and ready to land.Jan 30 2018, 4:35 AM
dneilson updated this revision to Diff 131954.Jan 30 2018, 6:01 AM

Adding vector invoke test

This revision was automatically updated to reflect the committed changes.