Use of flags in selection dags

Can someone tell me, or point me to documentation, that explains the use of "flags" in the selection DAG? I figured out that, if one is present, it must be the last operand. But when are "flags" used and why?

thanks,
Bagel

Can someone tell me, or point me to documentation, that explains the use
of "flags" in the selection DAG? I figured out that, if one is
present, it must be the last operand. But when are "flags" used and why?

Please give details of the context, such as the kind of node you are looking at.

Thanks,

Duncan.

Duncan Sands wrote:

Can someone tell me, or point me to documentation, that explains the use of "flags" in the selection DAG? I figured out that, if one is present, it must be the last operand. But when are "flags" used and why?
    
Please give details of the context, such as the kind of node you are looking at.

Thanks,

Duncan.
  

I'm looking at this in general as one would when writing patterns for a new machine. It appears that flags are used in patterns that use or set condition codes. Is this because the condition code register is not modelled or is it more that the dags can't handle two outputs. I just want to know what the rules are on when and how to use "flags".

Thanks,
Bagel

Duncan Sands wrote:

Can someone tell me, or point me to documentation, that explains the use
of "flags" in the selection DAG? I figured out that, if one is
present, it must be the last operand. But when are "flags" used and why?

Please give details of the context, such as the kind of node you are looking at.

Thanks,

Duncan.

I'm looking at this in general as one would when writing patterns for a
new machine. It appears that flags are used in patterns that use or set
condition codes. Is this because the condition code register is not
modelled or is it more that the dags can't handle two outputs. I just
want to know what the rules are on when and how to use "flags".

X86 does model condition register as a "physical register output". But other targets model them as flags. The later restrict scheduling freedom. But if you don't care that much about it, it's easier to get right.

Flags are also used in other cases when you want to ensure the instructions translated from the two selectiondag nodes are scheduled at the same time.

Evan