llvm-project/llvm
Craig Topper e1e38d4248 [X86] Correct the register class for specific mask register constraints in getRegForInlineAsmConstraint when the VT is a scalar type
The default impementation in the base class for TargetLowering::getRegForInlineAsmConstraint doesn't work for mask registers when the VT is a scalar type integer types since the only legal mask types are vXi1. So we end up just getting whatever the first register class that contains the register. Currently this appears to be VK1, but its really dependent on the order tablegen outputs the register classes.

Some code in the caller ends up looking up the type for this register class and find v1i1 then generates a copyfromreg from the physical k-register with the v1i1 type. Then it generates an any_extend from v1i1 to the scalar VT which isn't legal. This bad any_extend sticks around until isel where it selects a MOVZX32rr8 with a v1i1 input or maybe a i8 input. Not sure but eventually we pick up a copy from VK1 to GR8 in MachineIR which isn't supported. This leads to a failure in physical register copying.

This patch uses the scalar type to find a VK class of the right size. In the attached test case this will be VK16. This causes a bitcast from vk16 to i16 to be generated instead of an any_extend. This will be properly iseled to a VK16 to GR32 copy and a GR32->GR16 extract_subreg.

Fixes PR41678

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

llvm-svn: 359837
2019-05-02 22:26:40 +00:00
..
benchmarks
bindings [OCaml] Update api to account for FNeg and CallBr instructions 2019-04-16 15:00:19 +00:00
cmake build: add option to disable unwind tables 2019-05-02 19:37:26 +00:00
docs build: add option to disable unwind tables 2019-05-02 19:37:26 +00:00
examples [JITLink] Update BuildingAJIT tutorials to account for API changes in r358818. 2019-04-20 17:35:28 +00:00
include lld-link: Add /force:multipleres extension to make dupe resource diag non-fatal 2019-05-02 21:21:55 +00:00
lib [X86] Correct the register class for specific mask register constraints in getRegForInlineAsmConstraint when the VT is a scalar type 2019-05-02 22:26:40 +00:00
projects
resources
runtimes [CMake] Replace the sanitizer support in runtimes build with multilib 2019-04-22 23:31:39 +00:00
test [X86] Correct the register class for specific mask register constraints in getRegForInlineAsmConstraint when the VT is a scalar type 2019-05-02 22:26:40 +00:00
tools Revert [llvm-nm] Fix handling of symbol types + [llvm-nm] Generalize symbol types 2019-05-02 21:42:46 +00:00
unittests Object/Minidump: Add support for the ThreadList stream 2019-05-02 07:45:42 +00:00
utils [gn] Include the missing BUILD.gn file for libcxxabi includes 2019-05-02 21:20:08 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt build: add option to disable unwind tables 2019-05-02 19:37:26 +00:00
CODE_OWNERS.TXT
CREDITS.TXT add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt 2019-04-23 02:37:48 +00:00
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.