Bug 101802 - Vectorization can end up creating vector bool CTORs
Summary: Vectorization can end up creating vector bool CTORs
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks: vectorizer
  Show dependency treegraph
 
Reported: 2021-08-06 10:31 UTC by Richard Biener
Modified: 2021-08-06 10:32 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2021-08-06 10:31:14 UTC
When SLP vectorization creates code for external bool defs that are used in
condition composition we can end up combining them with vector booleans
and thus push types like vector(16) <signed-boolean:1> on them.

vect_create_constant_vectors then converts the components to signed-boolean:1
using _3 = _2 ? -1 : 0 and builds a CTOR with signed-boolean:1 components.
It's probably better to code-generate the "conversion" to vector bool by
using a CTOR with the original bools and then producing the vector bool mask
by a comparison against zero (if supported?).
Comment 1 Richard Biener 2021-08-06 10:32:21 UTC
See PR101636 for a testcase where this triggers.