IR: fix chunk reachability: via unchopped chunk label directly so that they don't get removed

This commit is contained in:
Irmen de Jong
2024-02-21 23:10:04 +01:00
parent 325f55f22d
commit b5e691f367
4 changed files with 138 additions and 43 deletions
@@ -168,7 +168,7 @@ class IRUnusedCodeRemover(
it.instructions.forEach { instr ->
if (instr.branchTarget == null)
instr.labelSymbol?.let { label ->
val chunk = allLabeledChunks[label.substringBeforeLast('.')]
val chunk = allLabeledChunks[label] ?: allLabeledChunks[label.substringBeforeLast('.')]
if(chunk!=null)
new+=chunk
else