middle-end: check if target can do extract first for early breaks [PR113199]
commit80bb94e88faaadd4d6f008fececb46214dc89e9f
authorTamar Christina <tamar.christina@arm.com>
Tue, 9 Jan 2024 13:35:49 +0000 (9 13:35 +0000)
committerTamar Christina <tamar.christina@arm.com>
Tue, 9 Jan 2024 13:38:04 +0000 (9 13:38 +0000)
tree5f7cfae6fd97b13a3215cc9748b447d7047ee497
parente3632a18d1e0b94b4c7b99a512b19c830ed3b228
middle-end: check if target can do extract first for early breaks [PR113199]

I was generating the vector reverse mask without checking if the target
actually supported such an operation.

This patch changes it to if the bitstart is 0 then use BIT_FIELD_REF instead
to extract the first element since this is supported by all targets.

This is good for now since masks always come from whilelo.  But in the future
when masks can come from other sources we will need the old code back.

gcc/ChangeLog:

PR tree-optimization/113199
* tree-vect-loop.cc (vectorizable_live_operation_1): Use
BIT_FIELD_REF.

gcc/testsuite/ChangeLog:

PR tree-optimization/113199
* gcc.target/gcn/pr113199.c: New test.
gcc/testsuite/gcc.target/gcn/pr113199.c [new file with mode: 0644]
gcc/tree-vect-loop.cc