[all-commits] [llvm/llvm-project] 4d4b7c: [AArch64] Skip storing of stack arguments when low...

Guy David via All-commits all-commits at lists.llvm.org
Fri Jun 6 01:26:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d4b7cc69e3e633aa7c068cca93a3d4beba8615c
      https://github.com/llvm/llvm-project/commit/4d4b7cc69e3e633aa7c068cca93a3d4beba8615c
  Author: Guy David <49722543+guy-david at users.noreply.github.com>
  Date:   2025-06-06 (Fri, 06 Jun 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/Utils.h
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/lib/CodeGen/GlobalISel/Utils.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
    M llvm/test/CodeGen/AArch64/darwinpcs-tail.ll
    M llvm/test/CodeGen/AArch64/scavenge-large-call.ll
    M llvm/test/CodeGen/AArch64/sve-fixed-length-frame-offests-crash.ll
    A llvm/test/CodeGen/AArch64/tail-call-stack-args.ll

  Log Message:
  -----------
  [AArch64] Skip storing of stack arguments when lowering tail calls (#126735)

This issue starts in the selection DAG and causes the backend to emit
the following for a trivial tail call:
```
ldr w8, [sp]
str w8, [sp]
b func
```

I'm not too sure that checking for immutability of a specific stack
object is a good enough of a gurantee, because as soon a tail-call is
done lowering,`setHasTailCall()` is called and in that case perhaps a
pass is allowed to change the value of the object in-memory?

This can be extended to the ARM backend as well.
Removed the `tailcall` keyword from a few other test assets, I'm
assuming their original intent was left intact.



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