[LLVMdev] RFC: SDNode Flags

David Greene dag at cray.com
Fri Jul 31 11:26:38 PDT 2009


Right now the MemSDNode keeps a volatile bit in the SubclassData to mark
volatile memory operations.

We have some changes we'd like to push back that adds a NonTemporal flag
to MemSDNode to mark instructions where movnt (on x86) and other goodness
can happen (we'll also add the TableGen patterns to properly select movnt).

In our tree we simply added another flag to the MemSDNode constructor
and embedded it in SubclassData:

 MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, MVT MemoryVT,
            const Value *srcValue, int SVOff,
            unsigned alignment, bool isvolatile, bool NonTemporal);

This is ugly for a variety of reasons and also doesn't scale as we
want to add more of this kind of information.

So what if we replace Volatile/NonTemporal with a single bitvector?
There's not a lot of room in SubclassData (it also holds alignment 
information) so maybe this should be another member on MemSDNode.
That will increase the size of MemSDNode, so we need to consider
that.

The constructor could look something like this:

 MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, MVT MemoryVT,
            const Value *srcValue, int SVOff,
            unsigned alignment, unsigned flags);

and called like this:

new (N) LoadSDNode(..., isVolatile|isNonTemporal);

Thoughts?

                                    -Dave



More information about the llvm-dev mailing list