[SimplifyCFG] Update SimplifyBranchOnICmpChain to recognize select form of and/or
authorJuneyoung Lee <aqjune@gmail.com>
Mon, 18 Jan 2021 04:32:31 +0000 (13:32 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Mon, 18 Jan 2021 23:53:40 +0000 (08:53 +0900)
commit395c737d9fcefb0fb99ac6c524b1d47e697d31d6
treebbda55ee972e93403527b67022ea9e8e8e1e68a6
parentfe301f474977da0b82548652ef4bbd058542d076
[SimplifyCFG] Update SimplifyBranchOnICmpChain to recognize select form of and/or

This patch teaches SimplifyCFG::SimplifyBranchOnICmpChain to understand select form of
(x == C1 || x == C2 || ...) / (x != C1 && x != C2 && ...) and optimize them into switch if possible.
D93065 has more context about the transition, including links to the list of optimizations being updated.

Differential Revision: https://reviews.llvm.org/D93943
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/switch_create.ll