[LoopVectorize] When tail-folding, don't always predicate uniform loads
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 25 Oct 2021 14:26:54 +0000 (15:26 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Fri, 26 Nov 2021 11:30:54 +0000 (11:30 +0000)
commite20391fc5d6a72e712449142e803fb81b8a75153
treeaa35fc4442fc1bb3b68a67f9e66591e37dac9836
parent12eafd944e0ffccae93402ddbe2855beb7a939ff
[LoopVectorize] When tail-folding, don't always predicate uniform loads

In VPRecipeBuilder::handleReplication if we believe the instruction
is predicated we then proceed to create new VP region blocks even
when the load is uniform and only predicated due to tail-folding.

I have updated isPredicatedInst to avoid treating a uniform load as
predicated when tail-folding, which means we can do a single scalar
load and a vector splat of the value.

Tests added here:

  Transforms/LoopVectorize/AArch64/tail-fold-uniform-memops.ll

Differential Revision: https://reviews.llvm.org/D112552
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/tail-fold-uniform-memops.ll