llvm-6502/include/llvm
Ahmed Bougacha ec35069525 [CodeGen] Add hook/combine to form vector extloads, enabled on X86.
The combine that forms extloads used to be disabled on vector types,
because "None of the supported targets knows how to perform load and
sign extend on vectors in one instruction."

That's not entirely true, since at least SSE4.1 X86 knows how to do
those sextloads/zextloads (with PMOVS/ZX).
But there are several aspects to getting this right.
First, vector extloads are controlled by a profitability callback.
For instance, on ARM, several instructions have folded extload forms,
so it's not always beneficial to create an extload node (and trying to
match extloads is a whole 'nother can of worms).

The interesting optimization enables folding of s/zextloads to illegal
(splittable) vector types, expanding them into smaller legal extloads.

It's not ideal (it introduces some legalization-like behavior in the
combine) but it's better than the obvious alternative: form illegal
extloads, and later try to split them up.  If you do that, you might
generate extloads that can't be split up, but have a valid ext+load
expansion.  At vector-op legalization time, it's too late to generate
this kind of code, so you end up forced to scalarize. It's better to
just avoid creating egregiously illegal nodes.

This optimization is enabled unconditionally on X86.

Note that the splitting combine is happy with "custom" extloads. As
is, this bypasses the actual custom lowering, and just unrolls the
extload. But from what I've seen, this is still much better than the
current custom lowering, which does some kind of unrolling at the end
anyway (see for instance load_sext_4i8_to_4i64 on SSE2, and the added
FIXME).

Also note that the existing combine that forms extloads is now also
enabled on legal vectors.  This doesn't have a big effect on X86
(because sext+load is usually combined to sext_inreg+aextload).
On ARM it fires on some rare occasions; that's for a separate commit.

Differential Revision: http://reviews.llvm.org/D6904


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 18:31:02 +00:00
..
ADT ADT: Add int64_t interoperability to APSInt 2015-02-05 00:17:43 +00:00
Analysis Value soft float calls as more expensive in the inliner. 2015-02-05 02:09:33 +00:00
AsmParser Pass a MemoryBufferRef when we can avoid taking ownership. 2014-08-26 21:49:01 +00:00
Bitcode IR: Assembly and bitcode for GenericDebugNode 2015-02-03 21:54:14 +00:00
CodeGen Value soft float calls as more expensive in the inliner. 2015-02-05 02:09:33 +00:00
Config [Cygming] Seek also chkstk_ms, or JIT fails with DLL builds. It is fixup for r227519. 2015-01-30 13:01:19 +00:00
DebugInfo/DWARF Move DebugInfo to DebugInfo/DWARF. 2015-01-30 18:07:45 +00:00
ExecutionEngine [Orc] Make the ObjectLinkingLayer take ownership of object files until 2015-02-02 04:32:17 +00:00
IR Teach isDereferenceablePointer() to look through bitcast constant expressions. 2015-02-05 09:15:37 +00:00
IRReader Pass a MemoryBufferRef when we can avoid taking ownership. 2014-08-26 21:49:01 +00:00
LineEditor
Linker Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
LTO [LTO API] split lto_codegen_compile to lto_codegen_optimize and 2015-02-03 18:39:15 +00:00
MC [MC] Remove various unused MCAsmInfo parameters. 2015-02-05 00:58:51 +00:00
Object dd the option, -link-opt-hints to llvm-objdump used with -macho to print the 2015-01-27 21:28:24 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
ProfileData InstrProf: Make CounterMappingRegions less confusing to construct 2015-02-03 23:59:33 +00:00
Support Add support for double / float to EndianStream 2015-02-05 03:30:08 +00:00
TableGen Make MultiClass::DefPrototypes own their Records to fix memory leaks. 2014-12-11 05:25:33 +00:00
Target [CodeGen] Add hook/combine to form vector extloads, enabled on X86. 2015-02-05 18:31:02 +00:00
Transforms Add missing include. 2015-02-04 18:16:53 +00:00
CMakeLists.txt
InitializePasses.h Add a pass for inserting safepoints into (nearly) arbitrary IR 2015-02-04 00:37:33 +00:00
LinkAllIR.h
LinkAllPasses.h Add straight-line strength reduction to LLVM 2015-02-03 19:37:06 +00:00
module.modulemap Bring the modules buildbot back to life after r226940. 2015-01-24 01:55:52 +00:00
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassManager.h
PassRegistry.h [PM] Remove an unused and rather expensive mapping from an analysis 2014-10-06 00:30:59 +00:00
PassSupport.h Defining a new API for debug options that doesn't rely on static global cl::opts. 2014-10-15 21:54:35 +00:00