[all-commits] [llvm/llvm-project] 8a9c17: [RISCV] Align stack size down to a multiple of 16 ...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Mar 26 21:37:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a9c1701704182d551bf9df1ff43363db56caab4
      https://github.com/llvm/llvm-project/commit/8a9c1701704182d551bf9df1ff43363db56caab4
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/test/CodeGen/RISCV/zcmp-additional-stack.ll

  Log Message:
  -----------
  [RISCV] Align stack size down to a multiple of 16 before using cm.push/pop. (#86073)

This an alternative to #84935 to fix the miscompile, but not be optimal.

The immediate for cm.push/pop must be a multiple of 16. For RVE, it
might not be. It's not easy to increase the stack size without messing
up cfa directives and maybe other things.

This patch rounds the stack size down to a multiple of 16 before
clamping it to 48. This causes an extra addi to be emitted to handle the
remainder.

Once this commited, I can commit #84989 to add verification for these
instructions being generated with valid offsets.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list