aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-01-06 23:12:55 +0700
committerGitHub <noreply@github.com>2025-01-06 23:12:55 +0700
commit93220e7e06473a11bf48fee26bcea16cc527e5dc (patch)
tree3990f404a6dd4c541f8bab2a280e16086fd4ed37 /clang/lib/Frontend/CompilerInvocation.cpp
parent10fb5d2b4be54c779eda80b65a737b9dae2d959b (diff)
downloadllvm-93220e7e06473a11bf48fee26bcea16cc527e5dc.zip
llvm-93220e7e06473a11bf48fee26bcea16cc527e5dc.tar.gz
llvm-93220e7e06473a11bf48fee26bcea16cc527e5dc.tar.bz2
RegAllocGreedy: Fix use after free during last chance recoloring (#120697)
Last chance recoloring can delete the current fixed interval during recursive assignment of interfering live intervals. Check if the virtual register value was assigned before attempting the unassignment, as is done in other scenarios. This relies on the fact that we do not recycle virtual register numbers. I have only seen this occur in error situations where the allocation will fail, but I think this can theoretically happen in working allocations. This feels very brute force, but I've spent over a week debugging this and this is what works without any lit regressions. The surprising piece to me was that unspillable live ranges may be spilled, and a number of tests rely on optimizations occurring on them. My other attempts to fixed this mostly revolved around not identifying unspillable live ranges as snippet copies. I've also discovered we're making some unproductive live range splits with subranges. If we avoid such splits, some of the unspillable copies disappear but mandating that be precise to fix a use after free doesn't sound right.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions