[PATCH] D105672: [SimpleLoopUnswitch] Don't non-trivially unswitch loops with catchswitch exits

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 09:00:58 PDT 2021


rnk added a comment.

By the way, the `catchswitch` instructions true purpose is really just to multiplex invokes. When we added WinEH, `callbr` didn't exist. We felt that extending `invoke` with multiple unwind edges would be too disruptive. If we were doing it today, we would probably implement this in such a way that blocks without insertion points do not exist. That's a good project that would simplify LLVM transforms in the long run. It's probably not that straightforward, since most passes think `callbr` is just a wrapper for asm goto.

The `cleanuppad` design is probably as good as it's going to get. If we want to unswitch a loop inside a destructor cleanup, we wouldn't want that pass to accidentally create two prologues for a cleanup funclet, that would be too challenging. Instead, passes that really need to insert code along edges entering a `cleanuppad` can be taught to create new trivial cleanup funclets. This isn't too different from splitting edges coming into a `landingpad`, which LLVM knows how to do.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105672/new/

https://reviews.llvm.org/D105672



More information about the llvm-commits mailing list