[RISCV][TTI] Fix potential crash of using dyn_cast() in getIntrinsicInstrCost() NFC. (#109379)
This patch fix the potential crash about using dyn_cast in `vp_cmp`
which is same as #109313.
Check if the IntrinsicCostAttrubute contains underlying instruction
first and cast to the VPCmpIntrinsic.