[LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Dec 6 00:50:53 PST 2012

On 5 Dec 2012, at 18:34, Owen Anderson wrote:

> On Dec 5, 2012, at 4:51 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
>> On 3 Dec 2012, at 23:45, Chris Lattner wrote:
>>> Please do.  MVT is cheaper than EVT and conceptually cleaner when dealing with physical machine types.  EVT should only be used in parts of the code generator that are "pre-legalization" because they can represent arbitrary IR types.  Anything that takes a legal machine type should take an MVT.
>> A side issue of this is that it is currently relatively hard to add new machine-specific register types.  The only way of doing this involves extending MVT, which requires tweaking three files in the (nominally) target-independent parts of the compiler.  It would be great if we could simply reserve a (small?) number of MVTs for target-specific legal values.
> I added MVT::Untyped a while back to address this kind of use case.  You can construct node of MVT::Untyped, and as long as the InstrEmitter can infer what register class they can map to from their uses, everything should just work.  Of course, it's only been seriously tested with register sequence (REG_SEQUENCE) nodes.

Thanks.  Does this work with, for example, values that must be of a pointer type in the selection DAG?  That's currently the issue that I'm hitting: I have a few ugly hacks to disable that test on some intrinsic nodes, but I don't want to have to disable it on all of them.


More information about the llvm-dev mailing list