[AVX512] Fix VSQRT packed instructions internal names.
[oota-llvm.git] / lib / Target / X86 / X86FrameLowering.h
1 //===-- X86TargetFrameLowering.h - Define frame lowering for X86 -*- C++ -*-==//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This class implements X86-specific bits of TargetFrameLowering class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
15 #define LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
16
17 #include "llvm/Target/TargetFrameLowering.h"
18
19 namespace llvm {
20
21 class MCSymbol;
22 class X86TargetMachine;
23 class X86Subtarget;
24
25 class X86FrameLowering : public TargetFrameLowering {
26 public:
27   explicit X86FrameLowering(StackDirection D, unsigned StackAl, int LAO)
28     : TargetFrameLowering(StackGrowsDown, StackAl, LAO) {}
29
30   static void getStackProbeFunction(const X86Subtarget &STI,
31                                     unsigned &CallOp,
32                                     const char *&Symbol);
33
34   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
35                                  MachineBasicBlock::iterator MBBI,
36                                  DebugLoc DL) const;
37
38   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
39   /// the function.
40   void emitPrologue(MachineFunction &MF) const override;
41   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
42
43   void adjustForSegmentedStacks(MachineFunction &MF) const override;
44
45   void adjustForHiPEPrologue(MachineFunction &MF) const override;
46
47   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
48                                      RegScavenger *RS = nullptr) const override;
49
50   bool
51   assignCalleeSavedSpillSlots(MachineFunction &MF,
52                               const TargetRegisterInfo *TRI,
53                               std::vector<CalleeSavedInfo> &CSI) const override;
54
55   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
56                                  MachineBasicBlock::iterator MI,
57                                  const std::vector<CalleeSavedInfo> &CSI,
58                                  const TargetRegisterInfo *TRI) const override;
59
60   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
61                                   MachineBasicBlock::iterator MI,
62                                   const std::vector<CalleeSavedInfo> &CSI,
63                                   const TargetRegisterInfo *TRI) const override;
64
65   bool hasFP(const MachineFunction &MF) const override;
66   bool hasReservedCallFrame(const MachineFunction &MF) const override;
67
68   int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
69   int getFrameIndexReference(const MachineFunction &MF, int FI,
70                              unsigned &FrameReg) const override;
71
72   void eliminateCallFramePseudoInstr(MachineFunction &MF,
73                                  MachineBasicBlock &MBB,
74                                  MachineBasicBlock::iterator MI) const override;
75 };
76
77 } // End llvm namespace
78
79 #endif