Trisiras (AKA Vishwarupa) was the three-headed son of the divine architect Tvashta (AKA Vishwakarma). He was extremely devout, even serving as temporary guru of the gods when Brihaspati had abandoned the gods out of anger. But then Indra, seeing how powerful Trisiras was, and fearing that he would aid the Asuras (demons) with his power, decided to kill Trisiras by cutting off all three of his heads heads. Here is how the Srimad Bhagavatam describes it:
Once upon a time, however, the King of heaven, Indra, understood that Viśvarūpa was secretly cheating the gods by offering oblations on behalf of the demons. He became extremely afraid of being defeated by the demons, and in great anger at Viśvarūpa he cut Viśvarūpa’s three heads from his shoulders.
Incidentally, Indra's killing of Trisiras led to the creation of the demon Vritrasura, and the deed Indra is famous for in Hindu scripture is the killing of Vritrasura.
But my question is about Trisiras' religious activity. As I mentioned above, Trisiras was a very devout individual, and the Rig Veda Anukramani states that Trisiras son of Tvashta was the seer of one of the hymns of the Tenth Mandala of the Rig Veda. (See Book 10 Hymn 8 in the Rig Veda Anukramani in my answer here.). The hymn is mainly about Agni the fire god, but this is how the hymn ends:
Through his wise insight Trita in the cavern, seeking as ever the Chief Sire's intention, carefully tended in his Parents' bosom, calling the weapons kin, goes forth to combat. Well-skilled to use the weapons of his Father, Āptya, urged on by Indra, fought the battle. Then Trita slew the foe seven-rayed, three-headed, and freed the cattle of the Son of Tvaṣṭar. Lord of the brave, Indra cleft him in pieces who sought to gain much strength and deemed him mighty. He smote his three heads from his body, seizing the cattle of the omniform [Vishwarupa] Son of Tvaṣṭar.
That is a description of the death of Trisiras! As I discuss in this answer, the verses of the Vedas originate from sages called Dhristas who heard these verses directly from the gods during deep meditation. And the Anukramani says that the person who heard the verses in this particular hymn was Trisiras himself!
So did Trisiras foresee his own death? Are there any other scriptures that say that he knew he was going to die beforehand?