[llvm] r306875 - GlobalISel: add G_IMPLICIT_DEF instruction.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 15:43:12 PDT 2017


> 
>> In fact I think it would have been enforced by the MachineVerifier.
>> 
>> Also, while an IMPLICIT_DEF basically disappears, a COPY eventually becomes a real instruction. Or in case of a G_COPY potentially lots of instructions.
> 
> That all sound like implementation details of the legalizer.

I don't think enforcing type-consistency is an implementation detail, or confined to the legalizer. The other is resolved by the legalizer[*] but a question relevant in any stage before that too.

> In particular, should G_COPY returns true to MachineInstr::isCopy, ditto for G_IMPLICIT_DEF with MachineInstr::isImplicitDef?

I'm not sure it matters until we start dealing with combines properly. And even then G_* is going to be entirely contained in GISel code so we can pick whichever is more convenient for us at the time.

> When do we use G_PHI vs PHI (e.g., in the MachineIRBuilder interface)?

I'd make MachineIRBuilder always emit the G_* instructions because its designed to be the generic MIR builder in all other cases. This makes its behaviour more consistent again.

Cheers.

Tim.

[*] Though even then maybe only because we're being a bit naive right now. When 512-bit types are flying around more regularly because QQQQ is a valid type for stores RegBankSelect and ISel might end up getting in on the fun too.


More information about the llvm-commits mailing list