Do you know why it compressed? Was it the floor that failed and pushed downwards, is there a visible deformation of the hull under the water at that zone?
Or was it the post that shrank with the weight.
Absolutely yes, do repair with a shimming piece, but if you can, make a new compression post. I assume it's wood correct? Just make sure the shims are correctly secured and attached eithr to the post or the hull, so they don't come off as you sail and drop the mast all of a sudden which will cause a failure.