It's also the greatest blessing to be killed by God, since instant moksha is guaranteed. Hiranyakashipu hated Lord Vishnu so much the Lord was always in his mind. One could say that Lord Vishnu took up a lot of room in Hiranyakashipu's head.
Being a devotee is not only about love, one can be a devotee in hatred. So when Hiranyakashipu was killed by Lord Narasimha, moksha was instant. All one has to do is think of the Lord upon leaving the body. I prefer to think of him with love though.