Hans Wennborg
b73c0b041d
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
2014-03-12 18:35:40 +00:00
..
2013-08-16 00:37:11 +00:00
2014-03-12 18:35:40 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2013-04-09 05:18:53 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2013-07-14 01:42:54 +00:00
2013-01-01 13:57:25 +00:00
2013-10-21 20:07:30 +00:00
2014-01-28 16:56:46 +00:00
2013-09-06 21:03:58 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2013-11-12 22:37:16 +00:00
2013-10-20 07:04:37 +00:00
2013-07-14 01:42:54 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2013-01-31 01:04:23 +00:00
2013-07-11 08:28:20 +00:00
2013-11-23 01:16:29 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-10-21 18:55:08 +00:00
2013-11-21 07:29:28 +00:00
2013-07-14 01:42:54 +00:00
2013-01-31 01:04:23 +00:00
2013-01-01 13:57:25 +00:00
2013-06-04 14:11:59 +00:00
2013-07-14 01:50:49 +00:00
2012-09-14 17:29:56 +00:00
2014-01-27 23:39:03 +00:00
2013-07-14 01:42:54 +00:00
2012-09-20 22:37:36 +00:00
2014-01-31 00:09:00 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-11-10 02:16:47 +00:00
2012-07-02 19:09:46 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-07-14 01:42:54 +00:00
2013-11-22 21:49:45 +00:00
2014-03-11 10:48:52 +00:00
2013-03-11 20:53:00 +00:00
2012-07-02 19:09:46 +00:00
2013-07-14 01:42:54 +00:00
2013-08-01 21:42:05 +00:00