The generic CHERI pass tries to be smarter and avoid making live ranges too large, rather than always inserting the CSetBounds/SCBNDS just after the alloca in the prologue and causing high register pressure (in theory the intrinsic could be made rematerialisable and/or cloneable such that it's automatically cloned, sunk and rematerialised as the register allocator desires, but the generic pass tries to work around those limitations). Reusing the generic pass also ensures all CHERI targets, including Morello, benefit from any improvements, and avoids code duplication. The only downside of this pass is that it doesn't use CSetBoundsExact/SCBNDSE, but that is something we should fix upstream as an added level of defense against compiler bugs (though with a correct implementation of the pass should be unnecessary).
The only thing needed to make this pass work for Morello is to add ISel patterns for the recently-added int_cheri_bounded_stack_cap_dynamic; it already has patterns for the existing int_cheri_bounded_stack_cap (for both register and immediate forms of SCBNDS) that have so far been unused.
Even in the limited selection of AArch64 tests here there are already some definite improvements in code quality.