Keith Randall
3f04db41a8
cmd/compile: fix sign-extension merging rules
...
If we have
y = <int16> (MOVBQSX x)
z = <int32> (MOVWQSX y)
We used to use this rewrite rule:
(MOVWQSX x:(MOVBQSX _)) -> x
But that resulted in replacing z with a value whose type
is only int16. Then if z is spilled and restored, it gets
zero extended instead of sign extended.
Instead use the rule
(MOVWQSX (MOVBQSX x)) -> (MOVBQSX x)
The result is has the correct type, so it can be spilled
and restored correctly. It might mean that a few more extension
ops might not be eliminated, but that's the price for correctness.
Fixes #21963
Change-Id: I6ec82c3d2dbe43cc1fee6fb2bd6b3a72fca3af00
Reviewed-on: https://go-review.googlesource.com/65290
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-26 16:24:08 +00:00
..
2017-01-20 05:55:53 +00:00
2017-03-22 03:23:16 +00:00
2017-09-15 02:39:16 +00:00
2016-05-02 13:43:18 +00:00
2013-01-11 22:00:48 +01:00
2017-09-26 16:24:08 +00:00
2016-05-02 13:43:18 +00:00
2015-10-07 14:37:44 +00:00
2017-04-24 12:37:49 +00:00
2017-03-16 02:44:16 +00:00
2016-04-03 17:03:15 +00:00
2017-02-08 20:59:45 +00:00
2014-01-07 13:26:48 +01:00
2013-01-11 22:05:46 +01:00
2016-05-02 13:43:18 +00:00
2017-02-24 18:54:36 +00:00
2016-07-06 20:48:41 +00:00
2013-01-30 20:21:08 +01:00
2016-04-24 21:36:52 +00:00
2016-05-02 13:43:18 +00:00
2017-01-25 08:04:17 +00:00
2017-01-20 05:55:53 +00:00
2016-05-02 13:43:18 +00:00
2017-04-24 12:37:49 +00:00
2012-11-08 09:04:27 -08:00
2017-05-11 13:53:54 +00:00
2014-10-06 17:16:39 -04:00
2016-03-17 04:20:02 +00:00
2013-02-12 13:17:49 -05:00
2012-05-24 22:41:07 -04:00
2015-12-02 18:26:38 +00:00
2013-10-08 14:36:20 -04:00
2012-09-10 13:03:07 -07:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-08-15 05:54:24 +00:00
2014-12-08 22:18:17 +00:00
2017-05-18 00:05:25 +00:00
2014-10-31 11:08:27 -04:00
2015-01-29 13:07:30 +00:00
2015-02-03 15:48:48 +00:00
2012-07-01 21:59:50 +04:00
2014-01-31 00:30:56 +01:00
2015-06-26 03:38:21 +00:00
2017-04-24 12:37:49 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2013-12-12 17:18:12 -08:00
2012-09-28 08:30:30 -07:00
2015-07-11 14:36:33 +00:00
2015-07-11 14:36:33 +00:00
2016-05-02 13:43:18 +00:00
2016-09-17 01:12:24 +00:00
2016-05-02 13:43:18 +00:00
2016-10-04 17:10:47 +00:00
2015-05-07 23:54:28 +00:00
2012-07-03 09:09:05 +10:00
2017-04-24 12:37:49 +00:00
2013-02-12 13:17:49 -05:00
2012-04-20 23:45:43 +08:00
2017-08-11 17:41:17 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2012-10-07 21:52:57 +02:00
2013-02-12 13:17:49 -05:00
2014-01-24 22:35:11 +04:00
2016-05-02 13:43:18 +00:00
2017-03-14 18:49:23 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-06-28 22:09:00 +00:00
2017-08-11 00:56:21 +00:00
2017-08-11 00:56:21 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-03-24 17:14:00 +00:00
2016-05-02 13:43:18 +00:00
2016-10-26 18:46:59 +00:00
2016-05-02 13:43:18 +00:00
2017-02-15 01:33:03 +00:00
2016-05-02 13:43:18 +00:00
2016-10-10 12:09:16 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2014-12-08 22:22:58 +00:00
2015-11-03 18:57:18 +00:00
2016-09-14 16:39:47 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2013-02-12 13:17:49 -05:00
2013-03-15 15:24:13 -04:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-04-19 02:27:58 +00:00
2015-11-12 18:32:13 +00:00
2013-12-12 19:02:11 -08:00
2016-05-02 13:43:18 +00:00
2012-10-07 23:22:01 +02:00
2017-03-24 20:07:15 +00:00
2017-02-10 01:22:30 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-03-06 23:48:37 +00:00
2017-04-24 12:37:49 +00:00
2015-09-05 02:25:01 +00:00
2017-04-18 19:56:30 +00:00
2017-03-29 17:27:38 +00:00
2017-03-03 21:29:32 +00:00
2016-11-30 19:46:00 +00:00
2016-05-02 13:43:18 +00:00
2016-09-12 19:26:31 +00:00
2016-09-19 19:03:01 +00:00
2017-04-12 14:27:45 +00:00
2016-05-02 13:43:18 +00:00
2015-12-17 23:36:13 +00:00
2016-05-02 13:43:18 +00:00
2017-02-08 20:59:45 +00:00
2016-05-09 17:31:45 +00:00
2016-04-20 17:37:35 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2016-05-02 13:43:18 +00:00
2017-08-24 16:53:56 +00:00
2016-10-31 19:38:50 +00:00
2017-08-24 16:53:56 +00:00
2017-04-05 18:46:31 +00:00
2017-06-21 22:07:33 +00:00
2017-08-15 05:54:24 +00:00
2017-08-22 20:28:21 +00:00
2017-04-24 12:37:49 +00:00
2017-04-24 12:37:49 +00:00
2014-08-06 17:02:55 -04:00
2014-10-27 18:59:02 -04:00
2017-09-03 14:29:38 +00:00
2016-03-17 00:38:15 +00:00
2016-10-18 05:32:37 +00:00
2012-10-07 23:22:01 +02:00
2016-05-02 13:43:18 +00:00
2013-02-11 18:20:52 -05:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-08-25 03:26:58 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-07-17 16:36:49 +00:00
2016-10-15 17:58:14 +00:00
2017-02-01 22:52:32 +00:00
2016-10-15 17:58:11 +00:00
2016-10-25 22:28:40 +00:00
2017-01-09 21:01:29 +00:00
2016-09-13 20:06:13 +00:00
2017-09-26 04:08:38 +00:00
2017-09-26 04:08:38 +00:00
2017-04-07 15:40:25 +00:00
2017-09-12 05:50:54 +00:00
2017-07-26 23:37:25 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 22:07:02 +00:00
2017-08-22 13:44:35 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-02-11 21:46:21 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-06-15 03:51:03 +00:00
2016-05-02 13:43:18 +00:00
2017-03-01 01:06:32 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2014-01-29 09:28:23 +01:00
2015-05-21 17:32:17 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-10-27 20:22:49 +00:00
2016-03-30 22:27:13 +00:00
2013-12-12 17:17:02 -08:00
2012-08-08 14:01:23 -07:00
2016-05-02 13:43:18 +00:00
2016-08-19 01:10:21 +00:00
2012-08-03 21:47:26 +02:00
2013-03-15 00:35:09 -04:00
2017-05-19 18:11:51 +00:00
2017-02-02 17:36:43 +00:00
2017-05-19 18:11:51 +00:00
2013-03-15 00:35:09 -04:00
2015-11-03 18:57:18 +00:00
2014-07-01 09:20:51 +02:00
2014-01-03 21:03:20 +01:00
2015-09-06 23:50:51 +00:00
2017-02-10 01:22:30 +00:00
2017-03-25 22:52:54 +00:00
2016-10-31 19:38:50 +00:00
2016-07-06 20:48:41 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-05-11 18:28:40 +00:00
2016-12-23 17:35:24 +00:00