[llvm] [RISCV] Use vsetvli instead of vlenb in Prologue/Epilogue (PR #113756)
Camel Coder via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 04:27:21 PDT 2024
camel-cdr wrote:
clang and gcc using `csrr vlebn` for prolog/epilog code was an amazing unintended feature (Hyrum's Law).
Searching the generated assembly for the string "vlenb" is currently the easiest way to identify register spills when compiling intrinsics.
You could do that in a big codebases and have minimal false positives.
I understand that we should try to get the best codegen, and there will be implementations where csrr is slower than vsetvli.
Although one thing to consider is that ooo implementations will need to predict vtype/vl, and this may fill up the predictors quicker.
https://github.com/llvm/llvm-project/pull/113756
More information about the llvm-commits
mailing list