[PATCH] D17191: [LoopVectorize] Annotate versioned loop with noalias metadata

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 00:35:38 PST 2016


anemet created this revision.
anemet added reviewers: hfinkel, nadav.
anemet added a subscriber: llvm-commits.
Herald added a subscriber: mzolotukhin.

Use the new LoopVersioning facility (D16712) to add noalias metadata in
the vector loop if we versioned with memchecks.  This can enable some
optimization opportunities further down the pipeline (see the included
test or the benchmark improvement quoted in D16712).

The test also covers the bug I had in the initial version in D16712.

The vectorizer did not previously use LoopVersioning.  The reason is
that the vectorizer performs its transformations in single shot.  It
creates an empty single-block vector loop that it then populates with
the widened, if-converted instructions.  Thus creating an intermediate
versioned scalar loop seems wasteful.

So this patch (rather than bringing in LoopVersioning fully) adds a
special interface to LoopVersioning to allow the vectorizer to add
no-alias annotation while still performing its own versioning.

As the vectorizer propagates metadata from the instructions in the
original loop to the vector instructions we also check the pointer in
the original instruction and see if LoopVersioning can add no-alias
metadata based on the issued memchecks.

http://reviews.llvm.org/D17191

Files:
  include/llvm/Transforms/Utils/LoopVersioning.h
  lib/Transforms/Utils/LoopVersioning.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/noalias-md.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17191.47775.patch
Type: text/x-patch
Size: 9792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160212/591c31f8/attachment.bin>


More information about the llvm-commits mailing list