Commit 9d13fc0
authored
[S-TIR] Fix Segfault when applying Parallel during TIR schedule rewriting (#19403)
Hi Commiters,
This PR is trying to fix issues
#18424. Any suggestions would be
appreciated if you are available.
### Root Cause
Unsafe dynamic-shape dereferences in `AdjustParallelVectorize` The code
assumed IntImm for buffer shape / loop extent and dereferenced directly.
With dynamic shapes, as<IntImmNode>() can be null, which can segfault
before any try/catch handles it.
### Solution
Replaced unsafe `IntImm` assumptions with null checks and
GetLoopIntExtent(...); if contiguous analysis is not possible,
conservatively disables that path instead of dereferencing null.
---------
Co-authored-by: cchung100m <cchung100m@users.noreply.github.com>1 parent b343943 commit 9d13fc0
2 files changed
Lines changed: 43 additions & 4 deletions
File tree
- src/s_tir/meta_schedule/postproc
- tests/python/s_tir/meta_schedule
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| |||
246 | 259 | | |
247 | 260 | | |
248 | 261 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
252 | 267 | | |
253 | 268 | | |
254 | 269 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
| |||
269 | 287 | | |
270 | 288 | | |
271 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
272 | 296 | | |
273 | 297 | | |
0 commit comments