LLVM  15.0.0git
X86InstrInfo.h
Go to the documentation of this file.
1 //===-- X86InstrInfo.h - X86 Instruction Information ------------*- 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 contains the X86 implementation of the TargetInstrInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_X86_X86INSTRINFO_H
14 #define LLVM_LIB_TARGET_X86_X86INSTRINFO_H
15 
17 #include "X86InstrFMA3Info.h"
18 #include "X86RegisterInfo.h"
21 #include <vector>
22 
23 #define GET_INSTRINFO_HEADER
24 #include "X86GenInstrInfo.inc"
25 
26 namespace llvm {
27 class X86Subtarget;
28 
29 namespace X86 {
30 
32  // For instr that was compressed from EVEX to VEX.
34 };
35 
36 /// Return a pair of condition code for the given predicate and whether
37 /// the instruction operands should be swaped to match the condition code.
38 std::pair<CondCode, bool> getX86ConditionCode(CmpInst::Predicate Predicate);
39 
40 /// Return a cmov opcode for the given register size in bytes, and operand type.
41 unsigned getCMovOpcode(unsigned RegBytes, bool HasMemoryOperand = false);
42 
43 /// Return the source operand # for condition code by \p MCID. If the
44 /// instruction doesn't have a condition code, return -1.
45 int getCondSrcNoFromDesc(const MCInstrDesc &MCID);
46 
47 /// Return the condition code of the instruction. If the instruction doesn't
48 /// have a condition code, return X86::COND_INVALID.
50 
51 // Turn JCC instruction into condition code.
53 
54 // Turn SETCC instruction into condition code.
56 
57 // Turn CMOV instruction into condition code.
59 
60 /// GetOppositeBranchCondition - Return the inverse of the specified cond,
61 /// e.g. turning COND_E to COND_NE.
63 
64 /// Get the VPCMP immediate for the given condition.
66 
67 /// Get the VPCMP immediate if the opcodes are swapped.
68 unsigned getSwappedVPCMPImm(unsigned Imm);
69 
70 /// Get the VPCOM immediate if the opcodes are swapped.
71 unsigned getSwappedVPCOMImm(unsigned Imm);
72 
73 /// Get the VCMP immediate if the opcodes are swapped.
74 unsigned getSwappedVCMPImm(unsigned Imm);
75 
76 /// Check if the instruction is X87 instruction.
78 } // namespace X86
79 
80 /// isGlobalStubReference - Return true if the specified TargetFlag operand is
81 /// a reference to a stub for a global, not the global itself.
82 inline static bool isGlobalStubReference(unsigned char TargetFlag) {
83  switch (TargetFlag) {
84  case X86II::MO_DLLIMPORT: // dllimport stub.
85  case X86II::MO_GOTPCREL: // rip-relative GOT reference.
86  case X86II::MO_GOTPCREL_NORELAX: // rip-relative GOT reference.
87  case X86II::MO_GOT: // normal GOT reference.
88  case X86II::MO_DARWIN_NONLAZY_PIC_BASE: // Normal $non_lazy_ptr ref.
89  case X86II::MO_DARWIN_NONLAZY: // Normal $non_lazy_ptr ref.
90  case X86II::MO_COFFSTUB: // COFF .refptr stub.
91  return true;
92  default:
93  return false;
94  }
95 }
96 
97 /// isGlobalRelativeToPICBase - Return true if the specified global value
98 /// reference is relative to a 32-bit PIC base (X86ISD::GlobalBaseReg). If this
99 /// is true, the addressing mode has the PIC base register added in (e.g. EBX).
100 inline static bool isGlobalRelativeToPICBase(unsigned char TargetFlag) {
101  switch (TargetFlag) {
102  case X86II::MO_GOTOFF: // isPICStyleGOT: local global.
103  case X86II::MO_GOT: // isPICStyleGOT: other global.
104  case X86II::MO_PIC_BASE_OFFSET: // Darwin local global.
105  case X86II::MO_DARWIN_NONLAZY_PIC_BASE: // Darwin/32 external global.
106  case X86II::MO_TLVP: // ??? Pretty sure..
107  return true;
108  default:
109  return false;
110  }
111 }
112 
113 inline static bool isScale(const MachineOperand &MO) {
114  return MO.isImm() && (MO.getImm() == 1 || MO.getImm() == 2 ||
115  MO.getImm() == 4 || MO.getImm() == 8);
116 }
117 
118 inline static bool isLeaMem(const MachineInstr &MI, unsigned Op) {
119  if (MI.getOperand(Op).isFI())
120  return true;
121  return Op + X86::AddrSegmentReg <= MI.getNumOperands() &&
122  MI.getOperand(Op + X86::AddrBaseReg).isReg() &&
123  isScale(MI.getOperand(Op + X86::AddrScaleAmt)) &&
124  MI.getOperand(Op + X86::AddrIndexReg).isReg() &&
125  (MI.getOperand(Op + X86::AddrDisp).isImm() ||
126  MI.getOperand(Op + X86::AddrDisp).isGlobal() ||
127  MI.getOperand(Op + X86::AddrDisp).isCPI() ||
128  MI.getOperand(Op + X86::AddrDisp).isJTI());
129 }
130 
131 inline static bool isMem(const MachineInstr &MI, unsigned Op) {
132  if (MI.getOperand(Op).isFI())
133  return true;
134  return Op + X86::AddrNumOperands <= MI.getNumOperands() &&
135  MI.getOperand(Op + X86::AddrSegmentReg).isReg() && isLeaMem(MI, Op);
136 }
137 
138 class X86InstrInfo final : public X86GenInstrInfo {
139  X86Subtarget &Subtarget;
140  const X86RegisterInfo RI;
141 
142  virtual void anchor();
143 
144  bool AnalyzeBranchImpl(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
145  MachineBasicBlock *&FBB,
147  SmallVectorImpl<MachineInstr *> &CondBranches,
148  bool AllowModify) const;
149 
150 public:
151  explicit X86InstrInfo(X86Subtarget &STI);
152 
153  /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
154  /// such, whenever a client has an instance of instruction info, it should
155  /// always be able to get register info as well (through this method).
156  ///
157  const X86RegisterInfo &getRegisterInfo() const { return RI; }
158 
159  /// Returns the stack pointer adjustment that happens inside the frame
160  /// setup..destroy sequence (e.g. by pushes, or inside the callee).
161  int64_t getFrameAdjustment(const MachineInstr &I) const {
162  assert(isFrameInstr(I));
163  if (isFrameSetup(I))
164  return I.getOperand(2).getImm();
165  return I.getOperand(1).getImm();
166  }
167 
168  /// Sets the stack pointer adjustment made inside the frame made up by this
169  /// instruction.
170  void setFrameAdjustment(MachineInstr &I, int64_t V) const {
171  assert(isFrameInstr(I));
172  if (isFrameSetup(I))
173  I.getOperand(2).setImm(V);
174  else
175  I.getOperand(1).setImm(V);
176  }
177 
178  /// getSPAdjust - This returns the stack pointer adjustment made by
179  /// this instruction. For x86, we need to handle more complex call
180  /// sequences involving PUSHes.
181  int getSPAdjust(const MachineInstr &MI) const override;
182 
183  /// isCoalescableExtInstr - Return true if the instruction is a "coalescable"
184  /// extension instruction. That is, it's like a copy where it's legal for the
185  /// source to overlap the destination. e.g. X86::MOVSX64rr32. If this returns
186  /// true, then it's expected the pre-extension value is available as a subreg
187  /// of the result register. This also returns the sub-register index in
188  /// SubIdx.
189  bool isCoalescableExtInstr(const MachineInstr &MI, Register &SrcReg,
190  Register &DstReg, unsigned &SubIdx) const override;
191 
192  /// Returns true if the instruction has no behavior (specified or otherwise)
193  /// that is based on the value of any of its register operands
194  ///
195  /// Instructions are considered data invariant even if they set EFLAGS.
196  ///
197  /// A classical example of something that is inherently not data invariant is
198  /// an indirect jump -- the destination is loaded into icache based on the
199  /// bits set in the jump destination register.
200  ///
201  /// FIXME: This should become part of our instruction tables.
202  static bool isDataInvariant(MachineInstr &MI);
203 
204  /// Returns true if the instruction has no behavior (specified or otherwise)
205  /// that is based on the value loaded from memory or the value of any
206  /// non-address register operands.
207  ///
208  /// For example, if the latency of the instruction is dependent on the
209  /// particular bits set in any of the registers *or* any of the bits loaded
210  /// from memory.
211  ///
212  /// Instructions are considered data invariant even if they set EFLAGS.
213  ///
214  /// A classical example of something that is inherently not data invariant is
215  /// an indirect jump -- the destination is loaded into icache based on the
216  /// bits set in the jump destination register.
217  ///
218  /// FIXME: This should become part of our instruction tables.
219  static bool isDataInvariantLoad(MachineInstr &MI);
220 
221  unsigned isLoadFromStackSlot(const MachineInstr &MI,
222  int &FrameIndex) const override;
223  unsigned isLoadFromStackSlot(const MachineInstr &MI,
224  int &FrameIndex,
225  unsigned &MemBytes) const override;
226  /// isLoadFromStackSlotPostFE - Check for post-frame ptr elimination
227  /// stack locations as well. This uses a heuristic so it isn't
228  /// reliable for correctness.
229  unsigned isLoadFromStackSlotPostFE(const MachineInstr &MI,
230  int &FrameIndex) const override;
231 
232  unsigned isStoreToStackSlot(const MachineInstr &MI,
233  int &FrameIndex) const override;
234  unsigned isStoreToStackSlot(const MachineInstr &MI,
235  int &FrameIndex,
236  unsigned &MemBytes) const override;
237  /// isStoreToStackSlotPostFE - Check for post-frame ptr elimination
238  /// stack locations as well. This uses a heuristic so it isn't
239  /// reliable for correctness.
240  unsigned isStoreToStackSlotPostFE(const MachineInstr &MI,
241  int &FrameIndex) const override;
242 
244  AAResults *AA) const override;
246  Register DestReg, unsigned SubIdx,
247  const MachineInstr &Orig,
248  const TargetRegisterInfo &TRI) const override;
249 
250  /// Given an operand within a MachineInstr, insert preceding code to put it
251  /// into the right format for a particular kind of LEA instruction. This may
252  /// involve using an appropriate super-register instead (with an implicit use
253  /// of the original) or creating a new virtual register and inserting COPY
254  /// instructions to get the data into the right class.
255  ///
256  /// Reference parameters are set to indicate how caller should add this
257  /// operand to the LEA instruction.
258  bool classifyLEAReg(MachineInstr &MI, const MachineOperand &Src,
259  unsigned LEAOpcode, bool AllowSP, Register &NewSrc,
260  bool &isKill, MachineOperand &ImplicitOp,
261  LiveVariables *LV, LiveIntervals *LIS) const;
262 
263  /// convertToThreeAddress - This method must be implemented by targets that
264  /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target
265  /// may be able to convert a two-address instruction into a true
266  /// three-address instruction on demand. This allows the X86 target (for
267  /// example) to convert ADD and SHL instructions into LEA instructions if they
268  /// would require register copies due to two-addressness.
269  ///
270  /// This method returns a null pointer if the transformation cannot be
271  /// performed, otherwise it returns the new instruction.
272  ///
274  LiveIntervals *LIS) const override;
275 
276  /// Returns true iff the routine could find two commutable operands in the
277  /// given machine instruction.
278  /// The 'SrcOpIdx1' and 'SrcOpIdx2' are INPUT and OUTPUT arguments. Their
279  /// input values can be re-defined in this method only if the input values
280  /// are not pre-defined, which is designated by the special value
281  /// 'CommuteAnyOperandIndex' assigned to it.
282  /// If both of indices are pre-defined and refer to some operands, then the
283  /// method simply returns true if the corresponding operands are commutable
284  /// and returns false otherwise.
285  ///
286  /// For example, calling this method this way:
287  /// unsigned Op1 = 1, Op2 = CommuteAnyOperandIndex;
288  /// findCommutedOpIndices(MI, Op1, Op2);
289  /// can be interpreted as a query asking to find an operand that would be
290  /// commutable with the operand#1.
291  bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1,
292  unsigned &SrcOpIdx2) const override;
293 
294  /// Returns true if we have preference on the operands order in MI, the
295  /// commute decision is returned in Commute.
296  bool hasCommutePreference(MachineInstr &MI, bool &Commute) const override;
297 
298  /// Returns an adjusted FMA opcode that must be used in FMA instruction that
299  /// performs the same computations as the given \p MI but which has the
300  /// operands \p SrcOpIdx1 and \p SrcOpIdx2 commuted.
301  /// It may return 0 if it is unsafe to commute the operands.
302  /// Note that a machine instruction (instead of its opcode) is passed as the
303  /// first parameter to make it possible to analyze the instruction's uses and
304  /// commute the first operand of FMA even when it seems unsafe when you look
305  /// at the opcode. For example, it is Ok to commute the first operand of
306  /// VFMADD*SD_Int, if ONLY the lowest 64-bit element of the result is used.
307  ///
308  /// The returned FMA opcode may differ from the opcode in the given \p MI.
309  /// For example, commuting the operands #1 and #3 in the following FMA
310  /// FMA213 #1, #2, #3
311  /// results into instruction with adjusted opcode:
312  /// FMA231 #3, #2, #1
313  unsigned
314  getFMA3OpcodeToCommuteOperands(const MachineInstr &MI, unsigned SrcOpIdx1,
315  unsigned SrcOpIdx2,
316  const X86InstrFMA3Group &FMA3Group) const;
317 
318  // Branch analysis.
319  bool isUnconditionalTailCall(const MachineInstr &MI) const override;
321  const MachineInstr &TailCall) const override;
324  const MachineInstr &TailCall) const override;
325 
327  MachineBasicBlock *&FBB,
329  bool AllowModify) const override;
330 
333  const TargetRegisterInfo *TRI) const override;
334 
336  int64_t &ImmVal) const override;
337 
339  const Register NullValueReg,
340  const TargetRegisterInfo *TRI) const override;
341 
343  const MachineInstr &LdSt,
344  SmallVectorImpl<const MachineOperand *> &BaseOps, int64_t &Offset,
345  bool &OffsetIsScalable, unsigned &Width,
346  const TargetRegisterInfo *TRI) const override;
349  bool AllowModify = false) const override;
350 
352  int *BytesRemoved = nullptr) const override;
355  const DebugLoc &DL,
356  int *BytesAdded = nullptr) const override;
358  Register, Register, Register, int &, int &,
359  int &) const override;
361  const DebugLoc &DL, Register DstReg,
363  Register FalseReg) const override;
365  const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
366  bool KillSrc) const override;
369  bool isKill, int FrameIndex,
370  const TargetRegisterClass *RC,
371  const TargetRegisterInfo *TRI) const override;
372 
375  int FrameIndex, const TargetRegisterClass *RC,
376  const TargetRegisterInfo *TRI) const override;
377 
378  bool expandPostRAPseudo(MachineInstr &MI) const override;
379 
380  /// Check whether the target can fold a load that feeds a subreg operand
381  /// (or a subreg operand that feeds a store).
382  bool isSubregFoldable() const override { return true; }
383 
384  /// foldMemoryOperand - If this target supports it, fold a load or store of
385  /// the specified stack slot into the specified machine instruction for the
386  /// specified operand(s). If this is possible, the target should perform the
387  /// folding and return true, otherwise it should return false. If it folds
388  /// the instruction, it is likely that the MachineInstruction the iterator
389  /// references has been changed.
390  MachineInstr *
392  ArrayRef<unsigned> Ops,
394  LiveIntervals *LIS = nullptr,
395  VirtRegMap *VRM = nullptr) const override;
396 
397  /// foldMemoryOperand - Same as the previous version except it allows folding
398  /// of any load and store from / to any address, not just from a specific
399  /// stack slot.
402  MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
403  LiveIntervals *LIS = nullptr) const override;
404 
405  /// unfoldMemoryOperand - Separate a single instruction which folded a load or
406  /// a store or a load and a store into two or more instruction. If this is
407  /// possible, returns true as well as the new instructions by reference.
408  bool
410  bool UnfoldLoad, bool UnfoldStore,
411  SmallVectorImpl<MachineInstr *> &NewMIs) const override;
412 
414  SmallVectorImpl<SDNode *> &NewNodes) const override;
415 
416  /// getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new
417  /// instruction after load / store are unfolded from an instruction of the
418  /// specified opcode. It returns zero if the specified unfolding is not
419  /// possible. If LoadRegIndex is non-null, it is filled in with the operand
420  /// index of the operand which will hold the register holding the loaded
421  /// value.
422  unsigned
423  getOpcodeAfterMemoryUnfold(unsigned Opc, bool UnfoldLoad, bool UnfoldStore,
424  unsigned *LoadRegIndex = nullptr) const override;
425 
426  /// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler
427  /// to determine if two loads are loading from the same base address. It
428  /// should only return true if the base pointers are the same and the
429  /// only differences between the two addresses are the offset. It also returns
430  /// the offsets by reference.
431  bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1,
432  int64_t &Offset2) const override;
433 
434  /// isSchedulingBoundary - Overrides the isSchedulingBoundary from
435  /// Codegen/TargetInstrInfo.cpp to make it capable of identifying ENDBR
436  /// intructions and prevent it from being re-scheduled.
438  const MachineBasicBlock *MBB,
439  const MachineFunction &MF) const override;
440 
441  /// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to
442  /// determine (in conjunction with areLoadsFromSameBasePtr) if two loads
443  /// should be scheduled togther. On some targets if two loads are loading from
444  /// addresses in the same cache line, it's better if they are scheduled
445  /// together. This function takes two integers that represent the load offsets
446  /// from the common base address. It returns true if it decides it's desirable
447  /// to schedule the two loads together. "NumLoads" is the number of loads that
448  /// have already been scheduled after Load1.
449  bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1,
450  int64_t Offset2,
451  unsigned NumLoads) const override;
452 
453  MCInst getNop() const override;
454 
455  bool
457 
458  /// isSafeToMoveRegClassDefs - Return true if it's safe to move a machine
459  /// instruction that defines the specified register class.
460  bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const override;
461 
462  /// True if MI has a condition code def, e.g. EFLAGS, that is
463  /// not marked dead.
464  bool hasLiveCondCodeDef(MachineInstr &MI) const;
465 
466  /// getGlobalBaseReg - Return a virtual register initialized with the
467  /// the global base register value. Output instructions required to
468  /// initialize the register in the function entry block, if necessary.
469  ///
470  unsigned getGlobalBaseReg(MachineFunction *MF) const;
471 
472  std::pair<uint16_t, uint16_t>
473  getExecutionDomain(const MachineInstr &MI) const override;
474 
476 
477  void setExecutionDomain(MachineInstr &MI, unsigned Domain) const override;
478 
479  bool setExecutionDomainCustom(MachineInstr &MI, unsigned Domain) const;
480 
481  unsigned
482  getPartialRegUpdateClearance(const MachineInstr &MI, unsigned OpNum,
483  const TargetRegisterInfo *TRI) const override;
484  unsigned getUndefRegClearance(const MachineInstr &MI, unsigned OpNum,
485  const TargetRegisterInfo *TRI) const override;
486  void breakPartialRegDependency(MachineInstr &MI, unsigned OpNum,
487  const TargetRegisterInfo *TRI) const override;
488 
490  unsigned OpNum,
493  unsigned Size, Align Alignment,
494  bool AllowCommute) const;
495 
496  bool isHighLatencyDef(int opc) const override;
497 
498  bool hasHighOperandLatency(const TargetSchedModel &SchedModel,
499  const MachineRegisterInfo *MRI,
500  const MachineInstr &DefMI, unsigned DefIdx,
501  const MachineInstr &UseMI,
502  unsigned UseIdx) const override;
503 
504  bool useMachineCombiner() const override { return true; }
505 
506  bool isAssociativeAndCommutative(const MachineInstr &Inst) const override;
507 
508  bool hasReassociableOperands(const MachineInstr &Inst,
509  const MachineBasicBlock *MBB) const override;
510 
511  void setSpecialOperandAttr(MachineInstr &OldMI1, MachineInstr &OldMI2,
512  MachineInstr &NewMI1,
513  MachineInstr &NewMI2) const override;
514 
515  /// analyzeCompare - For a comparison instruction, return the source registers
516  /// in SrcReg and SrcReg2 if having two register operands, and the value it
517  /// compares against in CmpValue. Return true if the comparison instruction
518  /// can be analyzed.
519  bool analyzeCompare(const MachineInstr &MI, Register &SrcReg,
520  Register &SrcReg2, int64_t &CmpMask,
521  int64_t &CmpValue) const override;
522 
523  /// optimizeCompareInstr - Check if there exists an earlier instruction that
524  /// operates on the same source operands and sets flags in the same way as
525  /// Compare; remove Compare if possible.
526  bool optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
527  Register SrcReg2, int64_t CmpMask, int64_t CmpValue,
528  const MachineRegisterInfo *MRI) const override;
529 
530  /// optimizeLoadInstr - Try to remove the load by folding it to a register
531  /// operand at the use. We fold the load instructions if and only if the
532  /// def and use are in the same BB. We only look at one load and see
533  /// whether it can be folded into MI. FoldAsLoadDefReg is the virtual register
534  /// defined by the load we are trying to fold. DefMI returns the machine
535  /// instruction that defines FoldAsLoadDefReg, and the function returns
536  /// the machine instruction generated due to folding.
538  const MachineRegisterInfo *MRI,
539  Register &FoldAsLoadDefReg,
540  MachineInstr *&DefMI) const override;
541 
542  std::pair<unsigned, unsigned>
543  decomposeMachineOperandsTargetFlags(unsigned TF) const override;
544 
547 
549  std::vector<outliner::Candidate> &RepeatedSequenceLocs) const override;
550 
552  bool OutlineFromLinkOnceODRs) const override;
553 
555  getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags) const override;
556 
558  const outliner::OutlinedFunction &OF) const override;
559 
563  outliner::Candidate &C) const override;
564 
565  bool verifyInstruction(const MachineInstr &MI,
566  StringRef &ErrInfo) const override;
567 #define GET_INSTRINFO_HELPER_DECLS
568 #include "X86GenInstrInfo.inc"
569 
570  static bool hasLockPrefix(const MachineInstr &MI) {
571  return MI.getDesc().TSFlags & X86II::LOCK;
572  }
573 
575  Register Reg) const override;
576 
577 protected:
578  /// Commutes the operands in the given instruction by changing the operands
579  /// order and/or changing the instruction's opcode and/or the immediate value
580  /// operand.
581  ///
582  /// The arguments 'CommuteOpIdx1' and 'CommuteOpIdx2' specify the operands
583  /// to be commuted.
584  ///
585  /// Do not call this method for a non-commutable instruction or
586  /// non-commutable operands.
587  /// Even though the instruction is commutable, the method may still
588  /// fail to commute the operands, null pointer is returned in such cases.
590  unsigned CommuteOpIdx1,
591  unsigned CommuteOpIdx2) const override;
592 
593  /// If the specific machine instruction is a instruction that moves/copies
594  /// value from one register to another register return destination and source
595  /// registers as machine operands.
597  isCopyInstrImpl(const MachineInstr &MI) const override;
598 
599 private:
600  /// This is a helper for convertToThreeAddress for 8 and 16-bit instructions.
601  /// We use 32-bit LEA to form 3-address code by promoting to a 32-bit
602  /// super-register and then truncating back down to a 8/16-bit sub-register.
603  MachineInstr *convertToThreeAddressWithLEA(unsigned MIOpc, MachineInstr &MI,
604  LiveVariables *LV,
605  LiveIntervals *LIS,
606  bool Is8BitOp) const;
607 
608  /// Handles memory folding for special case instructions, for instance those
609  /// requiring custom manipulation of the address.
610  MachineInstr *foldMemoryOperandCustom(MachineFunction &MF, MachineInstr &MI,
611  unsigned OpNum,
614  unsigned Size, Align Alignment) const;
615 
616  /// isFrameOperand - Return true and the FrameIndex if the specified
617  /// operand and follow operands form a reference to the stack frame.
618  bool isFrameOperand(const MachineInstr &MI, unsigned int Op,
619  int &FrameIndex) const;
620 
621  /// Returns true iff the routine could find two commutable operands in the
622  /// given machine instruction with 3 vector inputs.
623  /// The 'SrcOpIdx1' and 'SrcOpIdx2' are INPUT and OUTPUT arguments. Their
624  /// input values can be re-defined in this method only if the input values
625  /// are not pre-defined, which is designated by the special value
626  /// 'CommuteAnyOperandIndex' assigned to it.
627  /// If both of indices are pre-defined and refer to some operands, then the
628  /// method simply returns true if the corresponding operands are commutable
629  /// and returns false otherwise.
630  ///
631  /// For example, calling this method this way:
632  /// unsigned Op1 = 1, Op2 = CommuteAnyOperandIndex;
633  /// findThreeSrcCommutedOpIndices(MI, Op1, Op2);
634  /// can be interpreted as a query asking to find an operand that would be
635  /// commutable with the operand#1.
636  ///
637  /// If IsIntrinsic is set, operand 1 will be ignored for commuting.
638  bool findThreeSrcCommutedOpIndices(const MachineInstr &MI,
639  unsigned &SrcOpIdx1,
640  unsigned &SrcOpIdx2,
641  bool IsIntrinsic = false) const;
642 
643  /// Returns true when instruction \p FlagI produces the same flags as \p OI.
644  /// The caller should pass in the results of calling analyzeCompare on \p OI:
645  /// \p SrcReg, \p SrcReg2, \p ImmMask, \p ImmValue.
646  /// If the flags match \p OI as if it had the input operands swapped then the
647  /// function succeeds and sets \p IsSwapped to true.
648  ///
649  /// Examples of OI, FlagI pairs returning true:
650  /// CMP %1, 42 and CMP %1, 42
651  /// CMP %1, %2 and %3 = SUB %1, %2
652  /// TEST %1, %1 and %2 = SUB %1, 0
653  /// CMP %1, %2 and %3 = SUB %2, %1 ; IsSwapped=true
654  bool isRedundantFlagInstr(const MachineInstr &FlagI, Register SrcReg,
655  Register SrcReg2, int64_t ImmMask, int64_t ImmValue,
656  const MachineInstr &OI, bool *IsSwapped,
657  int64_t *ImmDelta) const;
658 };
659 
660 } // namespace llvm
661 
662 #endif
X86InstrFMA3Info.h
llvm::X86II::MO_TLVP
@ MO_TLVP
MO_TLVP - On a symbol operand this indicates that the immediate is some TLS offset.
Definition: X86BaseInfo.h:553
llvm::X86II::MO_DARWIN_NONLAZY
@ MO_DARWIN_NONLAZY
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
Definition: X86BaseInfo.h:542
llvm::X86InstrInfo::decomposeMachineOperandsTargetFlags
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
Definition: X86InstrInfo.cpp:9181
llvm::X86::AddrDisp
@ AddrDisp
Definition: X86BaseInfo.h:35
llvm::X86InstrInfo::isDataInvariant
static bool isDataInvariant(MachineInstr &MI)
Returns true if the instruction has no behavior (specified or otherwise) that is based on the value o...
Definition: X86InstrInfo.cpp:142
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::X86::AddrIndexReg
@ AddrIndexReg
Definition: X86BaseInfo.h:34
llvm::X86InstrInfo::analyzeBranch
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Definition: X86InstrInfo.cpp:3174
UseMI
MachineInstrBuilder & UseMI
Definition: AArch64ExpandPseudoInsts.cpp:103
llvm::MachineInstr::TAsmComments
@ TAsmComments
Definition: MachineInstr.h:79
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:719
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition: MachineRegisterInfo.h:50
llvm::TargetInstrInfo::MachineBranchPredicate
Represents a predicate at the MachineFunction level.
Definition: TargetInstrInfo.h:651
llvm::X86::AsmComments
AsmComments
Definition: X86InstrInfo.h:31
llvm::X86::AddrSegmentReg
@ AddrSegmentReg
AddrSegmentReg - The operand # of the segment in the memory operand.
Definition: X86BaseInfo.h:38
llvm::X86InstrInfo::isLoadFromStackSlot
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
Definition: X86InstrInfo.cpp:659
llvm::X86InstrInfo::isStoreToStackSlot
unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
Definition: X86InstrInfo.cpp:693
llvm::X86InstrInfo::isHighLatencyDef
bool isHighLatencyDef(int opc) const override
Definition: X86InstrInfo.cpp:8294
llvm::X86Subtarget
Definition: X86Subtarget.h:52
llvm::VirtRegMap
Definition: VirtRegMap.h:33
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
Definition: X86InstrInfo.cpp:9186
llvm::SDNode
Represents one node in the SelectionDAG.
Definition: SelectionDAGNodes.h:454
llvm::X86InstrInfo::isAssociativeAndCommutative
bool isAssociativeAndCommutative(const MachineInstr &Inst) const override
Definition: X86InstrInfo.cpp:8637
llvm::X86InstrInfo::hasReassociableOperands
bool hasReassociableOperands(const MachineInstr &Inst, const MachineBasicBlock *MBB) const override
Definition: X86InstrInfo.cpp:8613
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:234
llvm::X86InstrInfo::analyzeCompare
bool analyzeCompare(const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &CmpMask, int64_t &CmpValue) const override
analyzeCompare - For a comparison instruction, return the source registers in SrcReg and SrcReg2 if h...
Definition: X86InstrInfo.cpp:3909
llvm::outliner::InstrType
InstrType
Represents how an instruction should be mapped by the outliner.
Definition: MachineOutliner.h:33
TargetInstrInfo.h
llvm::X86::getCondSrcNoFromDesc
int getCondSrcNoFromDesc(const MCInstrDesc &MCID)
Return the source operand # for condition code by MCID.
Definition: X86InstrInfo.cpp:2686
llvm::X86InstrInfo::verifyInstruction
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
Definition: X86InstrInfo.cpp:3721
llvm::X86InstrInfo::getExecutionDomainCustom
uint16_t getExecutionDomainCustom(const MachineInstr &MI) const
Definition: X86InstrInfo.cpp:7966
llvm::X86InstrInfo::getMemOperandsWithOffsetWidth
bool getMemOperandsWithOffsetWidth(const MachineInstr &LdSt, SmallVectorImpl< const MachineOperand * > &BaseOps, int64_t &Offset, bool &OffsetIsScalable, unsigned &Width, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:3790
llvm::Optional
Definition: APInt.h:33
llvm::X86InstrInfo::getNop
MCInst getNop() const override
Return the noop instruction to use for a noop.
Definition: X86InstrInfo.cpp:8288
llvm::X86InstrInfo::isDataInvariantLoad
static bool isDataInvariantLoad(MachineInstr &MI)
Returns true if the instruction has no behavior (specified or otherwise) that is based on the value l...
Definition: X86InstrInfo.cpp:209
llvm::X86::getCondFromBranch
CondCode getCondFromBranch(const MachineInstr &MI)
Definition: X86InstrInfo.cpp:2704
llvm::X86InstrInfo::isStoreToStackSlotPostFE
unsigned isStoreToStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
isStoreToStackSlotPostFE - Check for post-frame ptr elimination stack locations as well.
Definition: X86InstrInfo.cpp:709
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::X86InstrInfo::getFMA3OpcodeToCommuteOperands
unsigned getFMA3OpcodeToCommuteOperands(const MachineInstr &MI, unsigned SrcOpIdx1, unsigned SrcOpIdx2, const X86InstrFMA3Group &FMA3Group) const
Returns an adjusted FMA opcode that must be used in FMA instruction that performs the same computatio...
Definition: X86InstrInfo.cpp:1783
llvm::X86::CondCode
CondCode
Definition: X86BaseInfo.h:80
llvm::outliner::OutlinedFunction
The information necessary to create an outlined function for some class of candidate.
Definition: MachineOutliner.h:214
llvm::X86II::MO_GOTOFF
@ MO_GOTOFF
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
Definition: X86BaseInfo.h:434
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1620
llvm::isLeaMem
static bool isLeaMem(const MachineInstr &MI, unsigned Op)
Definition: X86InstrInfo.h:118
llvm::X86::getSwappedVPCMPImm
unsigned getSwappedVPCMPImm(unsigned Imm)
Get the VPCMP immediate if the opcodes are swapped.
Definition: X86InstrInfo.cpp:2829
llvm::X86InstrInfo::unfoldMemoryOperand
bool unfoldMemoryOperand(MachineFunction &MF, MachineInstr &MI, unsigned Reg, bool UnfoldLoad, bool UnfoldStore, SmallVectorImpl< MachineInstr * > &NewMIs) const override
unfoldMemoryOperand - Separate a single instruction which folded a load or a store or a load and a st...
Definition: X86InstrInfo.cpp:6815
llvm::X86II::MO_GOT
@ MO_GOT
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
Definition: X86BaseInfo.h:427
llvm::X86InstrInfo::isFunctionSafeToOutlineFrom
bool isFunctionSafeToOutlineFrom(MachineFunction &MF, bool OutlineFromLinkOnceODRs) const override
Definition: X86InstrInfo.cpp:9533
llvm::X86::getCondFromCMov
CondCode getCondFromCMov(const MachineInstr &MI)
Definition: X86InstrInfo.cpp:2714
llvm::X86II::MO_COFFSTUB
@ MO_COFFSTUB
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
Definition: X86BaseInfo.h:575
llvm::X86::AC_EVEX_2_VEX
@ AC_EVEX_2_VEX
Definition: X86InstrInfo.h:33
llvm::X86InstrInfo::isCoalescableExtInstr
bool isCoalescableExtInstr(const MachineInstr &MI, Register &SrcReg, Register &DstReg, unsigned &SubIdx) const override
isCoalescableExtInstr - Return true if the instruction is a "coalescable" extension instruction.
Definition: X86InstrInfo.cpp:94
llvm::SelectionDAG
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:220
llvm::AAResults
Definition: AliasAnalysis.h:511
llvm::X86InstrInfo::insertSelect
void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const override
Definition: X86InstrInfo.cpp:3371
llvm::X86InstrInfo::getExecutionDomain
std::pair< uint16_t, uint16_t > getExecutionDomain(const MachineInstr &MI) const override
Definition: X86InstrInfo.cpp:8197
llvm::MachineOperand::getImm
int64_t getImm() const
Definition: MachineOperand.h:546
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::X86InstrInfo::canInsertSelect
bool canInsertSelect(const MachineBasicBlock &, ArrayRef< MachineOperand > Cond, Register, Register, Register, int &, int &, int &) const override
Definition: X86InstrInfo.cpp:3334
llvm::X86InstrInfo::setFrameAdjustment
void setFrameAdjustment(MachineInstr &I, int64_t V) const
Sets the stack pointer adjustment made inside the frame made up by this instruction.
Definition: X86InstrInfo.h:170
llvm::X86InstrInfo::setExecutionDomain
void setExecutionDomain(MachineInstr &MI, unsigned Domain) const override
Definition: X86InstrInfo.cpp:8237
llvm::X86II::MO_GOTPCREL
@ MO_GOTPCREL
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
Definition: X86BaseInfo.h:442
llvm::X86::getCondFromSETCC
CondCode getCondFromSETCC(const MachineInstr &MI)
Definition: X86InstrInfo.cpp:2709
X86GenInstrInfo
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:45
llvm::X86::getVPCMPImmForCond
unsigned getVPCMPImmForCond(ISD::CondCode CC)
Get the VPCMP immediate for the given condition.
Definition: X86InstrInfo.cpp:2812
Domain
Domain
Definition: CorrelatedValuePropagation.cpp:710
llvm::X86InstrInfo::hasLiveCondCodeDef
bool hasLiveCondCodeDef(MachineInstr &MI) const
True if MI has a condition code def, e.g.
Definition: X86InstrInfo.cpp:940
llvm::X86InstrInfo::removeBranch
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Definition: X86InstrInfo.cpp:3252
llvm::X86InstrInfo::isReallyTriviallyReMaterializable
bool isReallyTriviallyReMaterializable(const MachineInstr &MI, AAResults *AA) const override
Definition: X86InstrInfo.cpp:745
llvm::MCInstrDesc
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:197
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:48
llvm::X86::getSwappedVPCOMImm
unsigned getSwappedVPCOMImm(unsigned Imm)
Get the VPCOM immediate if the opcodes are swapped.
Definition: X86InstrInfo.cpp:2847
llvm::X86::getSwappedVCMPImm
unsigned getSwappedVCMPImm(unsigned Imm)
Get the VCMP immediate if the opcodes are swapped.
Definition: X86InstrInfo.cpp:2865
llvm::X86II::MO_GOTPCREL_NORELAX
@ MO_GOTPCREL_NORELAX
MO_GOTPCREL_NORELAX - Same as MO_GOTPCREL except that R_X86_64_GOTPCREL relocations are guaranteed to...
Definition: X86BaseInfo.h:447
llvm::X86InstrInfo::storeRegToStackSlot
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:3847
llvm::X86InstrInfo::describeLoadedValue
Optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const override
Definition: X86InstrInfo.cpp:8992
llvm::X86InstrInfo::preservesZeroValueInReg
bool preservesZeroValueInReg(const MachineInstr *MI, const Register NullValueReg, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:3762
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::X86InstrFMA3Group
This class is used to group {132, 213, 231} forms of FMA opcodes together.
Definition: X86InstrFMA3Info.h:24
llvm::X86InstrInfo::hasCommutePreference
bool hasCommutePreference(MachineInstr &MI, bool &Commute) const override
Returns true if we have preference on the operands order in MI, the commute decision is returned in C...
Definition: X86InstrInfo.cpp:2651
llvm::X86InstrInfo::breakPartialRegDependency
void breakPartialRegDependency(MachineInstr &MI, unsigned OpNum, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:5738
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::X86InstrInfo::findCommutedOpIndices
bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const override
Returns true iff the routine could find two commutable operands in the given machine instruction.
Definition: X86InstrInfo.cpp:2407
llvm::X86InstrInfo::setExecutionDomainCustom
bool setExecutionDomainCustom(MachineInstr &MI, unsigned Domain) const
Definition: X86InstrInfo.cpp:8064
llvm::X86InstrInfo::insertBranch
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
Definition: X86InstrInfo.cpp:3275
llvm::X86InstrInfo::isSafeToMoveRegClassDefs
bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const override
isSafeToMoveRegClassDefs - Return true if it's safe to move a machine instruction that defines the sp...
Definition: X86InstrInfo.cpp:7378
llvm::X86::AddrNumOperands
@ AddrNumOperands
AddrNumOperands - Total number of operands in a memory reference.
Definition: X86BaseInfo.h:41
llvm::X86InstrInfo::hasLockPrefix
static bool hasLockPrefix(const MachineInstr &MI)
Definition: X86InstrInfo.h:570
llvm::PPC::Predicate
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
llvm::X86InstrInfo::isUnconditionalTailCall
bool isUnconditionalTailCall(const MachineInstr &MI) const override
Definition: X86InstrInfo.cpp:2898
llvm::X86II::MO_DARWIN_NONLAZY_PIC_BASE
@ MO_DARWIN_NONLAZY_PIC_BASE
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
Definition: X86BaseInfo.h:547
llvm::X86InstrInfo::classifyLEAReg
bool classifyLEAReg(MachineInstr &MI, const MachineOperand &Src, unsigned LEAOpcode, bool AllowSP, Register &NewSrc, bool &isKill, MachineOperand &ImplicitOp, LiveVariables *LV, LiveIntervals *LIS) const
Given an operand within a MachineInstr, insert preceding code to put it into the right format for a p...
Definition: X86InstrInfo.cpp:1066
llvm::TargetSchedModel
Provide an instruction scheduling machine model to CodeGen passes.
Definition: TargetSchedule.h:30
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
llvm::isGlobalStubReference
static bool isGlobalStubReference(unsigned char TargetFlag)
isGlobalStubReference - Return true if the specified TargetFlag operand is a reference to a stub for ...
Definition: X86InstrInfo.h:82
llvm::X86InstrInfo::expandPostRAPseudo
bool expandPostRAPseudo(MachineInstr &MI) const override
Definition: X86InstrInfo.cpp:4849
llvm::X86InstrInfo::isCopyInstrImpl
Optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
If the specific machine instruction is a instruction that moves/copies value from one register to ano...
Definition: X86InstrInfo.cpp:3556
llvm::X86II::MO_PIC_BASE_OFFSET
@ MO_PIC_BASE_OFFSET
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
Definition: X86BaseInfo.h:420
llvm::X86InstrInfo::getOutliningType
outliner::InstrType getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags) const override
Definition: X86InstrInfo.cpp:9556
llvm::X86InstrInfo::areLoadsFromSameBasePtr
bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1, int64_t &Offset2) const override
areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to determine if two loads are lo...
Definition: X86InstrInfo.cpp:7110
llvm::outliner::Candidate
An individual sequence of instructions to be replaced with a call to an outlined function.
Definition: MachineOutliner.h:37
llvm::X86InstrInfo::copyPhysReg
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
Definition: X86InstrInfo.cpp:3470
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::X86InstrInfo::loadRegFromStackSlot
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:3879
llvm::X86InstrInfo::analyzeBranchPredicate
bool analyzeBranchPredicate(MachineBasicBlock &MBB, TargetInstrInfo::MachineBranchPredicate &MBP, bool AllowModify=false) const override
Definition: X86InstrInfo.cpp:3183
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::X86InstrInfo::setSpecialOperandAttr
void setSpecialOperandAttr(MachineInstr &OldMI1, MachineInstr &OldMI2, MachineInstr &NewMI1, MachineInstr &NewMI2) const override
This is an architecture-specific helper function of reassociateOps.
Definition: X86InstrInfo.cpp:9135
llvm::ISD::CondCode
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
Definition: ISDOpcodes.h:1404
llvm::isScale
static bool isScale(const MachineOperand &MO)
Definition: X86InstrInfo.h:113
llvm::X86II::LOCK
@ LOCK
Definition: X86BaseInfo.h:893
llvm::X86InstrInfo::isSchedulingBoundary
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
isSchedulingBoundary - Overrides the isSchedulingBoundary from Codegen/TargetInstrInfo....
Definition: X86InstrInfo.cpp:7356
llvm::X86InstrInfo::replaceBranchWithTailCall
void replaceBranchWithTailCall(MachineBasicBlock &MBB, SmallVectorImpl< MachineOperand > &Cond, const MachineInstr &TailCall) const override
Definition: X86InstrInfo.cpp:2943
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::X86::GetOppositeBranchCondition
CondCode GetOppositeBranchCondition(CondCode CC)
GetOppositeBranchCondition - Return the inverse of the specified cond, e.g.
Definition: X86InstrInfo.cpp:2721
llvm::X86InstrInfo::foldMemoryOperandImpl
MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
foldMemoryOperand - If this target supports it, fold a load or store of the specified stack slot into...
Definition: X86InstrInfo.cpp:6202
llvm::MachineFunction
Definition: MachineFunction.h:241
llvm::X86InstrInfo
Definition: X86InstrInfo.h:138
llvm::X86InstrInfo::getAddrModeFromMemoryOp
Optional< ExtAddrMode > getAddrModeFromMemoryOp(const MachineInstr &MemI, const TargetRegisterInfo *TRI) const override
Definition: X86InstrInfo.cpp:3695
llvm::X86II::MO_DLLIMPORT
@ MO_DLLIMPORT
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...
Definition: X86BaseInfo.h:537
llvm::X86InstrInfo::getUndefRegClearance
unsigned getUndefRegClearance(const MachineInstr &MI, unsigned OpNum, const TargetRegisterInfo *TRI) const override
Inform the BreakFalseDeps pass how many idle instructions we would like before certain undef register...
Definition: X86InstrInfo.cpp:5728
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
Cond
SmallVector< MachineOperand, 4 > Cond
Definition: BasicBlockSections.cpp:137
llvm::X86InstrInfo::canMakeTailCallConditional
bool canMakeTailCallConditional(SmallVectorImpl< MachineOperand > &Cond, const MachineInstr &TailCall) const override
Definition: X86InstrInfo.cpp:2912
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::isGlobalRelativeToPICBase
static bool isGlobalRelativeToPICBase(unsigned char TargetFlag)
isGlobalRelativeToPICBase - Return true if the specified global value reference is relative to a 32-b...
Definition: X86InstrInfo.h:100
llvm::X86InstrInfo::getSPAdjust
int getSPAdjust(const MachineInstr &MI) const override
getSPAdjust - This returns the stack pointer adjustment made by this instruction.
Definition: X86InstrInfo.cpp:399
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::X86InstrInfo::isLoadFromStackSlotPostFE
unsigned isLoadFromStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
isLoadFromStackSlotPostFE - Check for post-frame ptr elimination stack locations as well.
Definition: X86InstrInfo.cpp:674
llvm::X86::getCondFromMI
CondCode getCondFromMI(const MachineInstr &MI)
Return the condition code of the instruction.
Definition: X86InstrInfo.cpp:2695
llvm::X86InstrInfo::getPartialRegUpdateClearance
unsigned getPartialRegUpdateClearance(const MachineInstr &MI, unsigned OpNum, const TargetRegisterInfo *TRI) const override
Inform the BreakFalseDeps pass how many idle instructions we would like before a partial register upd...
Definition: X86InstrInfo.cpp:5358
llvm::X86InstrInfo::getRegisterInfo
const X86RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: X86InstrInfo.h:157
llvm::X86InstrInfo::commuteInstructionImpl
MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned CommuteOpIdx1, unsigned CommuteOpIdx2) const override
Commutes the operands in the given instruction by changing the operands order and/or changing the ins...
Definition: X86InstrInfo.cpp:1952
llvm::X86InstrInfo::X86InstrInfo
X86InstrInfo(X86Subtarget &STI)
Definition: X86InstrInfo.cpp:83
llvm::MipsISD::TailCall
@ TailCall
Definition: MipsISelLowering.h:65
llvm::X86InstrInfo::getConstValDefinedInReg
bool getConstValDefinedInReg(const MachineInstr &MI, const Register Reg, int64_t &ImmVal) const override
Definition: X86InstrInfo.cpp:3750
llvm::X86InstrInfo::reMaterialize
void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, unsigned SubIdx, const MachineInstr &Orig, const TargetRegisterInfo &TRI) const override
Definition: X86InstrInfo.cpp:907
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::X86InstrInfo::getFrameAdjustment
int64_t getFrameAdjustment(const MachineInstr &I) const
Returns the stack pointer adjustment that happens inside the frame setup..destroy sequence (e....
Definition: X86InstrInfo.h:161
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:80
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::X86InstrInfo::useMachineCombiner
bool useMachineCombiner() const override
Definition: X86InstrInfo.h:504
llvm::X86InstrInfo::getOutliningCandidateInfo
virtual outliner::OutlinedFunction getOutliningCandidateInfo(std::vector< outliner::Candidate > &RepeatedSequenceLocs) const override
Definition: X86InstrInfo.cpp:9474
llvm::X86InstrInfo::getOpcodeAfterMemoryUnfold
unsigned getOpcodeAfterMemoryUnfold(unsigned Opc, bool UnfoldLoad, bool UnfoldStore, unsigned *LoadRegIndex=nullptr) const override
getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new instruction after load / store ar...
Definition: X86InstrInfo.cpp:7092
llvm::X86InstrInfo::buildOutlinedFrame
void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF, const outliner::OutlinedFunction &OF) const override
Definition: X86InstrInfo.cpp:9615
llvm::X86InstrInfo::isSubregFoldable
bool isSubregFoldable() const override
Check whether the target can fold a load that feeds a subreg operand (or a subreg operand that feeds ...
Definition: X86InstrInfo.h:382
llvm::X86InstrInfo::reverseBranchCondition
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
Definition: X86InstrInfo.cpp:7370
llvm::X86II::ImmMask
@ ImmMask
Definition: X86BaseInfo.h:844
uint16_t
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:344
ISDOpcodes.h
llvm::X86InstrInfo::hasHighOperandLatency
bool hasHighOperandLatency(const TargetSchedModel &SchedModel, const MachineRegisterInfo *MRI, const MachineInstr &DefMI, unsigned DefIdx, const MachineInstr &UseMI, unsigned UseIdx) const override
Definition: X86InstrInfo.cpp:8604
llvm::LiveIntervals
Definition: LiveIntervals.h:54
llvm::X86::getCMovOpcode
unsigned getCMovOpcode(unsigned RegBytes, bool HasMemoryOperand=false)
Return a cmov opcode for the given register size in bytes, and operand type.
Definition: X86InstrInfo.cpp:2802
llvm::MachineOperand::isImm
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Definition: MachineOperand.h:322
llvm::AMDGPU::Hwreg::Width
Width
Definition: SIDefines.h:435
X86RegisterInfo.h
llvm::RISCVMatInt::Imm
@ Imm
Definition: RISCVMatInt.h:23
AA
X86BaseInfo.h
llvm::X86InstrInfo::convertToThreeAddress
MachineInstr * convertToThreeAddress(MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
convertToThreeAddress - This method must be implemented by targets that set the M_CONVERTIBLE_TO_3_AD...
Definition: X86InstrInfo.cpp:1307
llvm::X86::getX86ConditionCode
std::pair< CondCode, bool > getX86ConditionCode(CmpInst::Predicate Predicate)
Return a pair of condition code for the given predicate and whether the instruction operands should b...
Definition: X86InstrInfo.cpp:2764
llvm::X86InstrInfo::getGlobalBaseReg
unsigned getGlobalBaseReg(MachineFunction *MF) const
getGlobalBaseReg - Return a virtual register initialized with the the global base register value.
Definition: X86InstrInfo.cpp:7392
N
#define N
DefMI
MachineInstrBuilder MachineInstrBuilder & DefMI
Definition: AArch64ExpandPseudoInsts.cpp:104
llvm::isMem
static bool isMem(const MachineInstr &MI, unsigned Op)
Definition: X86InstrInfo.h:131
llvm::X86::isX87Instruction
bool isX87Instruction(MachineInstr &MI)
Check if the instruction is X87 instruction.
Definition: X86InstrInfo.cpp:2888
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::X86InstrInfo::optimizeLoadInstr
MachineInstr * optimizeLoadInstr(MachineInstr &MI, const MachineRegisterInfo *MRI, Register &FoldAsLoadDefReg, MachineInstr *&DefMI) const override
optimizeLoadInstr - Try to remove the load by folding it to a register operand at the use.
Definition: X86InstrInfo.cpp:4605
llvm::X86::AddrBaseReg
@ AddrBaseReg
Definition: X86BaseInfo.h:32
llvm::LiveVariables
Definition: LiveVariables.h:47
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::X86InstrInfo::shouldScheduleLoadsNear
bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const override
shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to determine (in conjunction w...
Definition: X86InstrInfo.cpp:7308
llvm::X86InstrInfo::optimizeCompareInstr
bool optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg, Register SrcReg2, int64_t CmpMask, int64_t CmpValue, const MachineRegisterInfo *MRI) const override
optimizeCompareInstr - Check if there exists an earlier instruction that operates on the same source ...
Definition: X86InstrInfo.cpp:4235
llvm::X86InstrInfo::insertOutlinedCall
MachineBasicBlock::iterator insertOutlinedCall(Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It, MachineFunction &MF, outliner::Candidate &C) const override
Definition: X86InstrInfo.cpp:9630
X86
Unrolling by would eliminate the &in both leading to a net reduction in code size The resultant code would then also be suitable for exit value computation We miss a bunch of rotate opportunities on various including etc On X86
Definition: README.txt:568
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::X86::AddrScaleAmt
@ AddrScaleAmt
Definition: X86BaseInfo.h:33
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24
llvm::X86RegisterInfo
Definition: X86RegisterInfo.h:24