[PATCH] D82765: GlobalISel: Disallow undef generic virtual register uses

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 17:13:23 PDT 2020


dsanders added a comment.

In D82765#2121196 <https://reviews.llvm.org/D82765#2121196>, @arsenm wrote:

> In D82765#2121181 <https://reviews.llvm.org/D82765#2121181>, @aprantl wrote:
>
> > My MIR is lacking here: What does it mean for a USE to be UNDEF? DBG_VALUE accepts UNDEF as an operand, but it's not clear to me what an undef vreg means / how it can be created.
>
>
> You can set the undef flag on the MachineOperand.
>
> ProcessImplicitDefs turns
>
>   %0 = IMPLICIT_DEF
>   FOO %0
>   
>   
>
> into
>
>   FOO undef %0
>  
>
>
> You can also hand write this, but I don't think any pass before ProcessImplicitDefs and co should be using these


Ah ok. This isn't quite what I thought it was when I quickly looked through earlier. The case I was worried about was when DBG_VALUE loses track of a variable and uses $noreg to indicate the register+value is undefined. Whereas this patch is concerned with a known vreg whose contents is undefined and lacks a defining instruction saying that.


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

https://reviews.llvm.org/D82765





More information about the llvm-commits mailing list