[LLVMdev] Lowering switch statements with PGO

Chandler Carruth chandlerc at google.com
Mon Dec 15 18:40:35 PST 2014


On Mon, Dec 15, 2014 at 2:55 PM, Hans Wennborg <hans at chromium.org> wrote:
>
> I suspect that if the whole switch can be lowered to a jump table,
> that's the best lowering.
>

A well predicted branch can be better than even a well predicted indirect
branch in lots of cases. At the IR level it allows predicate based
simplification that may be harder. At the machine level, there are
different levels of prediction accuracy, and I think the branch is
essentially always likely to do better in terms of icache.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141215/4eb63f9b/attachment.html>


More information about the llvm-dev mailing list