[llvm-commits] [llvm] r59760 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Duncan Sands baldrick at free.fr
Fri Nov 21 00:46:55 PST 2008


Hi Chris,

> They aren't the same.  ADDC returns a value + flag.  SADDO returns a  
> value + bool.  The use of the bool may very well be a store to memory  
> or something like that.  You can't flag these together.

at the level of legalization, should flags really be used at all?
If ADDC produced a value and a boolean, couldn't that boolean me
magically turned into use of the carry flag later?

Another possiblity is to have "flag to bool" and maybe "bool to flag"
methods that returns a boolean result depending on whether the flag
is set or not.

I don't much like the idea of introducing a new node that is almost
but not quite exactly the same as an existing node.  Surely there is
a more generic solution for the flags vs bool problem.

> OTOH, I think it would be perfectly fine for X86 to custom legalize  
> SADDO into ADDC + an X86ISD::SETO node or something.

This sounds exactly like ADDC + "flag to bool"...

Ciao,

Duncan.



More information about the llvm-commits mailing list