This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Align copied load/store instructions as the original.
ClosedPublic

Authored by jdoerfert on Oct 1 2014, 6:39 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jdoerfert updated this revision to Diff 14283.Oct 1 2014, 6:39 AM
jdoerfert retitled this revision from to [Polly] Align copied load/store instructions as the original..
jdoerfert added a reviewer: grosser.
jdoerfert added subscribers: Restricted Project, Unknown Object (MLST).
grosser edited edge metadata.Oct 1 2014, 7:03 AM

Is this save?

For normal accesses, we can probably say that the different iterations
of a statement will always access the same set of memory locations,
independently of the schedule of this statement. If the original
accesses have been aligned to a certain boundary before, they accesses
of the rescheduled statements will be aligned again.

Regarding user modified access functions. The above reasoning only holds
if the new access function does only access data locations that have
also been accessed by this statement when using the old access function.
If we modified access functions to use data locations that have been
used in the scop, but not in the very same statement, this
assumption does not hold, as the uses in the other statement may have a
different alignment.

I see three approaches here:

  1. Leave it as it is.
  1. Have the jscop-importer check that access functions are only modified in the way described above.
  1. Compute the new alignment correctly, by first deriving the alignment of the base ptr based on the alignments of the accesses and then recompute the alignment of the accesses from the possibly modified access function.
  1. feels unsatisfying to me 3) would be nice to have, but is probably

too involved for this patch. 2) is hopefully just a two line change and
could possibly save us in the future.

Cheers,
Tobias

(You also miss a test case)

jdoerfert updated this revision to Diff 14328.Oct 2 2014, 9:14 AM
jdoerfert edited edge metadata.

Added testcases and updated according to reviews

jdoerfert closed this revision.Oct 2 2014, 9:32 AM
jdoerfert updated this revision to Diff 14329.

Closed by commit rL218883 (authored by @jdoerfert).