Currently, MVE tail predication will only tail predicate a loop if there only are predicated loads and stores present. This patch widens the scope to also accept gathers and scatters, such that loops that are auto-vectorized with the option -enable-arm-maskedgatscat (and actually end up containing an MVE gather or scatter) can be tail predicated.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I was looking at this pass for something else recently. I'm not sure if the legality checks are really necessary in here. We might want to change it to just check for active lane masks and convert them to vctp's (when legal). I think that will always be better in terms of code quality than the expansion of the active lane mask, no matter if we end up transforming to a tail predicated loop or not.
That's not really relevant for this patch though, which looks OK as far as I can tell.
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
10–1 | This comment can be removed now. | |
10–1 | Can this entire function use:
? | |
16 | I don't think this pass should ever see valid Intrinsic::masked_scatter's that have not been transformed into some form of Intrinsic::arm_mve_vstr_... |
llvm/lib/Target/ARM/ARMBaseInstrInfo.h | ||
---|---|---|
22 | Like Dave also said, do we really need the generic IR opcodes in these helpers? |
Changed getVectorType.
llvm/lib/Target/ARM/ARMBaseInstrInfo.h | ||
---|---|---|
22 | In the way this function is intended to work, no we don't. Checking for the generic IR opcodes in the case the function is used for here might seem a bit overkill, but not harmful to the intentions of the check (please do correct me if I'm mistaken). | |
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
10–1 | Yes, if I see it correctly, it can. I changed it to do that. |
llvm/lib/Target/ARM/ARMBaseInstrInfo.h | ||
---|---|---|
22 | Okay, sounds fair enough to me. |
Like Dave also said, do we really need the generic IR opcodes in these helpers?