As to sharing it with devas, in DN 16
Excellent. Thank you. I think there are a few more as well.
daverupa wrote:It seems to my recollection that most of these sorts of passages coagulate around the later parts of the early material, into the later material. Much of the early stuff (sutta nipata, et al) doesn't seem as concerned about merit, as far as I can recall.
Since this post is in the Discovering Theravada, the distinction of early-early and later-early material might not matter so much. The concept of merit, although not the sharing of, is found in the Sutta Nipata (Mangala, Kasibharadvaja, etc), but perhaps not in the parts that some would view as early-early.
The OP asked if the practice of sharing merits had its roots in the Buddha's teaching. As far as that goes, I think the answer is clearly a yes.