Currently, the vectorizer cost model does not take into account misaligned
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
This check should be more accurate for targets that have different
different misalignment offsets; for other targets using
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).
* 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):
* tree-vect-stmts.c (vect_model_store_cost): Use the new
definition and function.
(See attached file: patch_10_11_cost.txt)
Description: Text document