Fix PR 110554: vec lowering introduces scalar signed-boolean:32 comparisons
commita73b65b74105e76473cc2825bb4e7253deaf18b3
authorAndrew Pinski <apinski@marvell.com>
Wed, 5 Jul 2023 03:38:06 +0000 (4 20:38 -0700)
committerAndrew Pinski <apinski@marvell.com>
Thu, 6 Jul 2023 06:19:51 +0000 (5 23:19 -0700)
tree58e335a0cf28984df9ee512e1b5cc7cca3cb9947
parent37a231cc7594d12ba0822077018aad751a6fb94e
Fix PR 110554: vec lowering introduces scalar signed-boolean:32 comparisons

So the problem is vector generic decided to do comparisons in signed-boolean:32
types but the rest of the middle-end was not ready for that. Since we are building
the comparison which will feed into a cond_expr here, using boolean_type_node is
better and also correct. The rest of the compiler thinks the ranges for
comparison is always [0,1] too.

Note this code does not currently lowers bigger vector sizes into smaller
vector sizes so using boolean_type_node here is better.

OK? bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

PR middle-end/110554
* tree-vect-generic.cc (expand_vector_condition): For comparisons,
just build using boolean_type_node instead of the cond_type.
For non-comparisons/non-scalar-bitmask, build a ` != 0` gimple
that will feed into the COND_EXPR.
gcc/tree-vect-generic.cc