Our boars will do this when they are interested in a sow. I have never noticed this behaviour towards a pregnant sow. It is their way of saying 'come on lady I am ready'! I have seen the boar actually lift the sow into the air to get her attention. She will only oblige when she is ready though!
It is also a behaviour between castrated males as well, and young gilts towards another gilts and castrated males. It is their way of displaying their urges I guess.
Kate