This avoids recomputing it between regalloc runs.
Diff Detail
Diff Detail
Event Timeline
| lib/CodeGen/VirtRegMap.cpp | ||
|---|---|---|
| 274 | DebugVars may be nullptr IIRC what getAnalysisIfAvailable API does. Make sure to test for it. | |
| llvm/lib/CodeGen/VirtRegMap.cpp | ||
|---|---|---|
| 273 ↗ | (On Diff #313459) | I think we should push the test on DebugVars before this block.
I.e., if (DebugVars)
DebugVars->emitDebugValues(VRM).
if (ClearVirtRegs) {
VRM->clearAllVirt();
MRI->clearAllVirt();
} |
| llvm/lib/CodeGen/VirtRegMap.cpp | ||
|---|---|---|
| 273 ↗ | (On Diff #313459) |
Looks like it would be okay, since you had: if (!ClearVirtRegs) AU.addPreserved<LiveDebugVariables>(); Still, it is okay to assume ClearVirtRegs will be set eventually. E.g., what happens for WebAssembly? |
| llvm/lib/CodeGen/VirtRegMap.cpp | ||
|---|---|---|
| 273 ↗ | (On Diff #313459) | I think this was to avoid double-emitting the debug values, since this will be run twice |
| llvm/lib/CodeGen/VirtRegMap.cpp | ||
|---|---|---|
| 273 ↗ | (On Diff #313459) | Without this, the debug values end up getting emitted twice. It doesn't matter for webassembly since the allocator passes are never run |
DebugVars may be nullptr IIRC what getAnalysisIfAvailable API does.
Make sure to test for it.