Sildenafil [0] was synthesized to treat high blood pressure. Erectile disfunction was a side effect that raised much more interest.
Tadalafil [1] followed the path of Sildenafil about the phosphodiesterase type 5 (PDE5) enzyme inhibitor.
Help to live longer was the main objective since the beginning.
[0] https://en.wikipedia.org/wiki/Sildenafil#History [1] https://en.wikipedia.org/wiki/Tadalafil#History