Commit edd6d63
authored
JIT: Fix liveness for partial defs of parent locals (#85654)
Partial defs in liveness are modelled as full uses of all fields and
then a full def of the entire local. The logic that handled fields
directly got that right, but the logic that handled parent locals did
not.
For example, for IR like
```
------------ BB18 [045..046), preds={BB16} succs={BB19}
***** BB18
STMT00096 ( INL10 @ 0x01F[E-] ... ??? ) <- INL04 @ ??? <- INLRT @ 0x045[E-]
N003 ( 5, 4) [000403] -A------R-- ▌ ASG byref
N002 ( 3, 2) [000402] D------N--- ├──▌ LCL_VAR byref V73 tmp45
N001 ( 1, 1) [000401] ----------- └──▌ LCL_VAR long V43 tmp15
***** BB18
STMT00097 ( INL10 @ 0x026[E-] ... ??? ) <- INL04 @ ??? <- INLRT @ 0x045[E-]
N003 ( 5, 4) [000407] -A------R-- ▌ ASG int
N002 ( 3, 2) [000406] D------N--- ├──▌ LCL_VAR int V74 tmp46
N001 ( 1, 1) [000405] ----------- └──▌ LCL_VAR int V42 tmp14
***** BB18
STMT00072 ( INL04 @ 0x073[--] ... ??? ) <- INLRT @ 0x045[E-]
N007 ( 14, 14) [000627] -A--------- ▌ COMMA void
N003 ( 7, 7) [000623] -A------R-- ├──▌ ASG byref
N002 ( 3, 4) [000621] U------N--- │ ├──▌ LCL_FLD byref (P) V12 loc3 [+16]
│ ├──▌ ref field V12._managedArray (fldOffset=0x0) -> V57 tmp29
│ ├──▌ long field V12._allocatedMemory (fldOffset=0x8) -> V58 tmp30
│ ├──▌ byref field V12._reference (fldOffset=0x10) -> V59 tmp31
│ ├──▌ int field V12._length (fldOffset=0x18) -> V60 tmp32
N001 ( 3, 2) [000622] ----------- │ └──▌ LCL_VAR byref V73 tmp45
N006 ( 7, 7) [000626] -A------R-- └──▌ ASG int
N005 ( 3, 4) [000624] U------N--- ├──▌ LCL_FLD int (P) V12 loc3 [+24]
├──▌ ref field V12._managedArray (fldOffset=0x0) -> V57 tmp29
├──▌ long field V12._allocatedMemory (fldOffset=0x8) -> V58 tmp30
├──▌ byref field V12._reference (fldOffset=0x10) -> V59 tmp31
├──▌ int field V12._length (fldOffset=0x18) -> V60 tmp32
N004 ( 3, 2) [000625] ----------- └──▌ LCL_VAR int V74 tmp46
```
we would see
```
BB18 USE(6)={V58 V57 V59 V60 V42 V43 }
DEF(2)={ V73 V74}
```
which is obviously incorrect as V57-V60 are all defined under this
model. This would lead to an assert in SSA since SSA did treat this as a
def.1 parent fc22ee9 commit edd6d63
1 file changed
+12
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | 96 | | |
99 | 97 | | |
100 | | - | |
101 | | - | |
| 98 | + | |
102 | 99 | | |
103 | | - | |
104 | | - | |
| 100 | + | |
105 | 101 | | |
106 | | - | |
107 | 102 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
118 | 113 | | |
119 | 114 | | |
120 | 115 | | |
| |||
0 commit comments