[PowerPC] Materialize more constants with CR-field set in late peephole
[llvm-core.git] / lib / Target / RISCV / RISCVMachineFunctionInfo.h
blob2fea3a1bdd2f43ad8d354f2d58e8a18013c8cf1e
1 //=- RISCVMachineFunctionInfo.h - RISCV machine function info -----*- 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 file declares RISCV-specific per-machine-function information.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
15 #define LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
17 #include "llvm/CodeGen/MachineFrameInfo.h"
18 #include "llvm/CodeGen/MachineFunction.h"
20 namespace llvm {
22 /// RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo
23 /// and contains private RISCV-specific information for each MachineFunction.
24 class RISCVMachineFunctionInfo : public MachineFunctionInfo {
25 private:
26 MachineFunction &MF;
27 /// FrameIndex for start of varargs area
28 int VarArgsFrameIndex = 0;
29 /// Size of the save area used for varargs
30 int VarArgsSaveSize = 0;
31 /// FrameIndex used for transferring values between 64-bit FPRs and a pair
32 /// of 32-bit GPRs via the stack.
33 int MoveF64FrameIndex = -1;
35 public:
36 // RISCVMachineFunctionInfo() = default;
38 RISCVMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
40 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
41 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
43 unsigned getVarArgsSaveSize() const { return VarArgsSaveSize; }
44 void setVarArgsSaveSize(int Size) { VarArgsSaveSize = Size; }
46 int getMoveF64FrameIndex() {
47 if (MoveF64FrameIndex == -1)
48 MoveF64FrameIndex = MF.getFrameInfo().CreateStackObject(8, 8, false);
49 return MoveF64FrameIndex;
53 } // end namespace llvm
55 #endif // LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H