Chemical Evolution and the Mass Function of Stellar Mass Black Holes