On Wed, 12 Jun 2013, Jeff Law wrote:

On 06/12/13 14:17, Marc Glisse wrote:
On Wed, 12 Jun 2013, Marc Glisse wrote:

I suppose it's explicitely not allowing complex integer constants?

Hmm... Thanks, I keep forgetting complex :-(

And complex is even more of a pain than vector to handle.

Testing for CONSTANT_CLASS_P seems sufficient here. Some
transformations also seem valid for complex, and the others are
already restricted by the fact that they involve operators like AND or
XOR, or because we exit early for FLOAT_TYPE_P and FIXED_POINT_TYPE_P.
I'll test that (no new macro for now then).

Here is a new version. I added a build_all_ones_cst helper which
currently only handles integer-like (complex, vector) types.

Bootstrap+testsuite on x86_64-unknown-linux-gnu as usual.

2013-06-13  Marc Glisse  <marc.gli...@inria.fr>

     * tree-ssa-forwprop.c (simplify_bitwise_binary, associate_plusminus):
     Generalize to complex and vector.
     * tree.c (build_all_ones_cst): New function.
     * tree.h (build_all_ones_cst): Declare it.
This is OK.

Thanks.

Extra credit if you create some testcases.

I'll try to add one, but the most interesting one would involve a BIT_NOT_EXPR of a complex of integers, and I don't have any idea how to create that (~ means CONJ_EXPR as a gcc extension), or if it is even supposed to be legal.

--
Marc Glisse

Reply via email to