[llvm-commits] SwitchLowering refactoring patch for review

aSL asl at sophsolutions.com
Tue Mar 20 09:21:47 PDT 2007


Hello, Everyone.

This is the first patch targeting switch lowering refactoring as
indicated in PR926.

Currently it implements "worklist" strategy, where we're deciding either
emit JT or split the case range or each step (not only in the early
beginning). Also, I've included some heuristic to calculate pivot:
maximise sum of densities of RHS & LHS. This lead to unbalanced tree,
but really increase chances of JT emission in the future.

E.g. we split switch (0-5, 120-126, 1024) into 2 JT's and 1 specific
comparison + some "glue" code to discriminate cases.

Tested with:

1. llvm-gcc bootstrap
2. Building mozilla & qt with bootstrapped compiler.

 
-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch-lower-refactoring.diff
Type: text/x-patch
Size: 29118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070320/6d077dd8/attachment.bin>


More information about the llvm-commits mailing list