Vectorization: Drop prefetches during if-conversion.
The vectorizer will now drop prefetches during if-conversion, which simplifies later vectorization efforts.
This change addresses an issue where prefetches within conditional statements were not being properly handled during vectorization. The conditionality introduced a non-if-convertible block, preventing the vectorizer from removing the prefetch. This patch now drops these prefetches during if-conversion, paving the way for potential vectorization of these prefetches in the future.
In Details
PR114061 added support for dropping prefetches during vectorization, but it didn't account for conditional prefetches, which introduces a non-if-convertible block in the CFG. The conditionality prevents the vectorizer from modifying the CFG, leaving the block with just a VUSEs chain. This patch modifies tree-if-conv.cc to drop these during predication.
For Context
Vectorization is a compiler optimization that transforms code to perform operations on multiple data elements simultaneously, using vector instructions. Prefetching is a technique where data is loaded into a cache before it is needed, reducing memory access latency. If-conversion transforms conditional branches into predicated instructions, allowing for more efficient vectorization. This change ensures that prefetches within conditional blocks are properly handled during vectorization, which can lead to performance improvements.