Commit 3bbf1da
authored
[HAL] Renumber export ordinals after pruning (#24162)
Backend serializers index the flatbuffer `exports` vector by ordinal and
assume a dense [0, N) range. When PruneExecutablesPass removed unused
exports it left ordinals sparse (e.g. [0, 2, 3, 4] with 1 pruned),
causing the serializer to write past the end of its vector and produce
invalid flatbuffers. This showed up as flatcc verification failures at
runtime for models with unused `hal.executable.source` exports.
Renumbering to a dense [0, N) range here restores the invariant for all
backends without touching any serializer or runtime code.
Signed-off-by: Jorn Tuyls <jorn.tuyls@gmail.com>1 parent 63b9cce commit 3bbf1da
2 files changed
Lines changed: 49 additions & 0 deletions
File tree
- compiler/src/iree/compiler/Dialect/HAL/Transforms
- test
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
177 | 194 | | |
178 | 195 | | |
179 | 196 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments