https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120164
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:eae54dd6e4cc69b4c86521f501339ef9fe0eab3f commit r17-840-geae54dd6e4cc69b4c86521f501339ef9fe0eab3f Author: Tamar Christina <[email protected]> Date: Wed May 27 14:31:49 2026 +0100 vect: drop prefetches during if-cvt [PR120164] PR114061 added support for dropping prefetches during vectorization but that version doesn't work when the prefetch is conditional. The conditionality introduces a non-if-convertible block in the CFG. The vectorizer removes the prefetch later on but it can't modify the CFG and as such the block where the prefetch was in remains with just a VUSEs chain. This change now drops them during if-conversion. While this patch at the moment removes them, it makes it easier for later on, should we want to start vectorizing these instead to just update predicate_statements. For now this follows the same approach as PR114061 and just drops them. gcc/ChangeLog: PR tree-optimization/120164 * tree-if-conv.cc (if_convertible_stmt_p): Detect prefetches. (predicate_statements): Drop them during predication. gcc/testsuite/ChangeLog: PR tree-optimization/120164 * gcc.dg/vect/vect-prefetch-drop_2.c: New test.
