[LV] Use speculatability within entire loop to avoid strided load predication
authorAnna Thomas <anna@azul.com>
Wed, 8 Mar 2023 22:32:50 +0000 (17:32 -0500)
committerAnna Thomas <anna@azul.com>
Tue, 21 Mar 2023 16:08:25 +0000 (12:08 -0400)
commit4277d932ef180090f314f7eb7f47d63e76881d30
treef079b2736e261426f9540bd9a3c5ccc9eef64405
parent586ad89638dd1282a41780a3c369e1bd881a7f42
[LV] Use speculatability within entire loop to avoid strided load predication

Use existing functionality for identifying total access size by strided
loads. If we can speculate the load across all vector iterations, we can
avoid predication for these strided loads (or masked gathers in
architectures which support it).

Differential Revision: https://reviews.llvm.org/D145616
llvm/lib/Analysis/Loads.cpp
llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll