In https://bugs.llvm.org/show_bug.cgi?id=48821 there are some
discussions around problems with SpeculateAroundPHIs and back-edges
in loops.
One problem observed is that when splitting a critical edge that
is a loop latch, the pass isn't transferring loop metadata to the
new latch (nor removing the old loop metadata). So if we want to
allow speculation for such scenarios we need to fix that.
There have also been observations that (downstream) backends have
had problems with identifying hwloops when allowing speculation
involving back-edges. That might be a target specific problem
that potentially could be resolved by adding a TTI hook, or possibly
by keeping the loop form by also rotating loops after the pass (need
to decide if opt should canonicalize the loop in such manner or if
a backend need to rotate loops in the codegen pipeline).
This also avoid some differences between LegacyPM and NewPM when
it comes to how we optimize loops. So this could make the transition
to the new pass manager more clean, avoiding to change both pass
manager and potentially introducing new phase ordering issues at the
same time.
clang-format not found in user's PATH; not linting file.