It would be cheaper to render those afterwards client-side given a list of comment ids that the logged-in user has upvoted.
That's a perfect example of graceful degradation / progressive enhancement.
A JS event on the html element cancels clicks on those links and handles them in JS with AJAX so the page is not reloaded.