https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83410
--- Comment #5 from Jeffrey A. Law <law at redhat dot com> --- So to record my current thoughts. There's two competing needs here. We sometimes want to thread as the simplifications can enable vectorization. Other times we do not want to thread because threading inhibits graphite and likely other optimizations. I don't see anything in terms of the shape of the CFG before or after that we can use to decide whether or not to thread. The one thing that stood out was the contents of the block with the exit test. In the cases where we want to thread the block was just a counter increment and branch (perhaps with PHIs). In cases where we do not want to thread it is more substantial.