This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Fix for a SROA store widening bug
AbandonedPublic

Authored by ygao on Aug 15 2014, 11:08 AM.

Details

Reviewers
None
Summary

Hi,

I ran into the following test case which breaks if I compile for x86_64-linux
at -O2 or higher, but works at -O1.

The bug appears to be in the SROA pass where a 12-byte memcpy is replaced with
a 16-byte <4 x float> store, which writes past the boundary of a struct on the
stack. I includes a fix here for review which keeps the memcpy when the memory
transfer size appears to be too large, but I am not very familiar with SROA and
I am not sure if there are other similar cases I should cover.

Any advice will be appreciated,

  • Gao

Diff Detail

Event Timeline

ygao updated this revision to Diff 12564.Aug 15 2014, 11:08 AM
ygao retitled this revision from to [SROA] Fix for a SROA store widening bug.
ygao updated this object.
ygao edited the test plan for this revision. (Show Details)
ygao edited the test plan for this revision. (Show Details)
ygao updated this object.Aug 15 2014, 11:10 AM
ygao edited the test plan for this revision. (Show Details)
ygao edited the test plan for this revision. (Show Details)Aug 15 2014, 11:13 AM
ygao edited the test plan for this revision. (Show Details)
ygao edited the test plan for this revision. (Show Details)
ygao edited the test plan for this revision. (Show Details)Aug 15 2014, 11:16 AM
ygao added subscribers: Unknown Object (MLST), chandlerc, bkramer.
ygao added a subscriber: rnk.Aug 21 2014, 7:39 PM

Looks like this test case is just a special case of PR18726, which Reid just fixed in r216248.

ygao abandoned this revision.Aug 21 2014, 7:40 PM