[llvm] [RISCV] Separate doLocalPostpass into new pass and move to post vector regalloc (PR #88295)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 01:41:55 PDT 2024
lukel97 wrote:
> Dbg value will be emited during the register allocation pass. If we insert the other pass between register allocation stage, then the LiveDebugVariables will raise the assertion when destruct without emit Dbg value.
>
> ```
> void {anonymous}::LDVImpl::clear(): Assertion `(!ModifiedMF || EmitDone) && "Dbg values are not emitted in LDV"' failed.
> ```
>
> For example:
>
> ```
> llc ./llvm-project/llvm/test/DebugInfo/fixed-point.ll -mtriple=riscv64 -o -
> ```
>
> with this patch.
>
> A workaround is `addPreserved<LiveDebugVariables>`, and it was also #70549 did. However, to make LiveDebugVariables visible outside of lib/codegen, LLVM needs to ensure its visibility.
Thanks, that makes sense. I was curious as to how AMDGPU handled this since it also splits regalloc and inserts a pass in between, but it looks like said pass is marked as `AU.setPreservesAll()`. I'm not sure if that's accurate though
https://github.com/llvm/llvm-project/blob/f7bf11cd8db29a178463f2a12b9f1589ecab64e2/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp#L60
https://github.com/llvm/llvm-project/pull/88295
More information about the llvm-commits
mailing list