Jakob Stoklund Olesen
ded2e3b0d0
LowerSubregsInstructionPass::LowerExtract should not extend the live range of registers.
...
When LowerExtract eliminates an EXTRACT_SUBREG with a kill flag, it moves the
kill flag to the place where the sub-register is killed. This can accidentally
overlap with the use of a sibling sub-register, and we have trouble.
In the test case we have this code:
Live Ins: %R0 %R1 %R2
%R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
%R2H<def> = LOAD16fi <fi#-1>, 0, Mem:LD(2,4) [FixedStack-1 + 0]
%R1L<def> = EXTRACT_SUBREG %R1<kill>, 1
%R0L<def> = EXTRACT_SUBREG %R0<kill>, 1
%R0H<def> = ADD16 %R2H<kill>, %R2L<kill>, %AZ<imp-def>, %AN<imp-def>, %AC0<imp-def>, %V<imp-def>, %VS<imp-def>
subreg: CONVERTING: %R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
subreg: eliminated!
subreg: killed here: %R0H<def> = ADD16 %R2H, %R2L, %R2<imp-use,kill>, %AZ<imp-def>, %AN<imp-def>, %AC0<imp-def>, %V<imp-def>, %VS<imp-def>
The kill flag on %R2 is moved to the last instruction, and the live range overlaps with the definition of %R2H:
*** Bad machine code: Redefining a live physical register ***
- function: f
- basic block: 0x18358c0 (#0 )
- instruction: %R2H<def> = LOAD16fi <fi#-1>, 0, Mem:LD(2,4) [FixedStack-1 + 0]
Register R2H was defined but already live.
The fix is to replace EXTRACT_SUBREG with IMPLICIT_DEF instead of eliminating
it completely:
subreg: CONVERTING: %R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
subreg: replace by: %R2L<def> = IMPLICIT_DEF %R2<kill>
Note that these IMPLICIT_DEF instructions survive to the asm output. It is
necessary to fix the stack-color-with-reg test case because of that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:01:11 +00:00
..
2009-07-09 06:53:48 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-12 00:46:16 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-18 02:10:10 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-14 00:53:58 +00:00
2009-06-04 22:49:04 +00:00
2009-07-08 00:49:35 +00:00
2009-07-30 08:33:02 +00:00
2009-07-16 20:15:00 +00:00
2009-07-09 06:53:48 +00:00
2009-07-09 06:53:48 +00:00
2009-05-16 00:34:42 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-17 18:05:55 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-03 21:13:54 +00:00
2009-07-31 21:57:10 +00:00
2009-05-08 18:23:14 +00:00
2009-05-11 21:54:13 +00:00
2009-05-28 05:10:20 +00:00
2009-05-23 14:06:57 +00:00
2009-05-23 17:29:48 +00:00
2009-05-28 23:52:18 +00:00
2009-05-30 08:43:27 +00:00
2009-06-03 09:00:27 +00:00
2009-08-03 08:12:53 +00:00
2009-08-03 08:12:53 +00:00
2009-06-04 20:53:36 +00:00
2009-06-06 04:17:04 +00:00
2009-06-06 03:57:58 +00:00
2009-06-06 06:32:50 +00:00
2009-06-06 06:05:10 +00:00
2009-06-06 07:08:26 +00:00
2009-06-07 09:44:19 +00:00
2009-06-12 16:26:57 +00:00
2009-06-15 14:43:36 +00:00
2009-06-19 07:00:55 +00:00
2009-07-06 21:34:05 +00:00
2009-07-09 22:01:03 +00:00
2009-07-09 22:01:03 +00:00
2009-07-15 21:39:50 +00:00
2009-07-16 09:20:10 +00:00
2009-07-16 18:44:05 +00:00
2009-07-17 22:42:51 +00:00
2009-07-19 19:09:59 +00:00
2009-07-20 19:47:55 +00:00
2009-07-21 05:40:15 +00:00
2009-08-03 02:45:34 +00:00
2009-07-11 23:17:29 +00:00
2009-07-11 08:30:22 +00:00
2009-07-30 08:33:02 +00:00
2009-05-16 00:34:42 +00:00
2009-05-16 00:34:42 +00:00
2009-07-22 23:26:55 +00:00
2009-05-12 23:58:14 +00:00
2009-06-04 22:49:04 +00:00
2009-05-20 05:45:36 +00:00
2009-07-30 01:56:29 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-18 02:10:10 +00:00
2009-05-08 23:35:49 +00:00
2009-06-02 21:29:13 +00:00
2009-07-20 06:14:25 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-27 01:33:35 +00:00
2009-06-05 21:37:30 +00:00
2009-07-09 00:53:44 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-02 03:14:25 +00:00
2009-07-02 04:22:01 +00:00
2009-06-04 22:49:04 +00:00
2009-08-03 04:03:51 +00:00
2009-06-15 22:49:34 +00:00
2009-05-13 22:29:12 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-03 21:13:54 +00:00
2009-07-28 17:57:51 +00:00
2009-08-04 16:27:13 +00:00
2009-05-29 01:44:43 +00:00
2009-06-04 22:49:04 +00:00
2009-06-21 12:02:51 +00:00
2009-06-29 20:29:59 +00:00
2009-06-30 16:40:03 +00:00
2009-06-30 16:40:03 +00:00
2009-06-04 22:49:04 +00:00
2009-06-26 22:00:19 +00:00
2009-06-04 22:49:04 +00:00
2009-07-17 22:13:25 +00:00
2009-07-16 22:34:45 +00:00
2009-06-04 22:49:04 +00:00
2009-07-18 04:52:23 +00:00
2009-07-20 17:43:30 +00:00
2009-05-11 18:49:56 +00:00
2009-07-22 22:02:42 +00:00
2009-07-14 19:49:11 +00:00
2009-05-11 22:33:01 +00:00
2009-05-11 22:33:01 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-08-03 04:03:51 +00:00
2009-08-03 05:21:05 +00:00
2009-06-04 22:49:04 +00:00
2009-05-28 00:35:15 +00:00
2009-05-28 00:35:15 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-19 23:23:27 +00:00
2009-06-19 23:23:27 +00:00
2009-06-19 23:23:27 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-25 21:48:17 +00:00
2009-06-24 19:48:04 +00:00
2009-07-09 01:07:22 +00:00
2009-06-26 22:16:49 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-24 01:18:18 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-14 18:17:16 +00:00
2009-08-01 22:25:12 +00:00
2009-06-04 22:05:33 +00:00
2009-06-27 04:38:55 +00:00
2009-05-11 22:33:01 +00:00
2009-07-11 23:48:59 +00:00
2009-05-11 18:30:42 +00:00
2009-06-26 22:54:11 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-29 00:51:15 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-05-12 18:31:57 +00:00
2009-08-04 20:01:11 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-21 00:22:59 +00:00
2009-05-12 02:17:14 +00:00
2009-06-12 16:26:57 +00:00
2009-07-31 21:57:10 +00:00
2009-06-20 19:43:09 +00:00
2009-07-31 21:57:10 +00:00
2009-07-31 21:57:10 +00:00
2009-06-27 04:16:01 +00:00
2009-07-31 21:57:10 +00:00
2009-06-04 22:49:04 +00:00
2009-06-16 06:58:29 +00:00
2009-07-08 18:51:25 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-07 06:52:44 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-07 06:52:44 +00:00
2009-06-07 06:52:44 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-07-08 00:49:35 +00:00
2009-06-04 22:49:04 +00:00
2009-05-23 13:15:11 +00:00
2009-06-04 22:49:04 +00:00
2009-06-04 22:49:04 +00:00
2009-06-27 04:07:31 +00:00
2009-06-27 04:07:31 +00:00
2009-06-27 04:07:31 +00:00
2009-08-01 19:11:04 +00:00
2009-07-18 02:10:10 +00:00
2009-06-03 00:37:20 +00:00
2009-07-08 18:48:24 +00:00