LLVM  10.0.0
PPCISelLowering.h
Go to the documentation of this file.
1 //===-- PPCISelLowering.h - PPC32 DAG Lowering Interface --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the interfaces that PPC uses to lower LLVM code into a
10 // selection DAG.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCISELLOWERING_H
15 #define LLVM_LIB_TARGET_POWERPC_PPCISELLOWERING_H
16 
17 #include "PPCInstrInfo.h"
25 #include "llvm/IR/Attributes.h"
26 #include "llvm/IR/CallingConv.h"
27 #include "llvm/IR/Function.h"
28 #include "llvm/IR/InlineAsm.h"
29 #include "llvm/IR/Metadata.h"
30 #include "llvm/IR/Type.h"
32 #include <utility>
33 
34 namespace llvm {
35 
36  namespace PPCISD {
37 
38  // When adding a NEW PPCISD node please add it to the correct position in
39  // the enum. The order of elements in this enum matters!
40  // Values that are added after this entry:
41  // STBRX = ISD::FIRST_TARGET_MEMORY_OPCODE
42  // are considered memory opcodes and are treated differently than entries
43  // that come before it. For example, ADD or MUL should be placed before
44  // the ISD::FIRST_TARGET_MEMORY_OPCODE while a LOAD or STORE should come
45  // after it.
46  enum NodeType : unsigned {
47  // Start the numbering where the builtin ops and target ops leave off.
49 
50  /// FSEL - Traditional three-operand fsel node.
51  ///
53 
54  /// XSMAXCDP, XSMINCDP - C-type min/max instructions.
57 
58  /// FCFID - The FCFID instruction, taking an f64 operand and producing
59  /// and f64 value containing the FP representation of the integer that
60  /// was temporarily in the f64 operand.
62 
63  /// Newer FCFID[US] integer-to-floating-point conversion instructions for
64  /// unsigned integers and single-precision outputs.
68 
69  /// FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64
70  /// operand, producing an f64 value containing the integer representation
71  /// of that FP value.
74 
75  /// Newer FCTI[D,W]UZ floating-point-to-integer conversion instructions for
76  /// unsigned integers with round toward zero.
79 
80  /// Floating-point-to-interger conversion instructions
83 
84  /// VEXTS, ByteWidth - takes an input in VSFRC and produces an output in
85  /// VSFRC that is sign-extended from ByteWidth to a 64-byte integer.
87 
88  /// SExtVElems, takes an input vector of a smaller type and sign
89  /// extends to an output vector of a larger type.
91 
92  /// Reciprocal estimate instructions (unary FP ops).
93  FRE,
95 
96  // VMADDFP, VNMSUBFP - The VMADDFP and VNMSUBFP instructions, taking
97  // three v4f32 operands and producing a v4f32 result.
100 
101  /// VPERM - The PPC VPERM Instruction.
102  ///
104 
105  /// XXSPLT - The PPC VSX splat instructions
106  ///
108 
109  /// VECINSERT - The PPC vector insert instruction
110  ///
112 
113  /// VECSHL - The PPC vector shift left instruction
114  ///
116 
117  /// XXPERMDI - The PPC XXPERMDI instruction
118  ///
120 
121  /// The CMPB instruction (takes two operands of i32 or i64).
123 
124  /// Hi/Lo - These represent the high and low 16-bit parts of a global
125  /// address respectively. These nodes have two operands, the first of
126  /// which must be a TargetGlobalAddress, and the second of which must be a
127  /// Constant. Selected naively, these turn into 'lis G+C' and 'li G+C',
128  /// though these are usually folded into other nodes.
129  Hi,
130  Lo,
131 
132  /// The following two target-specific nodes are used for calls through
133  /// function pointers in the 64-bit SVR4 ABI.
134 
135  /// OPRC, CHAIN = DYNALLOC(CHAIN, NEGSIZE, FRAME_INDEX)
136  /// This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to
137  /// compute an allocation on the stack.
139 
140  /// This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to
141  /// compute an offset from native SP to the address of the most recent
142  /// dynamic alloca.
144 
145  /// GlobalBaseReg - On Darwin, this node represents the result of the mflr
146  /// at function entry, used for PIC code.
148 
149  /// These nodes represent PPC shifts.
150  ///
151  /// For scalar types, only the last `n + 1` bits of the shift amounts
152  /// are used, where n is log2(sizeof(element) * 8). See sld/slw, etc.
153  /// for exact behaviors.
154  ///
155  /// For vector types, only the last n bits are used. See vsld.
159 
160  /// EXTSWSLI = The PPC extswsli instruction, which does an extend-sign
161  /// word and shift left immediate.
163 
164  /// The combination of sra[wd]i and addze used to implemented signed
165  /// integer division by a power of 2. The first operand is the dividend,
166  /// and the second is the constant shift amount (representing the
167  /// divisor).
169 
170  /// CALL - A direct function call.
171  /// CALL_NOP is a call with the special NOP which follows 64-bit
172  /// SVR4 calls and 32-bit/64-bit AIX calls.
175 
176  /// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
177  /// MTCTR instruction.
179 
180  /// CHAIN,FLAG = BCTRL(CHAIN, INFLAG) - Directly corresponds to a
181  /// BCTRL instruction.
183 
184  /// CHAIN,FLAG = BCTRL(CHAIN, ADDR, INFLAG) - The combination of a bctrl
185  /// instruction and the TOC reload required on 64-bit ELF, 32-bit AIX
186  /// and 64-bit AIX.
188 
189  /// Return with a flag operand, matched by 'blr'
191 
192  /// R32 = MFOCRF(CRREG, INFLAG) - Represents the MFOCRF instruction.
193  /// This copies the bits corresponding to the specified CRREG into the
194  /// resultant GPR. Bits corresponding to other CR regs are undefined.
196 
197  /// Direct move from a VSX register to a GPR
199 
200  /// Direct move from a GPR to a VSX register (algebraic)
202 
203  /// Direct move from a GPR to a VSX register (zero)
205 
206  /// Direct move of 2 consecutive GPR to a VSX register.
208 
209  /// BUILD_SPE64 and EXTRACT_SPE are analogous to BUILD_PAIR and
210  /// EXTRACT_ELEMENT but take f64 arguments instead of i64, as i64 is
211  /// unsupported for this target.
212  /// Merge 2 GPRs to a single SPE register.
214 
215  /// Extract SPE register component, second argument is high or low.
217 
218  /// Extract a subvector from signed integer vector and convert to FP.
219  /// It is primarily used to convert a (widened) illegal integer vector
220  /// type to a legal floating point vector type.
221  /// For example v2i32 -> widened to v4i32 -> v2f64
223 
224  /// Extract a subvector from unsigned integer vector and convert to FP.
225  /// As with SINT_VEC_TO_FP, used for converting illegal types.
227 
228  // FIXME: Remove these once the ANDI glue bug is fixed:
229  /// i1 = ANDI_rec_1_[EQ|GT]_BIT(i32 or i64 x) - Represents the result of the
230  /// eq or gt bit of CR0 after executing andi. x, 1. This is used to
231  /// implement truncation of i32 or i64 to i1.
234 
235  // READ_TIME_BASE - A read of the 64-bit time-base register on a 32-bit
236  // target (returns (Lo, Hi)). It takes a chain operand.
238 
239  // EH_SJLJ_SETJMP - SjLj exception handling setjmp.
241 
242  // EH_SJLJ_LONGJMP - SjLj exception handling longjmp.
244 
245  /// RESVEC = VCMP(LHS, RHS, OPC) - Represents one of the altivec VCMP*
246  /// instructions. For lack of better number, we use the opcode number
247  /// encoding for the OPC field to identify the compare. For example, 838
248  /// is VCMPGTSH.
250 
251  /// RESVEC, OUTFLAG = VCMPo(LHS, RHS, OPC) - Represents one of the
252  /// altivec VCMP*o instructions. For lack of better number, we use the
253  /// opcode number encoding for the OPC field to identify the compare. For
254  /// example, 838 is VCMPGTSH.
256 
257  /// CHAIN = COND_BRANCH CHAIN, CRRC, OPC, DESTBB [, INFLAG] - This
258  /// corresponds to the COND_BRANCH pseudo instruction. CRRC is the
259  /// condition register to branch on, OPC is the branch opcode to use (e.g.
260  /// PPC::BLE), DESTBB is the destination block to branch to, and INFLAG is
261  /// an optional input flag argument.
263 
264  /// CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based
265  /// loops.
268 
269  /// F8RC = FADDRTZ F8RC, F8RC - This is an FADD done with rounding
270  /// towards zero. Used only as part of the long double-to-int
271  /// conversion sequence.
273 
274  /// F8RC = MFFS - This moves the FPSCR (not modeled) into the register.
276 
277  /// TC_RETURN - A tail call return.
278  /// operand #0 chain
279  /// operand #1 callee (register or absolute)
280  /// operand #2 stack adjustment
281  /// operand #3 optional in flag
283 
284  /// ch, gl = CR6[UN]SET ch, inglue - Toggle CR bit 6 for SVR4 vararg calls
287 
288  /// GPRC = address of _GLOBAL_OFFSET_TABLE_. Used by initial-exec TLS
289  /// for non-position independent code on PPC32.
291 
292  /// GPRC = address of _GLOBAL_OFFSET_TABLE_. Used by general dynamic and
293  /// local dynamic TLS and position indendepent code on PPC32.
295 
296  /// G8RC = ADDIS_GOT_TPREL_HA %x2, Symbol - Used by the initial-exec
297  /// TLS model, produces an ADDIS8 instruction that adds the GOT
298  /// base to sym\@got\@tprel\@ha.
300 
301  /// G8RC = LD_GOT_TPREL_L Symbol, G8RReg - Used by the initial-exec
302  /// TLS model, produces a LD instruction with base register G8RReg
303  /// and offset sym\@got\@tprel\@l. This completes the addition that
304  /// finds the offset of "sym" relative to the thread pointer.
306 
307  /// G8RC = ADD_TLS G8RReg, Symbol - Used by the initial-exec TLS
308  /// model, produces an ADD instruction that adds the contents of
309  /// G8RReg to the thread pointer. Symbol contains a relocation
310  /// sym\@tls which is to be replaced by the thread pointer and
311  /// identifies to the linker that the instruction is part of a
312  /// TLS sequence.
314 
315  /// G8RC = ADDIS_TLSGD_HA %x2, Symbol - For the general-dynamic TLS
316  /// model, produces an ADDIS8 instruction that adds the GOT base
317  /// register to sym\@got\@tlsgd\@ha.
319 
320  /// %x3 = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS
321  /// model, produces an ADDI8 instruction that adds G8RReg to
322  /// sym\@got\@tlsgd\@l and stores the result in X3. Hidden by
323  /// ADDIS_TLSGD_L_ADDR until after register assignment.
325 
326  /// %x3 = GET_TLS_ADDR %x3, Symbol - For the general-dynamic TLS
327  /// model, produces a call to __tls_get_addr(sym\@tlsgd). Hidden by
328  /// ADDIS_TLSGD_L_ADDR until after register assignment.
330 
331  /// G8RC = ADDI_TLSGD_L_ADDR G8RReg, Symbol, Symbol - Op that
332  /// combines ADDI_TLSGD_L and GET_TLS_ADDR until expansion following
333  /// register assignment.
335 
336  /// G8RC = ADDIS_TLSLD_HA %x2, Symbol - For the local-dynamic TLS
337  /// model, produces an ADDIS8 instruction that adds the GOT base
338  /// register to sym\@got\@tlsld\@ha.
340 
341  /// %x3 = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS
342  /// model, produces an ADDI8 instruction that adds G8RReg to
343  /// sym\@got\@tlsld\@l and stores the result in X3. Hidden by
344  /// ADDIS_TLSLD_L_ADDR until after register assignment.
346 
347  /// %x3 = GET_TLSLD_ADDR %x3, Symbol - For the local-dynamic TLS
348  /// model, produces a call to __tls_get_addr(sym\@tlsld). Hidden by
349  /// ADDIS_TLSLD_L_ADDR until after register assignment.
351 
352  /// G8RC = ADDI_TLSLD_L_ADDR G8RReg, Symbol, Symbol - Op that
353  /// combines ADDI_TLSLD_L and GET_TLSLD_ADDR until expansion
354  /// following register assignment.
356 
357  /// G8RC = ADDIS_DTPREL_HA %x3, Symbol - For the local-dynamic TLS
358  /// model, produces an ADDIS8 instruction that adds X3 to
359  /// sym\@dtprel\@ha.
361 
362  /// G8RC = ADDI_DTPREL_L G8RReg, Symbol - For the local-dynamic TLS
363  /// model, produces an ADDI8 instruction that adds G8RReg to
364  /// sym\@got\@dtprel\@l.
366 
367  /// VRRC = VADD_SPLAT Elt, EltSize - Temporary node to be expanded
368  /// during instruction selection to optimize a BUILD_VECTOR into
369  /// operations on splats. This is necessary to avoid losing these
370  /// optimizations due to constant folding.
372 
373  /// CHAIN = SC CHAIN, Imm128 - System call. The 7-bit unsigned
374  /// operand identifies the operating system entry point.
375  SC,
376 
377  /// CHAIN = CLRBHRB CHAIN - Clear branch history rolling buffer.
379 
380  /// GPRC, CHAIN = MFBHRBE CHAIN, Entry, Dummy - Move from branch
381  /// history rolling buffer entry.
383 
384  /// CHAIN = RFEBB CHAIN, State - Return from event-based branch.
386 
387  /// VSRC, CHAIN = XXSWAPD CHAIN, VSRC - Occurs only for little
388  /// endian. Maps to an xxswapd instruction that corrects an lxvd2x
389  /// or stxvd2x instruction. The chain is necessary because the
390  /// sequence replaces a load and needs to provide the same number
391  /// of outputs.
393 
394  /// An SDNode for swaps that are not associated with any loads/stores
395  /// and thereby have no chain.
397 
398  /// An SDNode for Power9 vector absolute value difference.
399  /// operand #0 vector
400  /// operand #1 vector
401  /// operand #2 constant i32 0 or 1, to indicate whether needs to patch
402  /// the most significant bit for signed i32
403  ///
404  /// Power9 VABSD* instructions are designed to support unsigned integer
405  /// vectors (byte/halfword/word), if we want to make use of them for signed
406  /// integer vectors, we have to flip their sign bits first. To flip sign bit
407  /// for byte/halfword integer vector would become inefficient, but for word
408  /// integer vector, we can leverage XVNEGSP to make it efficiently. eg:
409  /// abs(sub(a,b)) => VABSDUW(a+0x80000000, b+0x80000000)
410  /// => VABSDUW((XVNEGSP a), (XVNEGSP b))
412 
413  /// QVFPERM = This corresponds to the QPX qvfperm instruction.
415 
416  /// QVGPCI = This corresponds to the QPX qvgpci instruction.
418 
419  /// QVALIGNI = This corresponds to the QPX qvaligni instruction.
421 
422  /// QVESPLATI = This corresponds to the QPX qvesplati instruction.
424 
425  /// QBFLT = Access the underlying QPX floating-point boolean
426  /// representation.
428 
429  /// FP_EXTEND_HALF(VECTOR, IDX) - Custom extend upper (IDX=0) half or
430  /// lower (IDX=1) half of v4f32 to v2f64.
432 
433  /// CHAIN = STBRX CHAIN, GPRC, Ptr, Type - This is a
434  /// byte-swapping store instruction. It byte-swaps the low "Type" bits of
435  /// the GPRC input, then stores it through Ptr. Type can be either i16 or
436  /// i32.
438 
439  /// GPRC, CHAIN = LBRX CHAIN, Ptr, Type - This is a
440  /// byte-swapping load instruction. It loads "Type" bits, byte swaps it,
441  /// then puts it in the bottom bits of the GPRC. TYPE can be either i16
442  /// or i32.
444 
445  /// STFIWX - The STFIWX instruction. The first operand is an input token
446  /// chain, then an f64 value to store, then an address to store it to.
448 
449  /// GPRC, CHAIN = LFIWAX CHAIN, Ptr - This is a floating-point
450  /// load which sign-extends from a 32-bit integer value into the
451  /// destination 64-bit register.
453 
454  /// GPRC, CHAIN = LFIWZX CHAIN, Ptr - This is a floating-point
455  /// load which zero-extends from a 32-bit integer value into the
456  /// destination 64-bit register.
458 
459  /// GPRC, CHAIN = LXSIZX, CHAIN, Ptr, ByteWidth - This is a load of an
460  /// integer smaller than 64 bits into a VSR. The integer is zero-extended.
461  /// This can be used for converting loaded integers to floating point.
463 
464  /// STXSIX - The STXSI[bh]X instruction. The first operand is an input
465  /// chain, then an f64 value to store, then an address to store it to,
466  /// followed by a byte-width for the store.
468 
469  /// VSRC, CHAIN = LXVD2X_LE CHAIN, Ptr - Occurs only for little endian.
470  /// Maps directly to an lxvd2x instruction that will be followed by
471  /// an xxswapd.
473 
474  /// VSRC, CHAIN = LOAD_VEC_BE CHAIN, Ptr - Occurs only for little endian.
475  /// Maps directly to one of lxvd2x/lxvw4x/lxvh8x/lxvb16x depending on
476  /// the vector type to load vector in big-endian element order.
478 
479  /// VSRC, CHAIN = LD_VSX_LH CHAIN, Ptr - This is a floating-point load of a
480  /// v2f32 value into the lower half of a VSR register.
482 
483  /// VSRC, CHAIN = LD_SPLAT, CHAIN, Ptr - a splatting load memory
484  /// instructions such as LXVDSX, LXVWSX.
486 
487  /// CHAIN = STXVD2X CHAIN, VSRC, Ptr - Occurs only for little endian.
488  /// Maps directly to an stxvd2x instruction that will be preceded by
489  /// an xxswapd.
491 
492  /// CHAIN = STORE_VEC_BE CHAIN, VSRC, Ptr - Occurs only for little endian.
493  /// Maps directly to one of stxvd2x/stxvw4x/stxvh8x/stxvb16x depending on
494  /// the vector type to store vector in big-endian element order.
496 
497  /// Store scalar integers from VSR.
499 
500  /// QBRC, CHAIN = QVLFSb CHAIN, Ptr
501  /// The 4xf32 load used for v4i1 constants.
503 
504  /// ATOMIC_CMP_SWAP - the exact same as the target-independent nodes
505  /// except they ensure that the compare input is zero-extended for
506  /// sub-word versions because the atomic loads zero-extend.
509 
510  /// GPRC = TOC_ENTRY GA, TOC
511  /// Loads the entry for GA from the TOC, where the TOC base is given by
512  /// the last operand.
514  };
515 
516  } // end namespace PPCISD
517 
518  /// Define some predicates that are used for node matching.
519  namespace PPC {
520 
521  /// isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a
522  /// VPKUHUM instruction.
523  bool isVPKUHUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind,
524  SelectionDAG &DAG);
525 
526  /// isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a
527  /// VPKUWUM instruction.
528  bool isVPKUWUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind,
529  SelectionDAG &DAG);
530 
531  /// isVPKUDUMShuffleMask - Return true if this is the shuffle mask for a
532  /// VPKUDUM instruction.
533  bool isVPKUDUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind,
534  SelectionDAG &DAG);
535 
536  /// isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for
537  /// a VRGL* instruction with the specified unit size (1,2 or 4 bytes).
538  bool isVMRGLShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize,
539  unsigned ShuffleKind, SelectionDAG &DAG);
540 
541  /// isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for
542  /// a VRGH* instruction with the specified unit size (1,2 or 4 bytes).
543  bool isVMRGHShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize,
544  unsigned ShuffleKind, SelectionDAG &DAG);
545 
546  /// isVMRGEOShuffleMask - Return true if this is a shuffle mask suitable for
547  /// a VMRGEW or VMRGOW instruction
548  bool isVMRGEOShuffleMask(ShuffleVectorSDNode *N, bool CheckEven,
549  unsigned ShuffleKind, SelectionDAG &DAG);
550  /// isXXSLDWIShuffleMask - Return true if this is a shuffle mask suitable
551  /// for a XXSLDWI instruction.
552  bool isXXSLDWIShuffleMask(ShuffleVectorSDNode *N, unsigned &ShiftElts,
553  bool &Swap, bool IsLE);
554 
555  /// isXXBRHShuffleMask - Return true if this is a shuffle mask suitable
556  /// for a XXBRH instruction.
558 
559  /// isXXBRWShuffleMask - Return true if this is a shuffle mask suitable
560  /// for a XXBRW instruction.
562 
563  /// isXXBRDShuffleMask - Return true if this is a shuffle mask suitable
564  /// for a XXBRD instruction.
566 
567  /// isXXBRQShuffleMask - Return true if this is a shuffle mask suitable
568  /// for a XXBRQ instruction.
570 
571  /// isXXPERMDIShuffleMask - Return true if this is a shuffle mask suitable
572  /// for a XXPERMDI instruction.
573  bool isXXPERMDIShuffleMask(ShuffleVectorSDNode *N, unsigned &ShiftElts,
574  bool &Swap, bool IsLE);
575 
576  /// isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the
577  /// shift amount, otherwise return -1.
578  int isVSLDOIShuffleMask(SDNode *N, unsigned ShuffleKind,
579  SelectionDAG &DAG);
580 
581  /// isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand
582  /// specifies a splat of a single element that is suitable for input to
583  /// VSPLTB/VSPLTH/VSPLTW.
584  bool isSplatShuffleMask(ShuffleVectorSDNode *N, unsigned EltSize);
585 
586  /// isXXINSERTWMask - Return true if this VECTOR_SHUFFLE can be handled by
587  /// the XXINSERTW instruction introduced in ISA 3.0. This is essentially any
588  /// shuffle of v4f32/v4i32 vectors that just inserts one element from one
589  /// vector into the other. This function will also set a couple of
590  /// output parameters for how much the source vector needs to be shifted and
591  /// what byte number needs to be specified for the instruction to put the
592  /// element in the desired location of the target vector.
593  bool isXXINSERTWMask(ShuffleVectorSDNode *N, unsigned &ShiftElts,
594  unsigned &InsertAtByte, bool &Swap, bool IsLE);
595 
596  /// getSplatIdxForPPCMnemonics - Return the splat index as a value that is
597  /// appropriate for PPC mnemonics (which have a big endian bias - namely
598  /// elements are counted from the left of the vector register).
599  unsigned getSplatIdxForPPCMnemonics(SDNode *N, unsigned EltSize,
600  SelectionDAG &DAG);
601 
602  /// get_VSPLTI_elt - If this is a build_vector of constants which can be
603  /// formed by using a vspltis[bhw] instruction of the specified element
604  /// size, return the constant being splatted. The ByteSize field indicates
605  /// the number of bytes of each element [124] -> [bhw].
606  SDValue get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG);
607 
608  /// If this is a qvaligni shuffle mask, return the shift
609  /// amount, otherwise return -1.
611 
612  } // end namespace PPC
613 
615  const PPCSubtarget &Subtarget;
616 
617  public:
618  explicit PPCTargetLowering(const PPCTargetMachine &TM,
619  const PPCSubtarget &STI);
620 
621  /// getTargetNodeName() - This method returns the name of a target specific
622  /// DAG node.
623  const char *getTargetNodeName(unsigned Opcode) const override;
624 
625  bool isSelectSupported(SelectSupportKind Kind) const override {
626  // PowerPC does not support scalar condition selects on vectors.
627  return (Kind != SelectSupportKind::ScalarCondVectorVal);
628  }
629 
630  /// getPreferredVectorAction - The code we generate when vector types are
631  /// legalized by promoting the integer element type is often much worse
632  /// than code we generate if we widen the type for applicable vector types.
633  /// The issue with promoting is that the vector is scalaraized, individual
634  /// elements promoted and then the vector is rebuilt. So say we load a pair
635  /// of v4i8's and shuffle them. This will turn into a mess of 8 extending
636  /// loads, moves back into VSR's (or memory ops if we don't have moves) and
637  /// then the VPERM for the shuffle. All in all a very slow sequence.
639  const override {
640  if (VT.getScalarSizeInBits() % 8 == 0)
641  return TypeWidenVector;
643  }
644 
645  bool useSoftFloat() const override;
646 
647  bool hasSPE() const;
648 
649  MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
650  return MVT::i32;
651  }
652 
653  bool isCheapToSpeculateCttz() const override {
654  return true;
655  }
656 
657  bool isCheapToSpeculateCtlz() const override {
658  return true;
659  }
660 
661  bool isCtlzFast() const override {
662  return true;
663  }
664 
665  bool isEqualityCmpFoldedWithSignedCmp() const override {
666  return false;
667  }
668 
669  bool hasAndNotCompare(SDValue) const override {
670  return true;
671  }
672 
673  bool preferIncOfAddToSubOfNot(EVT VT) const override;
674 
675  bool convertSetCCLogicToBitwiseLogic(EVT VT) const override {
676  return VT.isScalarInteger();
677  }
678 
679  bool supportSplitCSR(MachineFunction *MF) const override {
680  return
682  MF->getFunction().hasFnAttribute(Attribute::NoUnwind);
683  }
684 
685  void initializeSplitCSR(MachineBasicBlock *Entry) const override;
686 
687  void insertCopiesSplitCSR(
688  MachineBasicBlock *Entry,
689  const SmallVectorImpl<MachineBasicBlock *> &Exits) const override;
690 
691  /// getSetCCResultType - Return the ISD::SETCC ValueType
692  EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
693  EVT VT) const override;
694 
695  /// Return true if target always beneficiates from combining into FMA for a
696  /// given value type. This must typically return false on targets where FMA
697  /// takes more cycles to execute than FADD.
698  bool enableAggressiveFMAFusion(EVT VT) const override;
699 
700  /// getPreIndexedAddressParts - returns true by value, base pointer and
701  /// offset pointer and addressing mode by reference if the node's address
702  /// can be legally represented as pre-indexed load / store address.
703  bool getPreIndexedAddressParts(SDNode *N, SDValue &Base,
704  SDValue &Offset,
706  SelectionDAG &DAG) const override;
707 
708  /// SelectAddressEVXRegReg - Given the specified addressed, check to see if
709  /// it can be more efficiently represented as [r+imm].
710  bool SelectAddressEVXRegReg(SDValue N, SDValue &Base, SDValue &Index,
711  SelectionDAG &DAG) const;
712 
713  /// SelectAddressRegReg - Given the specified addressed, check to see if it
714  /// can be more efficiently represented as [r+imm]. If \p EncodingAlignment
715  /// is non-zero, only accept displacement which is not suitable for [r+imm].
716  /// Returns false if it can be represented by [r+imm], which are preferred.
717  bool SelectAddressRegReg(SDValue N, SDValue &Base, SDValue &Index,
718  SelectionDAG &DAG,
719  unsigned EncodingAlignment = 0) const;
720 
721  /// SelectAddressRegImm - Returns true if the address N can be represented
722  /// by a base register plus a signed 16-bit displacement [r+imm], and if it
723  /// is not better represented as reg+reg. If \p EncodingAlignment is
724  /// non-zero, only accept displacements suitable for instruction encoding
725  /// requirement, i.e. multiples of 4 for DS form.
726  bool SelectAddressRegImm(SDValue N, SDValue &Disp, SDValue &Base,
727  SelectionDAG &DAG,
728  unsigned EncodingAlignment) const;
729 
730  /// SelectAddressRegRegOnly - Given the specified addressed, force it to be
731  /// represented as an indexed [r+r] operation.
732  bool SelectAddressRegRegOnly(SDValue N, SDValue &Base, SDValue &Index,
733  SelectionDAG &DAG) const;
734 
735  Sched::Preference getSchedulingPreference(SDNode *N) const override;
736 
737  /// LowerOperation - Provide custom lowering hooks for some operations.
738  ///
739  SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
740 
741  /// ReplaceNodeResults - Replace the results of node with an illegal result
742  /// type with new values built out of custom code.
743  ///
744  void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results,
745  SelectionDAG &DAG) const override;
746 
747  SDValue expandVSXLoadForLE(SDNode *N, DAGCombinerInfo &DCI) const;
748  SDValue expandVSXStoreForLE(SDNode *N, DAGCombinerInfo &DCI) const;
749 
750  SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
751 
752  SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
753  SmallVectorImpl<SDNode *> &Created) const override;
754 
755  Register getRegisterByName(const char* RegName, LLT VT,
756  const MachineFunction &MF) const override;
757 
758  void computeKnownBitsForTargetNode(const SDValue Op,
759  KnownBits &Known,
760  const APInt &DemandedElts,
761  const SelectionDAG &DAG,
762  unsigned Depth = 0) const override;
763 
764  Align getPrefLoopAlignment(MachineLoop *ML) const override;
765 
766  bool shouldInsertFencesForAtomic(const Instruction *I) const override {
767  return true;
768  }
769 
770  Instruction *emitLeadingFence(IRBuilder<> &Builder, Instruction *Inst,
771  AtomicOrdering Ord) const override;
772  Instruction *emitTrailingFence(IRBuilder<> &Builder, Instruction *Inst,
773  AtomicOrdering Ord) const override;
774 
776  EmitInstrWithCustomInserter(MachineInstr &MI,
777  MachineBasicBlock *MBB) const override;
778  MachineBasicBlock *EmitAtomicBinary(MachineInstr &MI,
779  MachineBasicBlock *MBB,
780  unsigned AtomicSize,
781  unsigned BinOpcode,
782  unsigned CmpOpcode = 0,
783  unsigned CmpPred = 0) const;
784  MachineBasicBlock *EmitPartwordAtomicBinary(MachineInstr &MI,
785  MachineBasicBlock *MBB,
786  bool is8bit,
787  unsigned Opcode,
788  unsigned CmpOpcode = 0,
789  unsigned CmpPred = 0) const;
790 
791  MachineBasicBlock *emitEHSjLjSetJmp(MachineInstr &MI,
792  MachineBasicBlock *MBB) const;
793 
794  MachineBasicBlock *emitEHSjLjLongJmp(MachineInstr &MI,
795  MachineBasicBlock *MBB) const;
796 
797  ConstraintType getConstraintType(StringRef Constraint) const override;
798 
799  /// Examine constraint string and operand type and determine a weight value.
800  /// The operand object must already have been set up with the operand type.
801  ConstraintWeight getSingleConstraintMatchWeight(
802  AsmOperandInfo &info, const char *constraint) const override;
803 
804  std::pair<unsigned, const TargetRegisterClass *>
805  getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
806  StringRef Constraint, MVT VT) const override;
807 
808  /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
809  /// function arguments in the caller parameter area. This is the actual
810  /// alignment, not its logarithm.
811  unsigned getByValTypeAlignment(Type *Ty,
812  const DataLayout &DL) const override;
813 
814  /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
815  /// vector. If it is invalid, don't add anything to Ops.
816  void LowerAsmOperandForConstraint(SDValue Op,
817  std::string &Constraint,
818  std::vector<SDValue> &Ops,
819  SelectionDAG &DAG) const override;
820 
821  unsigned
822  getInlineAsmMemConstraint(StringRef ConstraintCode) const override {
823  if (ConstraintCode == "es")
825  else if (ConstraintCode == "o")
827  else if (ConstraintCode == "Q")
829  else if (ConstraintCode == "Z")
831  else if (ConstraintCode == "Zy")
833  return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
834  }
835 
836  /// isLegalAddressingMode - Return true if the addressing mode represented
837  /// by AM is legal for this target, for a load/store of the specified type.
838  bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM,
839  Type *Ty, unsigned AS,
840  Instruction *I = nullptr) const override;
841 
842  /// isLegalICmpImmediate - Return true if the specified immediate is legal
843  /// icmp immediate, that is the target has icmp instructions which can
844  /// compare a register against the immediate without having to materialize
845  /// the immediate into a register.
846  bool isLegalICmpImmediate(int64_t Imm) const override;
847 
848  /// isLegalAddImmediate - Return true if the specified immediate is legal
849  /// add immediate, that is the target has add instructions which can
850  /// add a register and the immediate without having to materialize
851  /// the immediate into a register.
852  bool isLegalAddImmediate(int64_t Imm) const override;
853 
854  /// isTruncateFree - Return true if it's free to truncate a value of
855  /// type Ty1 to type Ty2. e.g. On PPC it's free to truncate a i64 value in
856  /// register X1 to i32 by referencing its sub-register R1.
857  bool isTruncateFree(Type *Ty1, Type *Ty2) const override;
858  bool isTruncateFree(EVT VT1, EVT VT2) const override;
859 
860  bool isZExtFree(SDValue Val, EVT VT2) const override;
861 
862  bool isFPExtFree(EVT DestVT, EVT SrcVT) const override;
863 
864  /// Returns true if it is beneficial to convert a load of a constant
865  /// to just the constant itself.
866  bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
867  Type *Ty) const override;
868 
869  bool convertSelectOfConstantsToMath(EVT VT) const override {
870  return true;
871  }
872 
874  EVT VT) const override {
875  // Only handle float load/store pair because float(fpr) load/store
876  // instruction has more cycles than integer(gpr) load/store in PPC.
877  if (Opc != ISD::LOAD && Opc != ISD::STORE)
878  return false;
879  if (VT != MVT::f32 && VT != MVT::f64)
880  return false;
881 
882  return true;
883  }
884 
885  // Returns true if the address of the global is stored in TOC entry.
886  bool isAccessedAsGotIndirect(SDValue N) const;
887 
888  bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
889 
890  bool getTgtMemIntrinsic(IntrinsicInfo &Info,
891  const CallInst &I,
892  MachineFunction &MF,
893  unsigned Intrinsic) const override;
894 
895  /// getOptimalMemOpType - Returns the target specific optimal type for load
896  /// and store operations as a result of memset, memcpy, and memmove
897  /// lowering. If DstAlign is zero that means it's safe to destination
898  /// alignment can satisfy any constraint. Similarly if SrcAlign is zero it
899  /// means there isn't a need to check it against alignment requirement,
900  /// probably because the source does not need to be loaded. If 'IsMemset' is
901  /// true, that means it's expanding a memset. If 'ZeroMemset' is true, that
902  /// means it's a memset of zero. 'MemcpyStrSrc' indicates whether the memcpy
903  /// source is constant so it does not need to be loaded.
904  /// It returns EVT::Other if the type should be determined using generic
905  /// target-independent logic.
906  EVT
907  getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
908  bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc,
909  const AttributeList &FuncAttributes) const override;
910 
911  /// Is unaligned memory access allowed for the given type, and is it fast
912  /// relative to software emulation.
913  bool allowsMisalignedMemoryAccesses(
914  EVT VT, unsigned AddrSpace, unsigned Align = 1,
916  bool *Fast = nullptr) const override;
917 
918  /// isFMAFasterThanFMulAndFAdd - Return true if an FMA operation is faster
919  /// than a pair of fmul and fadd instructions. fmuladd intrinsics will be
920  /// expanded to FMAs when this method returns true, otherwise fmuladd is
921  /// expanded to fmul + fadd.
922  bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
923  EVT VT) const override;
924 
925  const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
926 
927  // Should we expand the build vector with shuffles?
928  bool
929  shouldExpandBuildVectorWithShuffles(EVT VT,
930  unsigned DefinedValues) const override;
931 
932  /// createFastISel - This method returns a target-specific FastISel object,
933  /// or null if the target does not support "fast" instruction selection.
935  const TargetLibraryInfo *LibInfo) const override;
936 
937  /// Returns true if an argument of type Ty needs to be passed in a
938  /// contiguous block of registers in calling convention CallConv.
940  Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override {
941  // We support any array type as "consecutive" block in the parameter
942  // save area. The element type defines the alignment requirement and
943  // whether the argument should go in GPRs, FPRs, or VRs if available.
944  //
945  // Note that clang uses this capability both to implement the ELFv2
946  // homogeneous float/vector aggregate ABI, and to avoid having to use
947  // "byval" when passing aggregates that might fully fit in registers.
948  return Ty->isArrayTy();
949  }
950 
951  /// If a physical register, this returns the register that receives the
952  /// exception address on entry to an EH pad.
953  unsigned
954  getExceptionPointerRegister(const Constant *PersonalityFn) const override;
955 
956  /// If a physical register, this returns the register that receives the
957  /// exception typeid on entry to a landing pad.
958  unsigned
959  getExceptionSelectorRegister(const Constant *PersonalityFn) const override;
960 
961  /// Override to support customized stack guard loading.
962  bool useLoadStackGuardNode() const override;
963  void insertSSPDeclarations(Module &M) const override;
964 
965  bool isFPImmLegal(const APFloat &Imm, EVT VT,
966  bool ForCodeSize) const override;
967 
968  unsigned getJumpTableEncoding() const override;
969  bool isJumpTableRelative() const override;
970  SDValue getPICJumpTableRelocBase(SDValue Table,
971  SelectionDAG &DAG) const override;
972  const MCExpr *getPICJumpTableRelocBaseExpr(const MachineFunction *MF,
973  unsigned JTI,
974  MCContext &Ctx) const override;
975 
976  private:
977  struct ReuseLoadInfo {
978  SDValue Ptr;
979  SDValue Chain;
980  SDValue ResChain;
981  MachinePointerInfo MPI;
982  bool IsDereferenceable = false;
983  bool IsInvariant = false;
984  unsigned Alignment = 0;
985  AAMDNodes AAInfo;
986  const MDNode *Ranges = nullptr;
987 
988  ReuseLoadInfo() = default;
989 
990  MachineMemOperand::Flags MMOFlags() const {
992  if (IsDereferenceable)
994  if (IsInvariant)
996  return F;
997  }
998  };
999 
1000  bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
1001  // Addrspacecasts are always noops.
1002  return true;
1003  }
1004 
1005  bool canReuseLoadAddress(SDValue Op, EVT MemVT, ReuseLoadInfo &RLI,
1006  SelectionDAG &DAG,
1007  ISD::LoadExtType ET = ISD::NON_EXTLOAD) const;
1008  void spliceIntoChain(SDValue ResChain, SDValue NewResChain,
1009  SelectionDAG &DAG) const;
1010 
1011  void LowerFP_TO_INTForReuse(SDValue Op, ReuseLoadInfo &RLI,
1012  SelectionDAG &DAG, const SDLoc &dl) const;
1013  SDValue LowerFP_TO_INTDirectMove(SDValue Op, SelectionDAG &DAG,
1014  const SDLoc &dl) const;
1015 
1016  bool directMoveIsProfitable(const SDValue &Op) const;
1017  SDValue LowerINT_TO_FPDirectMove(SDValue Op, SelectionDAG &DAG,
1018  const SDLoc &dl) const;
1019 
1020  SDValue LowerINT_TO_FPVector(SDValue Op, SelectionDAG &DAG,
1021  const SDLoc &dl) const;
1022 
1023  SDValue LowerTRUNCATEVector(SDValue Op, SelectionDAG &DAG) const;
1024 
1025  SDValue getFramePointerFrameIndex(SelectionDAG & DAG) const;
1026  SDValue getReturnAddrFrameIndex(SelectionDAG & DAG) const;
1027 
1028  bool
1029  IsEligibleForTailCallOptimization(SDValue Callee,
1030  CallingConv::ID CalleeCC,
1031  bool isVarArg,
1033  SelectionDAG& DAG) const;
1034 
1035  bool
1036  IsEligibleForTailCallOptimization_64SVR4(
1037  SDValue Callee,
1038  CallingConv::ID CalleeCC,
1039  ImmutableCallSite CS,
1040  bool isVarArg,
1041  const SmallVectorImpl<ISD::OutputArg> &Outs,
1042  const SmallVectorImpl<ISD::InputArg> &Ins,
1043  SelectionDAG& DAG) const;
1044 
1045  SDValue EmitTailCallLoadFPAndRetAddr(SelectionDAG &DAG, int SPDiff,
1046  SDValue Chain, SDValue &LROpOut,
1047  SDValue &FPOpOut,
1048  const SDLoc &dl) const;
1049 
1050  SDValue getTOCEntry(SelectionDAG &DAG, const SDLoc &dl, SDValue GA) const;
1051 
1052  SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
1053  SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
1054  SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
1055  SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
1056  SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
1057  SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
1058  SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
1059  SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
1060  SDValue LowerINIT_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const;
1062  SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const;
1063  SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) const;
1064  SDValue LowerVACOPY(SDValue Op, SelectionDAG &DAG) const;
1065  SDValue LowerSTACKRESTORE(SDValue Op, SelectionDAG &DAG) const;
1066  SDValue LowerGET_DYNAMIC_AREA_OFFSET(SDValue Op, SelectionDAG &DAG) const;
1068  SDValue LowerEH_DWARF_CFA(SDValue Op, SelectionDAG &DAG) const;
1069  SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
1070  SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
1071  SDValue LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const;
1072  SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
1073  SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG,
1074  const SDLoc &dl) const;
1075  SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
1076  SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const;
1077  SDValue LowerSHL_PARTS(SDValue Op, SelectionDAG &DAG) const;
1078  SDValue LowerSRL_PARTS(SDValue Op, SelectionDAG &DAG) const;
1079  SDValue LowerSRA_PARTS(SDValue Op, SelectionDAG &DAG) const;
1080  SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
1082  SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
1084  SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
1085  SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
1086  SDValue LowerREM(SDValue Op, SelectionDAG &DAG) const;
1087  SDValue LowerBSWAP(SDValue Op, SelectionDAG &DAG) const;
1088  SDValue LowerATOMIC_CMP_SWAP(SDValue Op, SelectionDAG &DAG) const;
1090  SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const;
1091  SDValue LowerMUL(SDValue Op, SelectionDAG &DAG) const;
1092  SDValue LowerABS(SDValue Op, SelectionDAG &DAG) const;
1093  SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const;
1094 
1095  SDValue LowerVectorLoad(SDValue Op, SelectionDAG &DAG) const;
1096  SDValue LowerVectorStore(SDValue Op, SelectionDAG &DAG) const;
1097 
1098  SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
1099  CallingConv::ID CallConv, bool isVarArg,
1100  const SmallVectorImpl<ISD::InputArg> &Ins,
1101  const SDLoc &dl, SelectionDAG &DAG,
1102  SmallVectorImpl<SDValue> &InVals) const;
1103  SDValue FinishCall(CallingConv::ID CallConv, const SDLoc &dl,
1104  bool isTailCall, bool isVarArg, bool isPatchPoint,
1105  bool hasNest, SelectionDAG &DAG,
1106  SmallVector<std::pair<unsigned, SDValue>, 8> &RegsToPass,
1107  SDValue InFlag, SDValue Chain, SDValue CallSeqStart,
1108  SDValue &Callee, int SPDiff, unsigned NumBytes,
1109  const SmallVectorImpl<ISD::InputArg> &Ins,
1110  SmallVectorImpl<SDValue> &InVals,
1111  ImmutableCallSite CS) const;
1112 
1113  SDValue
1114  LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1115  const SmallVectorImpl<ISD::InputArg> &Ins,
1116  const SDLoc &dl, SelectionDAG &DAG,
1117  SmallVectorImpl<SDValue> &InVals) const override;
1118 
1120  SmallVectorImpl<SDValue> &InVals) const override;
1121 
1122  bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
1123  bool isVarArg,
1124  const SmallVectorImpl<ISD::OutputArg> &Outs,
1125  LLVMContext &Context) const override;
1126 
1127  SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1128  const SmallVectorImpl<ISD::OutputArg> &Outs,
1129  const SmallVectorImpl<SDValue> &OutVals,
1130  const SDLoc &dl, SelectionDAG &DAG) const override;
1131 
1132  SDValue extendArgForPPC64(ISD::ArgFlagsTy Flags, EVT ObjectVT,
1133  SelectionDAG &DAG, SDValue ArgVal,
1134  const SDLoc &dl) const;
1135 
1136  SDValue LowerFormalArguments_AIX(
1137  SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1138  const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl,
1139  SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const;
1140  SDValue LowerFormalArguments_Darwin(
1141  SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1142  const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl,
1143  SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const;
1144  SDValue LowerFormalArguments_64SVR4(
1145  SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1146  const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl,
1147  SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const;
1148  SDValue LowerFormalArguments_32SVR4(
1149  SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
1150  const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl,
1151  SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const;
1152 
1153  SDValue createMemcpyOutsideCallSeq(SDValue Arg, SDValue PtrOff,
1154  SDValue CallSeqStart,
1155  ISD::ArgFlagsTy Flags, SelectionDAG &DAG,
1156  const SDLoc &dl) const;
1157 
1158  SDValue LowerCall_Darwin(SDValue Chain, SDValue Callee,
1159  CallingConv::ID CallConv, bool isVarArg,
1160  bool isTailCall, bool isPatchPoint,
1161  const SmallVectorImpl<ISD::OutputArg> &Outs,
1162  const SmallVectorImpl<SDValue> &OutVals,
1163  const SmallVectorImpl<ISD::InputArg> &Ins,
1164  const SDLoc &dl, SelectionDAG &DAG,
1165  SmallVectorImpl<SDValue> &InVals,
1166  ImmutableCallSite CS) const;
1167  SDValue LowerCall_64SVR4(SDValue Chain, SDValue Callee,
1168  CallingConv::ID CallConv, bool isVarArg,
1169  bool isTailCall, bool isPatchPoint,
1170  const SmallVectorImpl<ISD::OutputArg> &Outs,
1171  const SmallVectorImpl<SDValue> &OutVals,
1172  const SmallVectorImpl<ISD::InputArg> &Ins,
1173  const SDLoc &dl, SelectionDAG &DAG,
1174  SmallVectorImpl<SDValue> &InVals,
1175  ImmutableCallSite CS) const;
1176  SDValue LowerCall_32SVR4(SDValue Chain, SDValue Callee,
1177  CallingConv::ID CallConv, bool isVarArg,
1178  bool isTailCall, bool isPatchPoint,
1179  const SmallVectorImpl<ISD::OutputArg> &Outs,
1180  const SmallVectorImpl<SDValue> &OutVals,
1181  const SmallVectorImpl<ISD::InputArg> &Ins,
1182  const SDLoc &dl, SelectionDAG &DAG,
1183  SmallVectorImpl<SDValue> &InVals,
1184  ImmutableCallSite CS) const;
1185  SDValue LowerCall_AIX(SDValue Chain, SDValue Callee,
1186  CallingConv::ID CallConv, bool isVarArg,
1187  bool isTailCall, bool isPatchPoint,
1188  const SmallVectorImpl<ISD::OutputArg> &Outs,
1189  const SmallVectorImpl<SDValue> &OutVals,
1190  const SmallVectorImpl<ISD::InputArg> &Ins,
1191  const SDLoc &dl, SelectionDAG &DAG,
1192  SmallVectorImpl<SDValue> &InVals,
1193  ImmutableCallSite CS) const;
1194 
1195  SDValue lowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
1196  SDValue lowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
1197  SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
1198 
1199  SDValue DAGCombineExtBoolTrunc(SDNode *N, DAGCombinerInfo &DCI) const;
1200  SDValue DAGCombineBuildVector(SDNode *N, DAGCombinerInfo &DCI) const;
1201  SDValue DAGCombineTruncBoolExt(SDNode *N, DAGCombinerInfo &DCI) const;
1202  SDValue combineStoreFPToInt(SDNode *N, DAGCombinerInfo &DCI) const;
1203  SDValue combineFPToIntToFP(SDNode *N, DAGCombinerInfo &DCI) const;
1204  SDValue combineSHL(SDNode *N, DAGCombinerInfo &DCI) const;
1205  SDValue combineSRA(SDNode *N, DAGCombinerInfo &DCI) const;
1206  SDValue combineSRL(SDNode *N, DAGCombinerInfo &DCI) const;
1207  SDValue combineMUL(SDNode *N, DAGCombinerInfo &DCI) const;
1208  SDValue combineADD(SDNode *N, DAGCombinerInfo &DCI) const;
1209  SDValue combineTRUNCATE(SDNode *N, DAGCombinerInfo &DCI) const;
1210  SDValue combineSetCC(SDNode *N, DAGCombinerInfo &DCI) const;
1211  SDValue combineABS(SDNode *N, DAGCombinerInfo &DCI) const;
1212  SDValue combineVSelect(SDNode *N, DAGCombinerInfo &DCI) const;
1213  SDValue combineVReverseMemOP(ShuffleVectorSDNode *SVN, LSBaseSDNode *LSBase,
1214  DAGCombinerInfo &DCI) const;
1215 
1216  /// ConvertSETCCToSubtract - looks at SETCC that compares ints. It replaces
1217  /// SETCC with integer subtraction when (1) there is a legal way of doing it
1218  /// (2) keeping the result of comparison in GPR has performance benefit.
1219  SDValue ConvertSETCCToSubtract(SDNode *N, DAGCombinerInfo &DCI) const;
1220 
1221  SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled,
1222  int &RefinementSteps, bool &UseOneConstNR,
1223  bool Reciprocal) const override;
1224  SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled,
1225  int &RefinementSteps) const override;
1226  unsigned combineRepeatedFPDivisors() const override;
1227 
1228  SDValue
1229  combineElementTruncationToVectorTruncation(SDNode *N,
1230  DAGCombinerInfo &DCI) const;
1231 
1232  /// lowerToVINSERTH - Return the SDValue if this VECTOR_SHUFFLE can be
1233  /// handled by the VINSERTH instruction introduced in ISA 3.0. This is
1234  /// essentially any shuffle of v8i16 vectors that just inserts one element
1235  /// from one vector into the other.
1236  SDValue lowerToVINSERTH(ShuffleVectorSDNode *N, SelectionDAG &DAG) const;
1237 
1238  /// lowerToVINSERTB - Return the SDValue if this VECTOR_SHUFFLE can be
1239  /// handled by the VINSERTB instruction introduced in ISA 3.0. This is
1240  /// essentially v16i8 vector version of VINSERTH.
1241  SDValue lowerToVINSERTB(ShuffleVectorSDNode *N, SelectionDAG &DAG) const;
1242 
1243  // Return whether the call instruction can potentially be optimized to a
1244  // tail call. This will cause the optimizers to attempt to move, or
1245  // duplicate return instructions to help enable tail call optimizations.
1246  bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
1247  bool hasBitPreservingFPLogic(EVT VT) const override;
1248  bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override;
1249  }; // end class PPCTargetLowering
1250 
1251  namespace PPC {
1252 
1254  const TargetLibraryInfo *LibInfo);
1255 
1256  } // end namespace PPC
1257 
1258  bool isIntS16Immediate(SDNode *N, int16_t &Imm);
1259  bool isIntS16Immediate(SDValue Op, int16_t &Imm);
1260 
1261 } // end namespace llvm
1262 
1263 #endif // LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
G8RC = ADDI_TLSLD_L_ADDR G8RReg, Symbol, Symbol - Op that combines ADDI_TLSLD_L and GET_TLSLD_ADDR un...
x3 = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS model, produces an ADDI8 instruction tha...
static SDValue LowerADJUST_TRAMPOLINE(SDValue Op, SelectionDAG &DAG)
static SDValue LowerCallResult(SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
BUILTIN_OP_END - This must be the last enum value in this list.
Definition: ISDOpcodes.h:943
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
bool isSelectSupported(SelectSupportKind Kind) const override
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
FastISel * createFastISel(FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo)
Return with a flag operand, matched by &#39;blr&#39;.
Newer FCTI[D,W]UZ floating-point-to-integer conversion instructions for unsigned integers with round ...
SDValue get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG)
get_VSPLTI_elt - If this is a build_vector of constants which can be formed by using a vspltis[bhw] i...
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
getPreferredVectorAction - The code we generate when vector types are legalized by promoting the inte...
GPRC, CHAIN = LBRX CHAIN, Ptr, Type - This is a byte-swapping load instruction.
static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
LLVMContext & Context
QVFPERM = This corresponds to the QPX qvfperm instruction.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool isDesirableToTransformToIntegerOp(unsigned Opc, EVT VT) const override
Return true if it is profitable for dag combiner to transform a floating point op of specified opcode...
GPRC = address of GLOBAL_OFFSET_TABLE.
G8RC = ADDI_DTPREL_L G8RReg, Symbol - For the local-dynamic TLS model, produces an ADDI8 instruction ...
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:66
static SDValue LowerVACOPY(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
Extract SPE register component, second argument is high or low.
The following two target-specific nodes are used for calls through function pointers in the 64-bit SV...
VRRC = VADD_SPLAT Elt, EltSize - Temporary node to be expanded during instruction selection to optimi...
bool isXXINSERTWMask(ShuffleVectorSDNode *N, unsigned &ShiftElts, unsigned &InsertAtByte, bool &Swap, bool IsLE)
isXXINSERTWMask - Return true if this VECTOR_SHUFFLE can be handled by the XXINSERTW instruction intr...
static SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
Definition: ValueTypes.h:146
This class represents a function call, abstracting a target machine&#39;s calling convention.
This file contains the declarations for metadata subclasses.
QBRC, CHAIN = QVLFSb CHAIN, Ptr The 4xf32 load used for v4i1 constants.
bool isXXSLDWIShuffleMask(ShuffleVectorSDNode *N, unsigned &ShiftElts, bool &Swap, bool IsLE)
isXXSLDWIShuffleMask - Return true if this is a shuffle mask suitable for a XXSLDWI instruction...
Function Alias Analysis Results
CHAIN = RFEBB CHAIN, State - Return from event-based branch.
VEXTS, ByteWidth - takes an input in VSFRC and produces an output in VSFRC that is sign-extended from...
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition: Function.h:323
bool hasAndNotCompare(SDValue) const override
Return true if the target should transform: (X & Y) == Y —> (~X & Y) == 0 (X & Y) != Y —> (~X & Y) ...
unsigned const TargetRegisterInfo * TRI
Metadata node.
Definition: Metadata.h:872
F(f)
bool convertSelectOfConstantsToMath(EVT VT) const override
Return true if a select of constants (select Cond, C1, C2) should be transformed into simple math ops...
CALL - A direct function call.
CHAIN,FLAG = BCTRL(CHAIN, INFLAG) - Directly corresponds to a BCTRL instruction.
bool isVPKUDUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG)
isVPKUDUMShuffleMask - Return true if this is the shuffle mask for a VPKUDUM instruction.
Floating-point-to-interger conversion instructions.
Newer FCFID[US] integer-to-floating-point conversion instructions for unsigned integers and single-pr...
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
bool isVPKUHUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG)
isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a VPKUHUM instruction.
GlobalBaseReg - On Darwin, this node represents the result of the mflr at function entry...
BUILD_SPE64 and EXTRACT_SPE are analogous to BUILD_PAIR and EXTRACT_ELEMENT but take f64 arguments in...
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
unsigned getSplatIdxForPPCMnemonics(SDNode *N, unsigned EltSize, SelectionDAG &DAG)
getSplatIdxForPPCMnemonics - Return the splat index as a value that is appropriate for PPC mnemonics ...
G8RC = ADDI_TLSGD_L_ADDR G8RReg, Symbol, Symbol - Op that combines ADDI_TLSGD_L and GET_TLS_ADDR unti...
Base class for LoadSDNode and StoreSDNode.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override
EVT is not used in-tree, but is used by out-of-tree target.
This file contains the simple types necessary to represent the attributes associated with functions a...
static SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
The memory access is dereferenceable (i.e., doesn&#39;t trap).
static SDValue LowerMUL(SDValue Op, SelectionDAG &DAG)
Direct move from a GPR to a VSX register (algebraic)
x3 = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS model, produces an ADDI8 instruction t...
bool shouldInsertFencesForAtomic(const Instruction *I) const override
Whether AtomicExpandPass should automatically insert fences and reduce ordering for this atomic...
ATOMIC_CMP_SWAP - the exact same as the target-independent nodes except they ensure that the compare ...
QVALIGNI = This corresponds to the QPX qvaligni instruction.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
AtomicOrdering
Atomic ordering for LLVM&#39;s memory model.
Context object for machine code objects.
Definition: MCContext.h:65
bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override
Returns true if an argument of type Ty needs to be passed in a contiguous block of registers in calli...
bool isSplatShuffleMask(ShuffleVectorSDNode *N, unsigned EltSize)
isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand specifies a splat of a singl...
This is a fast-path instruction selection class that generates poor code and doesn&#39;t support illegal ...
Definition: FastISel.h:66
An SDNode for Power9 vector absolute value difference.
bool isEqualityCmpFoldedWithSignedCmp() const override
Return true if instruction generated for equality comparison is folded with instruction generated for...
CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based loops.
R32 = MFOCRF(CRREG, INFLAG) - Represents the MFOCRF instruction.
G8RC = ADDIS_TLSGD_HA x2, Symbol - For the general-dynamic TLS model, produces an ADDIS8 instruction ...
This contains information for each constraint that we are lowering.
CHAIN = STXVD2X CHAIN, VSRC, Ptr - Occurs only for little endian.
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
bool isVMRGLShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize, unsigned ShuffleKind, SelectionDAG &DAG)
isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for a VRGL* instruction with the ...
Analysis containing CSE Info
Definition: CSEInfo.cpp:25
VSRC, CHAIN = LD_SPLAT, CHAIN, Ptr - a splatting load memory instructions such as LXVDSX...
This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to compute an offset from native ...
bool isXXBRWShuffleMask(ShuffleVectorSDNode *N)
isXXBRWShuffleMask - Return true if this is a shuffle mask suitable for a XXBRW instruction.
VSRC, CHAIN = LXVD2X_LE CHAIN, Ptr - Occurs only for little endian.
static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG)
FSEL - Traditional three-operand fsel node.
bool isXXBRQShuffleMask(ShuffleVectorSDNode *N)
isXXBRQShuffleMask - Return true if this is a shuffle mask suitable for a XXBRQ instruction.
Machine Value Type.
static SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG)
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:63
XSMAXCDP, XSMINCDP - C-type min/max instructions.
ch, gl = CR6[UN]SET ch, inglue - Toggle CR bit 6 for SVR4 vararg calls
static Value * LowerBSWAP(LLVMContext &Context, Value *V, Instruction *IP)
Emit the code to lower bswap of V before the specified instruction IP.
This is an important base class in LLVM.
Definition: Constant.h:41
G8RC = ADDIS_DTPREL_HA x3, Symbol - For the local-dynamic TLS model, produces an ADDIS8 instruction t...
SExtVElems, takes an input vector of a smaller type and sign extends to an output vector of a larger ...
VECINSERT - The PPC vector insert instruction.
Direct move from a VSX register to a GPR.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
Definition: ISDOpcodes.h:1022
CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a MTCTR instruction.
STFIWX - The STFIWX instruction.
FCFID - The FCFID instruction, taking an f64 operand and producing and f64 value containing the FP re...
Store scalar integers from VSR.
bool isVPKUWUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG)
isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a VPKUWUM instruction.
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
CHAIN = CLRBHRB CHAIN - Clear branch history rolling buffer.
GPRC, CHAIN = LFIWAX CHAIN, Ptr - This is a floating-point load which sign-extends from a 32-bit inte...
G8RC = ADDIS_TLSLD_HA x2, Symbol - For the local-dynamic TLS model, produces an ADDIS8 instruction th...
static SDValue combineSetCC(SDNode *N, SelectionDAG &DAG, const X86Subtarget &Subtarget)
G8RC = LD_GOT_TPREL_L Symbol, G8RReg - Used by the initial-exec TLS model, produces a LD instruction ...
QVESPLATI = This corresponds to the QPX qvesplati instruction.
VSRC, CHAIN = LOAD_VEC_BE CHAIN, Ptr - Occurs only for little endian.
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
lazy value info
Common code between 32-bit and 64-bit PowerPC targets.
int isVSLDOIShuffleMask(SDNode *N, unsigned ShuffleKind, SelectionDAG &DAG)
isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the shift amount, otherwise return -1...
bool supportSplitCSR(MachineFunction *MF) const override
Return true if the target supports that a subset of CSRs for the given machine function is handled ex...
Extended Value Type.
Definition: ValueTypes.h:34
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This structure contains all information that is necessary for lowering calls.
This class contains a discriminated union of information about pointers in memory operands...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:40
bool isXXBRDShuffleMask(ShuffleVectorSDNode *N)
isXXBRDShuffleMask - Return true if this is a shuffle mask suitable for a XXBRD instruction.
CHAIN,FLAG = BCTRL(CHAIN, ADDR, INFLAG) - The combination of a bctrl instruction and the TOC reload r...
GPRC, CHAIN = LXSIZX, CHAIN, Ptr, ByteWidth - This is a load of an integer smaller than 64 bits into ...
FP_EXTEND_HALF(VECTOR, IDX) - Custom extend upper (IDX=0) half or lower (IDX=1) half of v4f32 to v2f6...
Extract a subvector from unsigned integer vector and convert to FP.
QBFLT = Access the underlying QPX floating-point boolean representation.
EXTSWSLI = The PPC extswsli instruction, which does an extend-sign word and shift left immediate...
static SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG)
x3 = GET_TLSLD_ADDR x3, Symbol - For the local-dynamic TLS model, produces a call to __tls_get_addr(s...
GPRC = TOC_ENTRY GA, TOC Loads the entry for GA from the TOC, where the TOC base is given by the last...
XXSPLT - The PPC VSX splat instructions.
VECSHL - The PPC vector shift left instruction.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition: Function.h:212
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:223
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:837
G8RC = ADD_TLS G8RReg, Symbol - Used by the initial-exec TLS model, produces an ADD instruction that ...
bool convertSetCCLogicToBitwiseLogic(EVT VT) const override
Use bitwise logic to make pairs of compares more efficient.
Provides information about what library functions are available for the current target.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:644
CHAIN = SC CHAIN, Imm128 - System call.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
TypeSize getScalarSizeInBits() const
x3 = GET_TLS_ADDR x3, Symbol - For the general-dynamic TLS model, produces a call to __tls_get_addr(s...
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
static const int FIRST_TARGET_MEMORY_OPCODE
FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations which do not reference a specific me...
Definition: ISDOpcodes.h:955
Represents one node in the SelectionDAG.
VPERM - The PPC VPERM Instruction.
bool isXXPERMDIShuffleMask(ShuffleVectorSDNode *N, unsigned &ShiftElts, bool &Swap, bool IsLE)
isXXPERMDIShuffleMask - Return true if this is a shuffle mask suitable for a XXPERMDI instruction...
static bool Enabled
Definition: Statistic.cpp:50
const Function & getFunction() const
Return the LLVM function that this machine code represents.
STXSIX - The STXSI[bh]X instruction.
G8RC = ADDIS_GOT_TPREL_HA x2, Symbol - Used by the initial-exec TLS model, produces an ADDIS8 instruc...
Class for arbitrary precision integers.
Definition: APInt.h:69
QVGPCI = This corresponds to the QPX qvgpci instruction.
amdgpu Simplify well known AMD library false FunctionCallee Callee
static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG)
static SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
The combination of sra[wd]i and addze used to implemented signed integer division by a power of 2...
Flags
Flags values. These may be or&#39;d together.
GPRC = address of GLOBAL_OFFSET_TABLE.
Representation of each machine instruction.
Definition: MachineInstr.h:63
GPRC, CHAIN = MFBHRBE CHAIN, Entry, Dummy - Move from branch history rolling buffer entry...
unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override
SelectSupportKind
Enum that describes what type of support for selects the target has.
Reciprocal estimate instructions (unary FP ops).
bool isVMRGEOShuffleMask(ShuffleVectorSDNode *N, bool CheckEven, unsigned ShuffleKind, SelectionDAG &DAG)
isVMRGEOShuffleMask - Return true if this is a shuffle mask suitable for a VMRGEW or VMRGOW instructi...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Definition: ISDOpcodes.h:672
F8RC = MFFS - This moves the FPSCR (not modeled) into the register.
Establish a view to a call site for examination.
Definition: CallSite.h:697
CHAIN = STORE_VEC_BE CHAIN, VSRC, Ptr - Occurs only for little endian.
#define I(x, y, z)
Definition: MD5.cpp:58
#define N
Direct move from a GPR to a VSX register (zero)
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
The CMPB instruction (takes two operands of i32 or i64).
The memory access always returns the same value (or traps).
CHAIN = STBRX CHAIN, GPRC, Ptr, Type - This is a byte-swapping store instruction. ...
uint32_t Size
Definition: Profile.cpp:46
TC_RETURN - A tail call return.
VSRC, CHAIN = XXSWAPD CHAIN, VSRC - Occurs only for little endian.
bool isCtlzFast() const override
Return true if ctlz instruction is fast.
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
i1 = ANDI_rec_1_[EQ|GT]_BIT(i32 or i64 x) - Represents the result of the eq or gt bit of CR0 after ex...
Direct move of 2 consecutive GPR to a VSX register.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
Definition: CallingConv.h:42
CHAIN = COND_BRANCH CHAIN, CRRC, OPC, DESTBB [, INFLAG] - This corresponds to the COND_BRANCH pseudo ...
static SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG)
These nodes represent PPC shifts.
VSRC, CHAIN = LD_VSX_LH CHAIN, Ptr - This is a floating-point load of a v2f32 value into the lower ha...
IRTranslator LLVM IR MI
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
Extract a subvector from signed integer vector and convert to FP.
RESVEC = VCMP(LHS, RHS, OPC) - Represents one of the altivec VCMP* instructions.
FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64 operand, producing an f64 value...
Hi/Lo - These represent the high and low 16-bit parts of a global address respectively.
bool isXXBRHShuffleMask(ShuffleVectorSDNode *N)
isXXBRHShuffleMask - Return true if this is a shuffle mask suitable for a XXBRH instruction.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const
Return the preferred vector type legalization action.
F8RC = FADDRTZ F8RC, F8RC - This is an FADD done with rounding towards zero.
An SDNode for swaps that are not associated with any loads/stores and thereby have no chain...
RESVEC, OUTFLAG = VCMPo(LHS, RHS, OPC) - Represents one of the altivec VCMP*o instructions.
GPRC, CHAIN = LFIWZX CHAIN, Ptr - This is a floating-point load which zero-extends from a 32-bit inte...
static SDValue LowerSCALAR_TO_VECTOR(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
bool isIntS16Immediate(SDNode *N, int16_t &Imm)
isIntS16Immediate - This method tests to see if the node is either a 32-bit or 64-bit immediate...
bool isVMRGHShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize, unsigned ShuffleKind, SelectionDAG &DAG)
isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for a VRGH* instruction with the ...
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
XXPERMDI - The PPC XXPERMDI instruction.
bool isArrayTy() const
True if this is an instance of ArrayType.
Definition: Type.h:221
This file describes how to lower LLVM code to machine code.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
Definition: ISDOpcodes.h:985
int isQVALIGNIShuffleMask(SDNode *N)
If this is a qvaligni shuffle mask, return the shift amount, otherwise return -1. ...