[PATCH] D141020: [X86][ABI] Clobber %RAX for preserve_allcc and preserve_mostcc CCs

Anton Bikineev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 07:13:24 PST 2023


AntonBikineev added a comment.

> So is it not legal to return value with the CC?

According to the documentation, it is legal. In the current implementation it isn't though.

> If we do not preserve rax, we probably have compatibility issue with pre-built code since it assumes rax is saved by callee.

That's true - the change may break the existing precompiled code.

As I see it, we should either

- have consistency between the implementation and the docs and early diagnose attribute application on non-void functions, or
- allow %rax to be clobbered by the callee.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141020



More information about the llvm-commits mailing list