Another conflict that could have involved Ímar and the military forces of Dublin was Gruffudd 's final defeat of Hywel ab Edwin , King of Deheubarth ( died 1044 ) . According to Brut y Tywysogion and the " B " version of Annales Cambriæ this last stand of Hywel took place at the mouth of the River Tywi — perhaps in the vicinity of Carmarthen — and included Vikings from Ireland who supported Hywel 's cause . It is apparent that Gruffudd 's adversaries generally utilised foreign military support from Ireland 's Viking enclaves . Certainly , the Book of Llandaff declare that Gruffudd struggled against English , Irish , and Vikings during his career .