1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/include/llvm/Target
Craig Topper 62d16b9aa6 [SelectionDAG][X86] Relax restriction on the width of an input to *_EXTEND_VECTOR_INREG. Use them and regular *_EXTEND to replace the X86 specific VSEXT/VZEXT opcodes
Previously, the extend_vector_inreg opcode required their input register to be the same total width as their output. But this doesn't match up with how the X86 instructions are defined. For X86 the input just needs to be a legal type with at least enough elements to cover the output.

This patch weakens the check on these nodes and allows them to be used as long as they have more input elements than output elements. I haven't changed type legalization behavior so it will still create them with matching input and output sizes.

X86 will custom legalize these nodes by shrinking the input to be a 128 bit vector and once we've done that we treat them as legal operations. We still have one case during type legalization where we must custom handle v64i8 on avx512f targets without avx512bw where v64i8 isn't a legal type. In this case we will custom type legalize to a *extend_vector_inreg with a v16i8 input. After that the input is a legal type so type legalization should ignore the node and doesn't need to know about the relaxed restriction. We are no longer allowed to use the default expansion for these nodes during vector op legalization since the default expansion uses a shuffle which required the widths to match. Custom legalization for all types will prevent us from reaching the default expansion code.

I believe DAG combine works correctly with the released restriction because it doesn't check the number of input elements.

The rest of the patch is changing X86 to use either the vector_inreg nodes or the regular zero_extend/sign_extend nodes. I had to add additional isel patterns to handle any_extend during isel since simplifydemandedbits can create them at any time so we can't legalize to zero_extend before isel. We don't yet create any_extend_vector_inreg in simplifydemandedbits.

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

llvm-svn: 346784
2018-11-13 19:45:21 +00:00
..
GlobalISel [GlobalISel] Use the target preferred type for G_EXTRACT_VECTOR_ELT index. 2018-10-25 14:04:54 +00:00
CodeGenCWrappers.h [AArch64] Add Tiny Code Model for AArch64 2018-08-22 11:31:39 +00:00
GenericOpcodes.td [globalisel] Add comments indicating the operand order 2018-10-31 19:49:37 +00:00
Target.td [CodeGen] Remove out operands from PATCHABLE_OP 2018-10-26 13:37:25 +00:00
TargetCallingConv.td Remove trailing space 2018-07-30 19:41:25 +00:00
TargetInstrPredicate.td [tblgen][PredicateExpander] Add the ability to describe more complex constraints on instruction operands. 2018-10-31 12:28:05 +00:00
TargetIntrinsicInfo.h GlobalISel: support translation of intrinsic calls. 2016-07-29 22:32:36 +00:00
TargetItinerary.td [NFC] Fix comment of class InstrStage 2018-02-12 15:02:49 +00:00
TargetLoweringObjectFile.h [MC] Move EH DWARF encodings from MC to CodeGen, NFC 2018-08-09 22:24:04 +00:00
TargetMachine.h TargetMachine: Move lib/CodeGen specific callbacks to LLVMTargetMachine; NFC 2018-11-05 23:49:15 +00:00
TargetOptions.h CodeGen: Add a target option for emitting .addrsig directives for all address-significant symbols. 2018-07-17 22:40:08 +00:00
TargetPfmCounters.td [llvm-exegesis][NFC] Add a way to declare the default counter binding for unbound CPUs for a target. 2018-11-09 13:15:32 +00:00
TargetSchedule.td [MCSched] Bind PFM Counters to the CPUs instead of the SchedModel. 2018-10-25 07:44:01 +00:00
TargetSelectionDAG.td [SelectionDAG][X86] Relax restriction on the width of an input to *_EXTEND_VECTOR_INREG. Use them and regular *_EXTEND to replace the X86 specific VSEXT/VZEXT opcodes 2018-11-13 19:45:21 +00:00