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

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 13:38:31 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D31080#704197, @hans wrote:

> Hi Jun,
>
> I think extracing the logic for clustering cases into jump tables, bit tests, etc. into a separate class might be a good idea, but I don't think we should extract the actual lowering parts. If the purpose of this is to expose a hook to figure out how a switch table will be lowered, the actual lowering doesn't need to happen here. The class that deals with clustering cases should not need to know about SDAGBuilder.


Agreed.

> I'm concerned that this hook might turn out to be very expensive though.

What primarily concerns you about the cost?

If it is the cost of actually computing the clustering, the thing the inliner wants could be a rough approximation. Put differently, we don't need to actually *form* the clustering, just have an estimate of how many branches will end up being used (as opposed to jump tables).


https://reviews.llvm.org/D31080





More information about the llvm-commits mailing list