[RFC] [autovect patch] Implement vectorization hints

Zack Weinberg zack@codesourcery.com
Sun Feb 27 17:29:00 GMT 2005


Devang Patel <dpatel@apple.com> writes:

> This patch implements two #pragmas that developers can use to give
> hints to auto vectorization pass. These pragmas are inserted in the
> source file before the loop. They are effective only on the very next
> loop in the source file.
>
> "#pragma novector" instructs compiler to not vectorize the
> loop. Programmer may decide to do so for various reasons.
>
> "#pragma ivdep" instructs compiler to ignore possible data dependence
> when data dependence analyzer is not able determine it. This is useful
> in a situation where compiler does not have enough information to
> prove data independence, but developer knows about it.

I have not read your code in any detail, and do not intend to, but
please permit me to point out that GCC-specific #pragmas should begin
"#pragma GCC" (you do this with the namespace argument to
c_register_pragma - note the line immediately above the two you
added).  If these #pragmas are compatible with some other compiler,
please document which compiler that is.

Also, if I was just going along reading code and I saw 
#pragma [GCC] ivdep, I would have no idea what it did.  Could you
please use a more descriptive name, e.g. 
#pragma GCC ignore_data_dependencies?  (Ignore this critique if it's
"ivdep" for compatibility with some other compiler.)

Finally, I notice that your test cases are inconsistent with your code.

zw



More information about the Gcc-patches mailing list