This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] misaligned stores support

This is an old patch - I think relative to autovect-branch - from over a
year ago, written by Leehod Baruch (IIRC, with some hints from rth at the
time). I don't remember if it was working all the way, and it would anyhow
need to be updated to current mainline and tested.  I'm bringing it up as
promised here -, in case
someone wants to take it forward.

This patch includes code to expand a MISALIGNED_INDIRECT_REF in a store
stmt, and a couple changes to the vectorizer: one is when considering to
peel a loop to align an otherwise-unsupported misaligned memory access -
currently we do that only for stores, but with this patch there's no longer
a need to treat stores differently than loads. The second change is to
check whether a movmisalign is supported rather than always returning that
there's no support for misaligned stores.

With this patch we'd probably need to change a lot of vectorizer testcases
that currently assume that misaligned stores are not supported.

Also, a couple things that, with this patch, would be even more
1. Add support for the "software-pipelined" (or "explicit") vectorization
scheme of handling misalignment (i.e. - add a "realign-store" idiom and use
it to handle misaligned store by doing an extra aligned load+store before
and after of the loop, and realignment operations in the loop to extract
the desired data for each iteration).
2. Add a cost model - with this patch the vectorizer will generate
misaligned vector stores, whereas peeling (which is what we do now) might
be preferable. We need a way to evaluate which vectorization scheme is
expected to be more profitable.


(See attached file: misaaligned_store.txt)

Attachment: misaaligned_store.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]