[PATCH] D31080: [DAG] Extract switch lowering as a spearate object NFC

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 08:17:55 PDT 2017


junbuml added a comment.

> Rather than splitting those out as virtual calls, I think the nicest design would be if the case clustering logic could work as an analysis: you feed it an array of cases, from which it computes some kind of result which indicates what cases go in jump tables, which are bit tests, etc. The SDAGBuilder would then consume that result to actually build the jump tables etc.

Could you give me little bit more details about what you mention because for me it seems almost same as what current implementation is doing. If I understand correctly, current implementation of switch lowering use CaseClusterVector (a vector of CaseCluster) storing what cases go to JT and what cases go to BTest. In visitSwitch(), we first build CaseClusterVector without actual lowering. After then SDAGBuilder use CaseClusterVector to actually lower to JT or BTest. Did you mean for us to use another array instead of CaseClusterVector ?


https://reviews.llvm.org/D31080





More information about the llvm-commits mailing list