[PATCH] D132073: [CodeGen] Zero out only modified registers

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 15:02:32 PDT 2022


void added a comment.

In D132073#3765192 <https://reviews.llvm.org/D132073#3765192>, @nickdesaulniers wrote:

> In D132073#3764848 <https://reviews.llvm.org/D132073#3764848>, @void wrote:
>
>> In D132073#3764772 <https://reviews.llvm.org/D132073#3764772>, @efriedma wrote:
>>
>>> What am I looking for?  I still don't see anything obviously wrong.
>>
>> We shouldn't be zeroing out non-volatile registers that aren't modified by the function. In this case, we shouldn't be zeroing `%rdi`. Note that `%rsi` is marked as "modified" by the asm statements.
>
> `rsi` and `rdi` are not in any of the clobber lists...or is that what registers are being allocated for the inline asm inputs/outputs? Perhaps a MIR test would make that more obvious? Or an explicit clobber in these test cases?

Right, they aren't. Perhaps I should just write a testcase that uses inline asm and a clobber list instead of trying to scrape together something from the Linux sources.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132073



More information about the llvm-commits mailing list