Patch 1/3 does two things at once [introduces a helper and changes allocate_register()], which made it somewhat harder to review. Anyway, the concept seems fine, but "dimx" and "component_count" aren't great names. Honestly I'd use "component_count" and "reg_size" respectively.
Patch 2/3 is fine, although I'd prefer something closer to the sm4 architecture.
But this change -- along with following the conversion of repeating the last component of the swizzle when fewer than 4 components are to be specified -- would require more global changes, probably in hlsl_swizzle_from_writemask() and hlsl_map_swizzle().
Yeah, and while I wouldn't object to it on the grounds of making it a bit easier to compare output by eye, I don't think it's necessary.