[PATCH] D86260: [CodeGen] Postprocess PHI nodes for callbr

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 18:19:30 PDT 2020


void added a comment.

In D86260#2229449 <https://reviews.llvm.org/D86260#2229449>, @jyknight wrote:

> In D86260#2229406 <https://reviews.llvm.org/D86260#2229406>, @void wrote:
>
>> In D86260#2229387 <https://reviews.llvm.org/D86260#2229387>, @jyknight wrote:
>>
>>> The commit message is confusing for this -- this isn't a correctness fix, but a minor optimization, right?
>>
>> I'm not convinced it's just an optimization, but I could be swayed. It seems to me that the value coming into the PHI shouldn't rely upon the semantics of the asm block. So for instance would this be incorrect?
>
> Inline assembly must declare what registers it clobbers, and the compiler can safely assume other registers are preserved across it.
>
>>   bb1:
>>     %eax = MOV 0
>>     INLINEASM_BR "mov 37, %eax"
>>     JMP return
>>   
>>   return:
>>     PHI bb1, 0 ...
>
> So, in this example the input inline-asm is invalid, because it failed to declare that it clobbered eax.

Ah! That's right. I forgot about the clobber list. I'll change the description.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86260



More information about the llvm-commits mailing list