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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 15:16:38 PDT 2022


efriedma added a comment.

In D132073#3765379 <https://reviews.llvm.org/D132073#3765379>, @void wrote:

> In D132073#3765159 <https://reviews.llvm.org/D132073#3765159>, @efriedma wrote:
>
>>> we shouldn't be zeroing %rdi
>>
>> I don't see how it's a problem if we zero rdi.  Even if we don't modify rdi, the caller doesn't have any way of knowing it wasn't modified.  The calling convention says it's caller-save.
>
> This is just a test case. It's not meant to be definitive of the original bug. Just show the same symptoms.

The thing is, I don't see the connection between this "symptom" and any possible bug.  rdi is callee-clobbered, and the caller has no way of knowing whether the implementation actually writes to rdi, therefore it can't be a bug to add a write to rdi.


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