[PATCH] [llgo] irgen: generate switch instructions
Andrew Wilkins
axwalk at gmail.com
Fri Jan 2 18:17:17 PST 2015
Hi pcc,
With this patch, llgo uses ssautil.Switches
to reconstitute (and synthesise) switches,
which can then be lowered to lookup tables,
trees, etc.
We currently only handle integer const case
switches. We erase the comparison blocks (other
than the initial block), and generate a switch
instruction at the end of the block starting
the if-else-if chain. ssautil.Switches does
not remove duplicate const cases (e.g. same
operands for "||"), so we do this in llgo for
now.
http://reviews.llvm.org/D6831
Files:
irgen/ssa.go
irgen/switches.go
test/irgen/switch.go
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6831.17768.patch
Type: text/x-patch
Size: 6456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150103/bc521540/attachment.bin>
More information about the llvm-commits
mailing list