Hexagon has certain library functions and intrinsics that are specific to that target, and that are equivalent to a code written using loops. To fully exploit these features, the loop-idiom recognition pass would be the best candidate to handle these opportunities, but since it is a target-independent pass, polluting it with target-specific code does not seem like a good idea.
I'm guessing that Hexagon is likely not the only platform with these properties, and certainly there is nothing in the way for any other target to provide their own implementation of some common loop idioms (via hand-optimized library functions, for example).
This is an attempt to create a target-independent interface by which individual targets can provide their own functions to recognize loop idioms. Also, included is a do-nothing demo of how a Hexagon's pass could be hooked up using this interface.