This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Fix crash due to bad bitcast
ClosedPublic

Authored by loladiro on Apr 27 2017, 6:51 AM.

Details

Summary

As shown in the test case, SROA was crashing when trying to split
stores (to the alloca) of loads (from anywhere), because it assumed
the pointer operand to the loads and stores had to have the same
address space. This isn't the case. Make sure to use the correct
pointer type for both the load and the store.

Event Timeline

loladiro created this revision.Apr 27 2017, 6:51 AM
arsenm added a subscriber: arsenm.Apr 27 2017, 9:35 AM
arsenm added inline comments.
test/Transforms/SROA/address-spaces.ll
88

Needs check lines

loladiro updated this revision to Diff 96973.Apr 27 2017, 12:20 PM

Add some CHECK lines to the test case

Bump. Does this look good?

Bump. Can somebody review this, so we can get this in. @arsenm maybe?

yaxunl edited edge metadata.

I would like to review this since I encounter the same issue.

Sure, see if you think this is the right way to do it. If so, mark it as accepted, and I'll go ahead and commit it. I feel like we've given other people enough time to weigh in ;).

yaxunl accepted this revision.Jun 2 2017, 8:04 AM

LGTM. Thanks!

This revision is now accepted and ready to land.Jun 2 2017, 8:04 AM
This revision was automatically updated to reflect the committed changes.