[PATCH] D155711: [SimplifyCFG] Hoist common instructions on Switch.

DianQK via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 06:12:07 PDT 2023


DianQK added a comment.

In D155711#4517725 <https://reviews.llvm.org/D155711#4517725>, @nikic wrote:

> Is it possible to instead generalize the HoistThenElseCodeToIf() transform to not require exactly two successors, so it can support switch as well?

I considered that possibility. I'm concerned that this might have an impact on compile time for the two successors.
But it's more a question of whether the reordering and debug instructions can be more profitable for the switch instruction.
**Using the same analysis on multiple successors can become more complex. Too long compile time?**
**But adding some options to control these behaviors may be appropriate.** So I'll give it a new try.

Also, I feel like checking if the debug command is the same is a bit much.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155711



More information about the llvm-commits mailing list