[llvm] r306875 - GlobalISel: add G_IMPLICIT_DEF instruction.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 14:32:54 PDT 2017


On 30 Jun 2017, at 14:09, Quentin Colombet <qcolombet at apple.com> wrote:
> Should we add an actual opcode?
> Put differently are we going to treat G_IMPLICIT_DEF and IMPLICIT_DEF differently?

> I believe this only gets us the isPreISelxxx helper for “free”. But if that’s the only thing, I would argue we can fix isPreISelxxx to be smarter about those. Anyhow, I think it needs to be discussed.

The data structures in the legalization table would have to change too since the array only has enough room for G_* nodes, but that's an implementation detail (I'd gone most of the way through doing that before deciding it was a hack and switching to G_IMPLICIT_DEF).

I think having the instructions that take part in the generic type system tagged is pretty useful. It draws a clear line between what's been selected and what's still under question.

> Note: The reason why I am not fond of this change is because if we start in that direction, I believe we will have to add others like COPY and I want to make sure this is the right design before. Right now, I am not convince.

I'd certainly be open to doing that. COPY's overloaded meaning meant that until just this week quite a few were actually various kinds of cast in disguise.

I don't think that would have happened if we'd had a G_COPY which we'd seriously considered as a GIsel concept from the beginning. 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.

So actually I think the case for doing it to COPY is even more compelling.

Cheers.

Tim.


More information about the llvm-commits mailing list