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

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 12:17:22 PDT 2022


void added a comment.

In D132073#3764772 <https://reviews.llvm.org/D132073#3764772>, @efriedma wrote:

> In D132073#3764706 <https://reviews.llvm.org/D132073#3764706>, @void wrote:
>
>> In D132073#3759740 <https://reviews.llvm.org/D132073#3759740>, @efriedma wrote:
>>
>>> Can you give an example of a function that is miscompiled without your patch, and is not miscompiled with you patch?  I don't see anything obviously wrong with the way we're compiling the given testcases without the patch.
>>
>> I believe I have it now. I had to find the issue again... PTAL
>
> 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.


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