[llvm] [ScalarizeMaskedMemIntr] Optimize splat non-constant masks (PR #104537)
Krzysztof Drewniak via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 16 07:33:42 PDT 2024
================
@@ -188,8 +191,39 @@ static void scalarizeMaskedLoad(const DataLayout &DL, CallInst *CI,
return;
}
+ // Optimize the case where the "masked load" is a predicated load - that is,
+ // where the mask is the splat of a non-constant scalar boolean. In that case,
+ // use that splated value as the guard on a conditional vector load.
+ if (isSplatValue(Mask, /*Index=*/0)) {
+ Value *Predicate = Builder.CreateExtractElement(Mask, uint64_t(0ull),
----------------
krzysz00 wrote:
I don't think so - we need the rest of the function
Maybe I could collect a statistic?
https://github.com/llvm/llvm-project/pull/104537
More information about the llvm-commits
mailing list