llvm-project/llvm/lib
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
..
Analysis [SCEV] Use isKnownViaNonRecursiveReasoning for smax simplification 2019-05-01 15:58:24 +00:00
AsmParser [ThinLTO] Fix unreachable code when parsing summary entries. 2019-05-01 16:26:59 +00:00
BinaryFormat [XCOFF] Add functionality for parsing AIX XCOFF object file headers 2019-04-04 00:53:21 +00:00
Bitcode Use llvm::lower_bound. NFC 2019-04-12 02:02:06 +00:00
CodeGen [SelectionDAG] Add asserts to verify the vectorness of input and output types of TRUNCATE/ZERO_EXTEND/ANY_EXTEND/SIGN_EXTEND agree 2019-05-02 22:26:26 +00:00
DebugInfo [PDB] Fix hash function used to write /src/headerblock 2019-04-29 23:09:35 +00:00
Demangle llvm-undname: Fix assert-on->4GiB-string-literal, found by oss-fuzz 2019-04-24 16:09:38 +00:00
ExecutionEngine [ORC] Pass object buffer ownership back in NotifyEmitted. 2019-05-01 22:40:23 +00:00
FuzzMutate [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
Fuzzer
IR [DebugInfo] DW_OP_deref_size in PrologEpilogInserter. 2019-04-30 07:58:57 +00:00
IRReader [IRReader] Expose getLazyIRModule 2019-02-11 22:01:13 +00:00
LTO [ThinLTO] Adding architecture name into saved object filename 2019-04-29 21:39:54 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [Linker] Fix crash handling appending linkage 2019-03-20 19:20:07 +00:00
MC Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
MCA [MCA] Add field `IsEliminated` to class Instruction. NFCI 2019-04-27 11:59:11 +00:00
Object lld-link: Add /force:multipleres extension to make dupe resource diag non-fatal 2019-05-02 21:21:55 +00:00
ObjectYAML [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobj 2019-04-30 19:30:24 +00:00
Option Option spell checking: Penalize delimiter flags if input has no argument 2019-05-01 16:45:15 +00:00
Passes [ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM 2019-04-23 18:56:19 +00:00
ProfileData Fix a few -Werror warnings: 2019-04-30 21:44:21 +00:00
Remarks [Remarks] Add string deduplication using a string table 2019-04-24 00:06:24 +00:00
Support [Support] Don't check MAP_ANONYMOUS, just use MAP_ANON 2019-05-02 05:58:09 +00:00
TableGen [TableGen] Fix null pointer dereferencing in token parser. 2019-04-30 13:09:55 +00:00
Target [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
Testing [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
TextAPI [TextAPI] Fix Symbol::dump which was failing to append the SymbolKind string. 2019-04-29 18:25:04 +00:00
ToolDrivers [llvm-ar][libObject] Fix relative paths when nesting thin archives. 2019-02-13 23:39:41 +00:00
Transforms remove inalloca parameters in globalopt and simplify argpromotion 2019-05-02 00:37:36 +00:00
WindowsManifest Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
XRay Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
CMakeLists.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00
LLVMBuild.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00