Commit e9ad10e
Fix copying initialized members in EmitInsertValueToStruct
Description:
The function getAllDefinedMembers has a bug - it will not return any indices if the insertvalue instruction uses a constant struct instead of undef as a starting point.
For example:
%29 = insertvalue %__StructSOALayout_ <{ i32 194816, i32 undef, i32 undef, <1 x float> undef }>, i32 %18, 1 ; visa id: 45
%30 = insertvalue %__StructSOALayout_ %29, i32 0, 2 ; visa id: 47
In this case, when emitting instructions for %30, we should see that the indices 0 and 1 are initialized (with i32 194816 and i32 %18).
However, we don't and we end up losing those values.
The fix makes getAllDefinedMembers return all initialized indices by recursively traversing the constant struct (recursively in case the struct has structs inside it)1 parent c344e49 commit e9ad10e
File tree
3 files changed
+37
-10
lines changed- IGC/Compiler/CISACodeGen
3 files changed
+37
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2961 | 2961 | | |
2962 | 2962 | | |
2963 | 2963 | | |
2964 | | - | |
| 2964 | + | |
2965 | 2965 | | |
2966 | 2966 | | |
2967 | 2967 | | |
| |||
3128 | 3128 | | |
3129 | 3129 | | |
3130 | 3130 | | |
3131 | | - | |
| 3131 | + | |
3132 | 3132 | | |
3133 | 3133 | | |
3134 | 3134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5234 | 5234 | | |
5235 | 5235 | | |
5236 | 5236 | | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
5237 | 5259 | | |
5238 | | - | |
| 5260 | + | |
5239 | 5261 | | |
5240 | 5262 | | |
5241 | 5263 | | |
5242 | 5264 | | |
5243 | 5265 | | |
5244 | 5266 | | |
5245 | | - | |
| 5267 | + | |
5246 | 5268 | | |
5247 | 5269 | | |
5248 | | - | |
| 5270 | + | |
| 5271 | + | |
| 5272 | + | |
| 5273 | + | |
| 5274 | + | |
5249 | 5275 | | |
5250 | | - | |
5251 | | - | |
5252 | | - | |
5253 | | - | |
| 5276 | + | |
| 5277 | + | |
5254 | 5278 | | |
| 5279 | + | |
| 5280 | + | |
| 5281 | + | |
5255 | 5282 | | |
5256 | 5283 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
0 commit comments