[LLVMdev] RFC: SDNode Flags

David Greene dag at cray.com
Mon Aug 3 09:32:09 PDT 2009


On Sunday 02 August 2009 20:57, Evan Cheng wrote:
> I also want a way to add target specific flag to a SDNode (which
> should be transferred to MachineInstr). For example, on x86 lots of
> opcodes have *lock* variants. Right now, these are separate
> instructions. I'd prefer to make it into a target specific flag that
> can be toggled by some sort of post-isel action routine.

That's a good idea.

> One way to handle this might be to expand the use of SubclassData.
> There are 15 bits to play with and only the bottom 6-7 are in use (if
> I am reading it right). We can also reduce the width of following
> field NodeId (do we need 32-bit for it?) and widen SubclassData.

Yep.  See my response to Dan.  I don't know how many target-specific
flags you need, but we should be able to carve out four more bits from
SubclassData without changing anything else.

> Also, NumOperands and NumValues can be changed to take up fewer bits.
> I don't think we need 16-bits for each.

Probably true.

> So NodeType, OperandsNeedDelete, SubclassData, NodeId, NumOperands,
> and NumValues together are using 96 bits (assuming int is 32-bit and
> short is 16-bit). I think there is opportunity here to re-pack them
> and find quite a few bits for target specific data.

I agree.  If you and Dan agree, I'll take a crack at this.

                                  -Dave




More information about the llvm-dev mailing list