Joseph Fielding Smith notes that the doctrine of work for the dead was revealed to Joseph in piecemeal form.
Joseph Fielding Smith, Doctrines of Salvation, comp. Bruce R. McConkie, 3 vols. (Salt Lake City: Bookcraft, 1955), 2:168
This work of salvation for the dead came to the Prophet like every other doctrine-piecemeal. It was not revealed all at once. When the Angel Moroni came to the Prophet Joseph Smith, one of the things he told him was that the hearts of the children should turn to their fathers and the hearts of the fathers to the children, so that when the Lord should come the earth should not be smitten with a curse. That is significant. That was the first inkling the Prophet had concerning salvation for the dead, and he did not know just what it meant. He had a very vague idea of the meaning of the words that Elijah would come to "plant in the hearts of the children the promises made to the fathers," and I suppose he pondered over it a good deal.