gcc-patches@gcc.gnu.org
[Top] [All Lists]

[PATCH][RFC] Vectorizer cost model changes for misalign store

Subject: [PATCH][RFC] Vectorizer cost model changes for misalign store
From: Revital1 Eres
Date: Tue, 10 Nov 2009 16:06:38 +0200
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

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH][RFC] Vectorizer cost model changes for misalign store, Revital1 Eres <=