[PATCH] D119121: [test-suite] Add unit tests for vectorizer memory runtime checks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 02:30:32 PST 2022


fhahn created this revision.
fhahn added reviewers: Meinersbur, dmgreen, lebedev.ri.
Herald added a subscriber: mgorny.
fhahn requested review of this revision.

This patch adds a first set of tests to check memory runtime checks
generated by the vectorizer.

The it runs scalar and vectorized versions of a loop requiring runtime
checks on the same inputs with pointers to the same buffer using various
offsets. It fails if they do not produce the same results.

The test functions are provided as lambdas, which are passed to a
driver function that generates the inputs and calls the lambdas with
pointers to overlapping buffers.  The driver functions are marked as
noinline, which should act as an optimization barrier so the lambdas in
turn cannot be inlined and optimized without runtime checks.

Unfortunately 2 separate lambdas need to be specified for the scalar and
vector versions, with the only difference being the pragma to disable
vectorization. If anybody knows a nice generic & convenient way to
specify the loop once, what would be great.


Repository:
  rT test-suite

https://reviews.llvm.org/D119121

Files:
  SingleSource/UnitTests/Vectorizer/CMakeLists.txt
  SingleSource/UnitTests/Vectorizer/runtime-checks.cpp
  SingleSource/UnitTests/Vectorizer/runtime-checks.reference_output

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119121.406370.patch
Type: text/x-patch
Size: 13000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220207/ab36fd88/attachment.bin>


More information about the llvm-commits mailing list