The following patch improves integer division sw expansion.
Namely - the case of division by a constant, which would be expanded to a simple multiplication by a magic number rather than a full division loop.
Implementation follows the DAG code in TargetLowering::BuildSDIV().
Ref: "Hacker's Delight" or "The PowerPC Compiler Writer's Guide”.
Please review.
Dmitri