[llvm] [RISCV][MRI] Account for fixed registers when determining callee saved regs (PR #115756)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 14:02:57 PST 2024


michaelmaitland wrote:

> > LLVM + this patch:
> > ```
> >         addi    sp, sp, -16
> >         sd      s0, 8(sp)                       # 8-byte Folded Spill
> >         sd      s1, 0(sp)                       # 8-byte Folded Spill
> >         li      s0, 321
> >         li      a0, 0
> >         ld      s0, 8(sp)                       # 8-byte Folded Reload
> >         ld      s1, 0(sp)                       # 8-byte Folded Reload
> >         addi    sp, sp, 16
> >         ret
> > ```
> 
> Shouldn't this patch prevent the save/restore of s0?

Sorry, I collected this experiment without this patch (I had built another branch and forgot). I have updated the test cases now with the correct code. And I addressed @jrtc27 concern of using x8.

https://github.com/llvm/llvm-project/pull/115756


More information about the llvm-commits mailing list