[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
Thu Feb 10 12:52:38 PST 2022


fhahn updated this revision to Diff 407652.
fhahn marked 7 inline comments as done.
fhahn added a comment.

Thank you very much for taking a look! Comments should be addressed.

In D119121#3310103 <https://reviews.llvm.org/D119121#3310103>, @xbolva00 wrote:

>>> I doubt that   __attribute__((noinline))  suffices as an optimization barrier, IPO such as IPConstantPropagation/FunctionSpecialization can still take place. Even worse, the allocation are made within the check functions and the lambda being inlined such that the optimizer can see the allocation.
>
> Sadly, work on ‘noipa’ stalled. And we totally miss “noclone”, but maybe not a issue yet, since funcspec pass is not enabled yet.

My thinking was that because `checkOverlappingMemoryTwoRuntimeChecks` won't be inlined and called with different lambda arguments, the scalar/vector lambdas won't be inlined. It's true that this would not prevent function specialization & co from interfering, but it seems unlikely that it would be profitable.

> But do we even need the optimization barrier? How could the memory check be optimized away?

In the current version, I don't think there's a need for a real barrier any longer. Previously, with the larger offset there may have been cases where AA could prove that the 2 accessed regions won't overlap.

> [not a change request] If we vary interleaving as well, we would not be restricted to the target architecture's vector width.

I was wondering whether we should rely on the vectorizer choosing vectorization factors and interleave counts automatically or if we should force them instead. My reasoning for letting the compiler chose is that we get different combinations for different targets, possibly increasing coverage overall. We could chose the VF automatically and cover a range of user-provided interleave counts ?


Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119121/new/

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.407652.patch
Type: text/x-patch
Size: 12231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220210/cafb73e6/attachment.bin>


More information about the llvm-commits mailing list