This patch adds the AArch64 hook for preferPredicateOverEpilogue,
which currently returns true if SVE is enabled and one of the
following conditions (non-exhaustive) is met:
- The "sve-tail-folding" option is set to "all", or
- The "sve-tail-folding" option is set to "all+noreductions"
and the loop does not contain reductions,
- The "sve-tail-folding" option is set to "all+norecurrences"
and the loop has no first-order recurrences.
Currently the default option is "disabled", but this will be
changed in a later patch.
I've added new tests to show the options behave as expected here:
Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll
I think you want a couple more cases here:
My thinking is that if the user wants to enable a non-default case they shouldn't need to know what the default is. Likewise you should be able to be explicit when enabling a subset (i.e. you shouldn't need to guess at what needs to be disable and so can just start by disabling all and then adding the cases they care about.