Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / PowerPC / PPCCCState.h
blobb0e50b230fb1a09edff2c90cf33253198f109182
1 //===---- PPCCCState.h - CCState with PowerPC specific extensions -----------===//
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 //===----------------------------------------------------------------------===//
9 #ifndef PPCCCSTATE_H
10 #define PPCCCSTATE_H
12 #include "PPCISelLowering.h"
13 #include "llvm/ADT/BitVector.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/CodeGen/CallingConvLower.h"
17 namespace llvm {
19 class PPCCCState : public CCState {
20 public:
22 void
23 PreAnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs);
24 void
25 PreAnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins);
27 private:
29 // Records whether the value has been lowered from an ppcf128.
30 SmallVector<bool, 4> OriginalArgWasPPCF128;
32 public:
33 PPCCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
34 SmallVectorImpl<CCValAssign> &locs, LLVMContext &C)
35 : CCState(CC, isVarArg, MF, locs, C) {}
37 bool WasOriginalArgPPCF128(unsigned ValNo) { return OriginalArgWasPPCF128[ValNo]; }
38 void clearWasPPCF128() { OriginalArgWasPPCF128.clear(); }
41 class AIXCCState : public CCState {
42 private:
43 BitVector IsFixed;
45 public:
46 AIXCCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF,
47 SmallVectorImpl<CCValAssign> &Locs, LLVMContext &C)
48 : CCState(CC, IsVarArg, MF, Locs, C) {}
50 void AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
51 CCAssignFn Fn) {
52 // All formal arguments are fixed.
53 IsFixed.resize(Ins.size(), true);
54 CCState::AnalyzeFormalArguments(Ins, Fn);
57 void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
58 CCAssignFn Fn) {
59 // Record whether the call operand was a fixed argument.
60 IsFixed.resize(Outs.size(), false);
61 for (unsigned ValNo = 0, E = Outs.size(); ValNo != E; ++ValNo)
62 if (Outs[ValNo].IsFixed)
63 IsFixed.set(ValNo);
65 CCState::AnalyzeCallOperands(Outs, Fn);
68 bool isFixed(unsigned ValNo) const { return IsFixed.test(ValNo); }
71 } // end namespace llvm
73 #endif