This is pulled out of D100408. This avoids a regression that would be exposed by making the calling code from InstSimplify more efficient.