This is the mail archive of the gcc-patches@gcc.gnu.org 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][RFC] Vectorizer cost model changes for misalign store


Hello,

Currently, the vectorizer cost model does not take into account misaligned
stores.
This patch tries to fix that by introducing a new cost for it:
TARG_VEC_UNALIGNED_STORE_COST and a new built-in function.
The built-in function receives  the misalignment factor and return the
access cost.
This check should be more accurate for targets that have different
penalties for
different misalignment offsets; for other targets using
TARG_VEC_UNALIGNED_STORE_COST
should be enough.
I am currently testing this patch on ppc (and intend to insert an
implementation for the built-in function).
If this patch is OK for mainline I would like to ask people that use
other targets with vector misalign store support to test this patch
(and tune it for their target if needed; by redefining the value above
or implementing the builtin function).

Thanks,
Revital

        * target.h (vector_mem_access_cost): Add to struct gcc_target.
        * tree-vectorizer.h (TARG_VEC_UNALIGNED_STORE_COST): Define.
        * target-def.h (TARGET_VECTORIZE_BUILTIN_MEMORY_ACCESS_COST):
Define.
        * tree-vect-stmts.c (vect_model_store_cost): Use the new
        definition and function.

(See attached file: patch_10_11_cost.txt)

Attachment: patch_10_11_cost.txt
Description: Text document


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