[PATCH] D143425: Reland "[X86][ABI] Don't preserve return regs for preserve_all/preserve_most CCs""

Anton Bikineev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 02:28:31 PST 2023


AntonBikineev added a comment.

Thanks for the comments!

In D143425#4108663 <https://reviews.llvm.org/D143425#4108663>, @pengfei wrote:

> Add a test case for the previous fail?

I've changed the test functions to take parameters, e.g.

  define preserve_allcc RETTYPE @preserve_allcc1(i64, i64, double, double) 

This covers the broken scenario.



================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:4933
   // from the reg mask.
-  if (CallConv == CallingConv::X86_RegCall || HasNCSR) {
+  if (shouldDisableArgRegFromCSR(CallConv) ||
+      shouldDisableRetRegFromCSR(CallConv) || HasNCSR) {
----------------
goldstein.w.n wrote:
> Do you need `shouldDisableRetRegFromCSR` here? It seems `shouldDisableRetRegFromCSR` is a superset.
Technically it's not needed, but I added it for readability, since we do need to create a separate `RegMask` for `preserve_*` calls.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143425/new/

https://reviews.llvm.org/D143425



More information about the llvm-commits mailing list