llvm-project/llvm
Sjoerd Meijer d1522513d4 [ARM] Reimplement MVE Tail-Predication pass using @llvm.get.active.lane.mask
To set up a tail-predicated loop, we need to to calculate the number of
elements processed by the loop. We can now use intrinsic
@llvm.get.active.lane.mask() to do this, which is emitted by the vectoriser in
D79100. This intrinsic generates a predicate for the masked loads/stores, and
consumes the Backedge Taken Count (BTC) as its second argument. We can now use
that to reconstruct the loop tripcount, instead of the IR pattern match
approach we were using before.

Many thanks to Eli Friedman and Sam Parker for all their help with this work.

This also adds overflow checks for the different, new expressions that we
create: the loop tripcount, and the sub expression that calculates the
remaining elements to be processed. For the latter, SCEV is not able to
calculate precise enough bounds, so we work around that at the moment, but is
not entirely correct yet, it's conservative. The overflow checks can be
overruled with a force flag, which is thus potentially unsafe (but not really
because the vectoriser is the only place where this intrinsic is emitted at the
moment). It's also good to mention that the tail-predication pass is not yet
enabled by default.  We will follow up to see if we can implement these
overflow checks better, either by a change in SCEV or we may want revise the
definition of llvm.get.active.lane.mask.

Differential Revision: https://reviews.llvm.org/D79175
2020-06-17 15:17:42 +01:00
..
benchmarks
bindings
cmake Revert "[llvm] Added support for stand-alone cmake object libraries." 2020-06-15 12:15:39 -07:00
docs [FileCheck] Implement * and / operators for ExpressionValue. 2020-06-17 09:39:17 +00:00
examples
include Revert "[InlineCost] InlineCostAnnotationWriterPass introduced" 2020-06-17 14:02:34 +00:00
lib [ARM] Reimplement MVE Tail-Predication pass using @llvm.get.active.lane.mask 2020-06-17 15:17:42 +01:00
projects
resources
runtimes [CMake][runtimes] Skip adding 2nd set of the same variables for a generic target 2020-06-15 09:59:27 +02:00
test [ARM] Reimplement MVE Tail-Predication pass using @llvm.get.active.lane.mask 2020-06-17 15:17:42 +01:00
tools [llvm-readobj] - Do not crash when GnuHashTable->symndx is greater than the dynamic symbols count. 2020-06-17 14:26:36 +03:00
unittests Revert "GlobalISel: Make LLT constructors constexpr" 2020-06-17 15:31:12 +02:00
utils [gn build] Port 6754a0e2ed 2020-06-17 08:12:14 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Automatically configure MLIR when flang is enabled 2020-05-27 07:31:49 +00:00
CODE_OWNERS.TXT Make myself code owner of InferAddressSpaces 2020-06-08 21:26:01 -04:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.