Instead of performing the isMoreProfitable() operation on
InstructionCost::CostTy the operation is performed on InstructionCost
directly, so that it can handle the case where one of the costs is
Invalid.
This patch also changes the CostTy to be int64_t, so that the type is
wide enough to deal with multiplications with e.g. unsigned MaxTripCount.
These still use unsigned. Are we happy to assume that getRegUsageForType / getTypeLegalizationCost will always produce a small, sensible value?