This is a second stab at fixing PR31257 (the previous one was D29511). The patch is intended to be applied on top of a revert of r294348.
The idea is to mark registers which are live before the call, but potentially clobbered by it, as imp-used and imp-defined, as a way of keeping them alive. In reality, the registers are not clobbered unless the call is made, in which case it doesn't matter as control leaves the function.
This is the same technique that's used when creating predicated variants of instructions in IfConverter::CopyAndPredicateBlock.