llvm-project/llvm
Simon Tatham b769eb02b5 [ARM][BFloat] Legalize bf16 type even without fullfp16.
Summary:
This change permits scalar bfloats to be loaded, stored, moved and
used as function call arguments and return values, whenever the bf16
feature is supported by the subtarget.

Previously that was only supported in the presence of the fullfp16
feature, because the code generation strategy depended on instructions
from that extension. This change adds alternative code generation
strategies so that those operations can be done even without fullfp16.

The strategy for loads and stores is to replace VLDRH/VSTRH with
integer LDRH/STRH plus a move between register classes. I've written
isel patterns for those, conditional on //not// having the fullfp16
feature (so that in the fullfp16 case, the existing patterns will
still be used).

For function arguments and returns, instead of writing isel patterns
to match `VMOVhr` and `VMOVrh`, I've avoided generating those SDNodes
in the first place, by factoring out the code that constructs them
into helper functions `MoveToHPR` and `MoveFromHPR` which have a
fallback for non-fullfp16 subtargets.

The current output code is not especially pretty: in the new test file
you can see unnecessary store/load pairs implementing no-op bitcasts,
and lots of pointless moves back and forth between FP registers and
GPRs. But it at least works, which is an improvement on the previous
situation.

Reviewers: dmgreen, SjoerdMeijer, stuij, chill, miyuki, labrinea

Reviewed By: dmgreen, labrinea

Subscribers: labrinea, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82372
2020-06-24 09:36:26 +01:00
..
benchmarks
bindings
cmake [cmake] configure the host triple on an Apple Silicon machine correctly 2020-06-23 21:08:11 -07:00
docs [AMDGPU] Update AMD GPU processor information 2020-06-23 18:47:56 -04:00
examples [docs/examples] As part of using inclusive language within the llvm 2020-06-20 00:51:18 -07:00
include Remove GlobalValue::getAlignment(). 2020-06-23 19:13:42 -07:00
lib [ARM][BFloat] Legalize bf16 type even without fullfp16. 2020-06-24 09:36:26 +01:00
projects
resources
runtimes [CMake] Fix runtimes build for host Windows (default target) 2020-06-20 10:44:22 +02:00
test [ARM][BFloat] Legalize bf16 type even without fullfp16. 2020-06-24 09:36:26 +01:00
tools [NewPM] Attempt to run opt passes specified via -foo-pass under NPM 2020-06-23 10:10:40 -07:00
unittests [unittest, ADT] Add unit tests for itostr & utostr 2020-06-23 14:48:37 +01:00
utils [gn build] Port 96d4ccf00c 2020-06-24 08:17:48 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Change CMake so that we only look for Z3 when LLVM_ENABLE_Z3_SOLVER is enabled 2020-06-23 14:49:56 -04: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.