diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-03-12 18:35:40 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-03-12 18:35:40 +0000 |
| commit | b73c0b041da1f9bd36d79185f5bd51d1befe7fdf (patch) | |
| tree | 5d6a933e3913d74b492ba2807486681a4b75688e /llvm/lib/Target/R600/AMDGPUISelLowering.cpp | |
| parent | 44be154b04c02f17fc2a10476a055dc294cd4918 (diff) | |
| download | bcm5719-llvm-b73c0b041da1f9bd36d79185f5bd51d1befe7fdf.tar.gz bcm5719-llvm-b73c0b041da1f9bd36d79185f5bd51d1befe7fdf.zip | |
Allow switch-to-lookup table for tables with holes by adding bitmask check
This allows us to generate table lookups for code such as:
unsigned test(unsigned x) {
switch (x) {
case 100: return 0;
case 101: return 1;
case 103: return 2;
case 105: return 3;
case 107: return 4;
case 109: return 5;
case 110: return 6;
default: return f(x);
}
}
Since cases 102, 104, etc. are not constants, the lookup table has holes
in those positions. We therefore guard the table lookup with a bitmask check.
Patch by Jasper Neumann!
llvm-svn: 203694
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUISelLowering.cpp')
0 files changed, 0 insertions, 0 deletions

