Signed/Unsigned Instruction selection.

The sign information for binary operators is available in the llvm IR by the
'nsw' (no signed wrap) flag. Seems there is no use of this flag in the code
generation phase.
The sign information is no more available in the selection DAG.
So how can I generate different instructions for binary operators with
signed/unsigned operands in the assembler (e.g. mul/mulu)?

It actually is, although it’s a relatively recent addition. See BinaryWithFlagsSDNode

The sign information is no more available in the selection DAG.
So how can I generate different instructions for binary operators with
signed/unsigned operands in the assembler (e.g. mul/mulu)?

Instructions where it actually matters (assuming 2s-complement
representation) have different nodes in the DAG. If you look at
include/llvm/CodeGen/ISDOpcodes.h you'll see separate UDIV and SDIV
nodes, for example.

It only usually affects multiplications if you're doing an extend at
the same time (hence the MULHS, SMUL_LOHI and friends) or care about
overflow (hence SMULO/UMULO).

Cheers.

Tim.

Hi Matt, Hi Tim,

Thank you very much for your suggestions.
Arsen