If it's an optic ready 2.0 Compact, then you cannot use the Trijicon HD XR. They're made for the non-optics ready M&P that has a rear sight dovetail that's further forward, and back off the rear sight extends rearward from that dovetail. The HD XR rear sight would stick off the back of your slide.
XS Sights makes CORE/OR rear dovetail compatible sight sets under their R3D and R3D 2.0, as well as their trademark dot style sights (I figure you're probably not in to those since you like the HD XR).
Night Fision also offers a standard height set for the CORE/OR dovetail.