[PATCH] D71919: [LoopVectorize] Disable single stride access predicates when gather loads are available.

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 15:23:48 PST 2020


hsaito added a comment.

We shouldn't make this either/or. Ability to runtime check unit-stride is good, and ability to use gather/scatter is also good. Depending on the target, I see the following situations

1. don't vectorize the loop ---- unit-strided code alone isn't profitable or loop itself is profitable but not good enough to cover runtime check cost.
2. vectorize with runtime check, with scalar code to fall back ---- when gather/scatter code is deemed not profitable.
3. vectorize with runtime check with gather/scatter code to fall back
4. vectorize with gather/scatter

If we aren't adding proper cost modeling, I think the default action should stay unchanged, i.e., 2), until further study allows us to collectively say another default is better. Looks like ARM wants to go with 4). If so, we need to make this TTI check, and allow LoopVectorize internal flag to override TTI. I don't think we immediately need to have the ability to do 3), but writing it down as TODO would be nice.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71919/new/

https://reviews.llvm.org/D71919





More information about the llvm-commits mailing list