1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib
Craig Topper c6a7e261b5 [SelectionDAG][X86][ARM][AArch64] Add ISD opcode for __builtin_parity. Expand it to shifts and xors.
Clang emits (and (ctpop X), 1) for __builtin_parity. If ctpop
isn't natively supported by the target, this leads to poor codegen
due to the expansion of ctpop being more complex than what is needed
for parity.

This adds a DAG combine to convert the pattern to ISD::PARITY
before operation legalization. Type legalization is updated
to handled Expanding and Promoting this operation. If after type
legalization, CTPOP is supported for this type, LegalizeDAG will
turn it back into CTPOP+AND. Otherwise LegalizeDAG will emit a
series of shifts and xors followed by an AND with 1.

I've avoided vectors in this patch to avoid more legalization
complexity for this patch.

X86 previously had a custom DAG combiner for this. This is now
moved to Custom lowering for the new opcode. There is a minor
regression in vector-reduce-xor-bool.ll, but a follow up patch
can easily fix that.

Fixes PR47433

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D87209
2020-09-12 11:42:18 -07:00
..
Analysis [LV][ARM] Add preferInloopReduction target hook. 2020-09-12 17:47:04 +01:00
AsmParser [DebugInfo][flang]Added support for representing Fortran assumed length strings 2020-08-22 10:13:40 +05:30
BinaryFormat [DebugInfo] Allow GNU macro extension to be read 2020-08-11 13:30:52 +02:00
Bitcode [NFC][ThinLTO] Let llvm::EmbedBitcodeInModule handle serialization. 2020-09-10 10:25:00 -07:00
Bitstream [Bitstream] Use alignTo to make code more readable. NFC 2020-09-01 11:06:45 -07:00
CodeGen [SelectionDAG][X86][ARM][AArch64] Add ISD opcode for __builtin_parity. Expand it to shifts and xors. 2020-09-12 11:42:18 -07:00
DebugInfo llvm-symbolizer: Add optional "start file" to match "start line" 2020-09-08 15:40:58 -07:00
Demangle
DWARFLinker
ExecutionEngine Re-apply "[ORC] Make MaterializationResponsibility immovable..." with fixes. 2020-09-11 14:09:05 -07:00
Extensions Remove unused variable(s) 2020-09-08 16:58:01 -07:00
FileCheck Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
Frontend [OpenMP][OMPBuilder] Adding support for omp single 2020-08-16 01:15:16 -04:00
Fuzzer
FuzzMutate
InterfaceStub Remove unnecessary HEADER_DIRS in lib/InterfaceStub/CMakeLists.txt 2020-08-14 11:22:50 -07:00
IR Reland [AssumeBundles] Use operand bundles to encode alignment assumptions 2020-09-12 15:36:06 +02:00
IRReader
LineEditor
Linker [ThinLTO] Fix a metadata lost issue with DICompileUnit import. 2020-09-02 14:40:41 -07:00
LTO [ThinLTO] Make -lto-embed-bitcode an enum 2020-09-11 13:24:54 -07:00
MC [MC] Allow .org directives in SHT_NOBITS sections 2020-09-11 15:12:42 -07:00
MCA [APInt] New member function setBitVal 2020-09-02 21:40:31 +01:00
Object [ELF] Add a new e_machine value EM_CSKY and add some CSKY relocation types 2020-09-07 10:42:28 +08:00
ObjectYAML [DWARFYAML] Make the debug_ranges section optional. 2020-09-08 19:55:47 +08:00
Option [NFC] Fix the signature and definition of findByPrefix 2020-09-11 12:38:28 +01:00
Passes [NewPM] Introduce PreserveCFG check 2020-09-11 14:32:21 +07:00
ProfileData [llvm-cov gcov] Simply computation of line counts and exit block counter 2020-09-08 23:15:37 -07:00
Remarks BitstreamRemarkParser.h - remove unnecessary includes. NFCI. 2020-08-06 13:17:53 +01:00
Support Add raw_fd_stream that supports reading/seeking/writing 2020-09-12 07:34:19 +00:00
TableGen TableGen: change a couple of member names to clarify their use. 2020-09-12 12:21:36 -04:00
Target [SelectionDAG][X86][ARM][AArch64] Add ISD opcode for __builtin_parity. Expand it to shifts and xors. 2020-09-12 11:42:18 -07:00
Testing [cmake] Make gtest include directories a part of the library interface 2020-08-27 15:35:57 +02:00
TextAPI [TextAPI] update DriverKit string value 2020-08-15 06:44:30 -07:00
ToolDrivers
Transforms [DSE] Bail out on MemoryPhis when deleting stores at end of function. 2020-09-12 19:05:59 +01:00
WindowsManifest [CMake] Simplify CMake handling for libxml2 2020-09-09 21:44:44 -07:00
XRay
CMakeLists.txt Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
LLVMBuild.txt [elfabi] Move llvm-elfabi related code to InterfaceStub library 2020-08-13 11:51:44 -07:00