Hans Wennborg
19236d53eb
Switch-to-lookup tables: Don't require a result for the default
...
case when the lookup table doesn't have any holes.
This means we can build a lookup table for switches like this:
switch (x) {
case 0: return 1;
case 1: return 2;
case 2: return 3;
case 3: return 4;
default: exit(1);
}
The default case doesn't yield a constant result here, but that doesn't matter,
since a default result is only necessary for filling holes in the lookup table,
and this table doesn't have any holes.
This makes us transform 505 more switches in a clang bootstrap, and shaves 164 KB
off the resulting clang binary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-12 00:44:41 +00:00
..
2013-08-16 00:37:11 +00:00
2014-01-12 00:44:41 +00:00
2011-08-29 20:39:23 +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
2011-08-29 20:39:23 +00:00
2013-04-09 05:18:53 +00:00
2011-04-26 17:41:02 +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
2011-03-09 00:48:33 +00:00
2011-09-05 12:57:57 +00:00
2013-10-21 20:07:30 +00:00
2013-07-14 01:42:54 +00:00
2013-09-06 21:03:58 +00:00
2012-06-24 10:15:42 +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
2011-06-18 10:28:47 +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
2011-06-30 20:14:24 +00:00
2013-10-21 18:55:08 +00:00
2012-01-05 23:58:56 +00:00
2013-11-21 07:29:28 +00:00
2013-07-14 01:42:54 +00:00
2011-04-29 18:47:31 +00:00
2011-04-29 18:47:25 +00:00
2011-04-29 18:47:38 +00:00
2010-12-14 08:46:09 +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
2013-12-20 08:21:30 +00:00
2013-07-14 01:42:54 +00:00
2012-09-20 22:37:36 +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
2013-07-14 01:42:54 +00:00
2013-03-11 20:53:00 +00:00
2012-07-02 19:09:46 +00:00
2012-01-23 00:05:17 +00:00
2013-07-14 01:42:54 +00:00
2013-08-01 21:42:05 +00:00