Magnetism and superconductivity in heavy fermion compounds at high pressure