[llvm] [RISCV] fix SP recovery in a function epilogue (PR #110809)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 09:10:00 PDT 2024


dlav-sc wrote:

Oh, I'm sorry, I've compiled your example using the wrong clang, my bad.

Anyway, I've received almost identical snippets:  [with_patch.txt](https://github.com/user-attachments/files/17545048/with_patch.txt), [without_patch.txt](https://github.com/user-attachments/files/17545073/without_patch.txt). In fact, they only differ in the clang commit hash, so you can ensure that the first one was compiled with my patch and the second one without it.

> Could you please include the complete flags you use to build LLVM so that I can reproduce your entire procedure.

```
$ cmake -S llvm -B build -GNinja -DLLVM_ENABLE_PROJECTS='clang' -DCMAKE_BUILD_TYPE=Release
$ cd build
$ cmake --build ./ -t clang
```

> Did you use the flags I included in my reproduction case in your steps 3 & 5?

Yep
```
$ bin/clang -S -O1 -mrvv-vector-bits=512 -march=rv64gcv1p0 --sysroot=<path>/<to>/riscv-gcc/sysroot --gcc-toolchain=<path>/<to>/riscv-gcc --target=riscv64-unknown-linux riscv-varargs-crash.cc -o riscv-varargs-crash.s
```

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


More information about the llvm-commits mailing list