[PATCH] D155395: [SimplifyCFG] Remove identical successors in switch instructions in simple cases.

DianQK via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 18:46:26 PDT 2023


DianQK reclaimed this revision.
DianQK added a comment.

> I reopened this revision to present my new idea and findings. Maybe such as Discord, discourse, or GitHub issues would be a preferable discussion?

I found that the sink common instructions are not often helpful for performance, see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L2255-L2272.
But I found I could take this problem and turn it into two optimizations.

1. Eliminating unreachable basic blocks. But here are specific patches, such as D6697 <https://reviews.llvm.org/D6697> and D6471 <https://reviews.llvm.org/D6471>, that prevent this behavior. I'll look into that later.
2. Without unreachable basic blocks, it should be possible to extend the hoist common instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155395



More information about the llvm-commits mailing list