SplitBlock() can't handle catchswitch.
Fixes PR50973.
Differential D105672
[SimpleLoopUnswitch] Don't non-trivially unswitch loops with catchswitch exits aeubanks on Jul 8 2021, 4:32 PM. Authored by
Details SplitBlock() can't handle catchswitch. Fixes PR50973.
Diff Detail
Event TimelineComment Actions Thank you!
Comment Actions 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. |
Oh, I didn't find there's already a similar condition for cleanuppad...