Weights of irreducible polynomials