This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] [RFC] if-conversion and auto vectorizer
On Mon, Mar 15, 2004 at 03:06:56PM -0800, Devang Patel wrote:
> We keep using term SELECT because that's what we used in our discussion
> earlier. But now SELECT means MODIFY_EXPR <a,COND_EXPR <c,b,d>>.
Ok, thanks.
> Concerns we have is: Do we need separate pass (which I am currently
> implementing) to transform if-then-else to use 'conditional modify
> expr' for vectorizer or not?
I suspect that your vectorizer will want something much stronger than
what we will ever get from phiopts. Phiopts is simply trying to tidy
up simple situations.
--
Something that you should watch is that COND_EXPR is *not* predication,
and you can't force it to be predication on most targets. Depending on
what papers you're reading, this may significantly affect what you're
planning on doing.
The big distinction involves trapping expressions and operands. E.g.
if (test)
T_1 = *p;
else
T_2 = 0;
T_3 = PHI (T_1, T_2);
cannot be transformed to
T_1 = *p;
T_3 = test ? T_1 : 0;
unless you can show either that (1) dereferencing *p will never trap,
or (2) some other dereference of *p dominates this test. Similar
examples can be shown with arithmetic such as divide, or fp arithmetic
without -ffast-math (i.e. when we can't discount NaNs).
r~