llvm-project/llvm
Alex Bradbury d05eae7a7b [RISCV] Add patterns for RV64I SLLW/SRLW/SRAW instructions
This restores support for selecting the SLLW/SRLW/SRAW instructions, which was
removed in rL348067 as the previous patterns made some unsafe assumptions.
Also see the related llvm-dev discussion
<http://lists.llvm.org/pipermail/llvm-dev/2018-December/128497.html>

Ultimately I didn't introduce a custom SelectionDAG node, but instead added a
DAG combine that inserts an AssertZext i5 on the shift amount for an i32
variable-length shift and also added an ANY_EXTEND DAG-combine which will
instead produce a SIGN_EXTEND for an i32 variable-length shift, increasing the
opportunity to safely select SLLW/SRLW/SRAW.

There are obviously different ways of addressing this (a number discussed in
the llvm-dev thread), so I'd welcome further feedback and comments.

Note that there are now some cases in
test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll where sraw/srlw/sllw is
selected even though sra/srl/sll could be used without any extra instructions.
Given both are semantically equivalent, there doesn't seem a good reason to
prefer one vs the other. Given that would require more logic to still select
sra/srl/sll in those cases, I've left it preferring the *w variants.

Differential Revision: https://reviews.llvm.org/D56264

llvm-svn: 350992
2019-01-12 07:32:31 +00:00
..
benchmarks
bindings Revert "Fix go bindings for r350647: missed a function rename" 2019-01-10 01:51:54 +00:00
cmake [CMake] Export utility targets to the build/install tree depending on LLVM_BUILD/INSTALL_UTILS 2019-01-11 19:34:34 +00:00
docs [llvm-symbolizer] Add -exe, -e as aliases to -obj 2019-01-11 11:51:52 +00:00
examples Python compat - print statement 2019-01-03 14:11:33 +00:00
include [AArch64] Create feature set for Exynos M4 2019-01-11 18:54:25 +00:00
lib [RISCV] Add patterns for RV64I SLLW/SRLW/SRAW instructions 2019-01-12 07:32:31 +00:00
projects [pstl] Initial integration with LLVM's CMake 2018-12-21 15:59:04 +00:00
resources
runtimes
test [RISCV] Add patterns for RV64I SLLW/SRLW/SRAW instructions 2019-01-12 07:32:31 +00:00
tools [LTO] Record whether LTOUnit splitting is enabled in index 2019-01-11 18:31:57 +00:00
unittests [AArch64] Create feature set for Exynos M4 2019-01-11 18:54:25 +00:00
utils gn build: Add a stage2 toolchain for Android. 2019-01-11 23:18:51 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore Git ignore CLion project configuration files. NFC 2019-01-02 19:58:07 +00:00
CMakeLists.txt [CMake] Add libunwind when 'all' is being passed as LLVM_ENABLE_PROJECTS 2018-12-20 18:39:47 +00:00
CODE_OWNERS.TXT [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00
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.