It's about the risk/return trade off.
By paying down your mortgage ahead of schedule, you are guaranteed to get a (tax-free) return equivalent to the weighted average mortgage rate over the original term of your mortgage. That's guaranteed.
If you invest in a global equity fund or ETF, you might get a return that is higher than the savings you would make on your mortgage, over the same term. Or you might not.
But you have to pay tax on any return that you make on the investment fund. Currently an exit tax of 41% is payable on any return on an Irish/EU domiciled fund so your fund would have to return nearly double your mortgage rate for you to come out ahead.
That's certainly possible, but it's far less likely. So, paying down your mortgage has a higher projected return, on a risk adjusted basis.
There are certainly circumstances where it makes sense to contribute to a pension in circumstances where you do not pay income tax at the higher rate.
However, unless your employer is making a matching contribution to your pension, I would concentrate on paying off debt (including mortgage debt) in the first instance.