Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / ARC / ARCMachineFunctionInfo.h
blobcace92a2b8fb60f108b5a87e65d21a2d245cd66a
1 //===- ARCMachineFunctionInfo.h - ARC machine function info -----*- 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 declares ARC-specific per-machine-function information.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H
14 #define LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H
16 #include "llvm/CodeGen/MachineFunction.h"
17 #include <vector>
19 namespace llvm {
21 /// ARCFunctionInfo - This class is derived from MachineFunction private
22 /// ARC target-specific information for each MachineFunction.
23 class ARCFunctionInfo : public MachineFunctionInfo {
24 virtual void anchor();
25 bool ReturnStackOffsetSet;
26 int VarArgsFrameIndex;
27 unsigned ReturnStackOffset;
29 public:
30 explicit ARCFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
31 : ReturnStackOffsetSet(false), VarArgsFrameIndex(0),
32 ReturnStackOffset(-1U), MaxCallStackReq(0) {}
33 ~ARCFunctionInfo() {}
35 MachineFunctionInfo *
36 clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
37 const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
38 const override;
40 void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
41 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
43 void setReturnStackOffset(unsigned value) {
44 assert(!ReturnStackOffsetSet && "Return stack offset set twice");
45 ReturnStackOffset = value;
46 ReturnStackOffsetSet = true;
49 unsigned getReturnStackOffset() const {
50 assert(ReturnStackOffsetSet && "Return stack offset not set");
51 return ReturnStackOffset;
54 unsigned MaxCallStackReq;
57 } // end namespace llvm
59 #endif // LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H