[llvm] [win/arm64] Enable tail call with inreg arguments when possible (PR #134671)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 00:50:15 PDT 2025


zmodem wrote:

> wouldn't this be reproducible with two plain global functions as well?

Yes, but we have to tweak the return type a little to get the `inreg` attribute: https://github.com/llvm/llvm-project/blob/2c1bdd4a0811af89eb9631935fbd90f13a04eacb/clang/lib/CodeGen/MicrosoftCXXABI.cpp#L1185-L1187

```
struct T { ~T(); };
T bar();
T foo() { return bar(); }
```

(MSVC doesn't seem to do the tail call either: https://godbolt.org/z/ofzebfd9P)



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


More information about the llvm-commits mailing list