Marcello Maggioni
5c98f14b78
Two case switch to select optimization
...
This optimization tries to convert switch instructions that are used to select a value with only 2 unique cases + default block
to a select or a couple of selects (depending if the default block is reachable or not).
The typical case this optimization wants to be able to optimize is this one:
Example:
switch (a) {
case 10: %0 = icmp eq i32 %a, 10
return 10; %1 = select i1 %0, i32 10, i32 4
case 20: ----> %2 = icmp eq i32 %a, 20
return 2; %3 = select i1 %2, i32 2, i32 %1
default:
return 4;
}
It also sets the base for further optimizations that are planned and being reviewed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 18:16:44 +00:00
..
2014-06-09 22:42:55 +00:00
2014-10-07 18:16:44 +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
2014-07-25 21:13:35 +00:00
2013-10-21 20:07:30 +00:00
2014-01-28 16:56:46 +00:00
2014-10-03 20:01:09 +00:00
2014-09-30 22:23:38 +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
2014-05-09 17:02:46 +00:00
2011-06-18 10:28:47 +00:00
2014-10-03 20:01:09 +00:00
2014-09-09 17:10:21 +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
2014-07-30 21:04:00 +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
2014-07-07 21:19:00 +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-08-29 16:01:17 +00:00
2013-07-14 01:42:54 +00:00
2014-05-30 18:34:43 +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
2014-10-07 18:16:44 +00:00
2014-10-03 20:01:09 +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
2012-01-23 00:05:17 +00:00
2014-10-07 18:16:44 +00:00
2013-08-01 21:42:05 +00:00