LLVM  14.0.0git
PPCCCState.h
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef PPCCCSTATE_H
10 #define PPCCCSTATE_H
11 
12 #include "PPCISelLowering.h"
13 #include "llvm/ADT/BitVector.h"
14 #include "llvm/ADT/SmallVector.h"
16 
17 namespace llvm {
18 
19 class PPCCCState : public CCState {
20 public:
21 
22  void
24  void
26 
27 private:
28 
29  // Records whether the value has been lowered from an ppcf128.
30  SmallVector<bool, 4> OriginalArgWasPPCF128;
31 
32 public:
35  : CCState(CC, isVarArg, MF, locs, C) {}
36 
37  bool WasOriginalArgPPCF128(unsigned ValNo) { return OriginalArgWasPPCF128[ValNo]; }
38  void clearWasPPCF128() { OriginalArgWasPPCF128.clear(); }
39 };
40 
41 class AIXCCState : public CCState {
42 private:
43  BitVector IsFixed;
44 
45 public:
46  AIXCCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF,
48  : CCState(CC, IsVarArg, MF, Locs, C) {}
49 
51  CCAssignFn Fn) {
52  // All formal arguments are fixed.
53  IsFixed.resize(Ins.size(), true);
55  }
56 
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);
64 
66  }
67 
68  bool isFixed(unsigned ValNo) const { return IsFixed.test(ValNo); }
69 };
70 
71 } // end namespace llvm
72 
73 #endif
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::CCState
CCState - This class holds information needed while lowering arguments and return values.
Definition: CallingConvLower.h:191
llvm::AIXCCState::AnalyzeFormalArguments
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
Definition: PPCCCState.h:50
llvm::PPCCCState::PreAnalyzeCallOperands
void PreAnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs)
Definition: PPCCCState.cpp:16
llvm::SmallVector< bool, 4 >
llvm::PPCCCState
Definition: PPCCCState.h:19
llvm::CCState::AnalyzeFormalArguments
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
Definition: CallingConvLower.cpp:90
llvm::BitVector::resize
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
Definition: BitVector.h:333
llvm::CCState::AnalyzeCallOperands
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
Definition: CallingConvLower.cpp:131
llvm::PPCCCState::WasOriginalArgPPCF128
bool WasOriginalArgPPCF128(unsigned ValNo)
Definition: PPCCCState.h:37
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
BitVector.h
llvm::BitVector
Definition: BitVector.h:74
llvm::AIXCCState::AnalyzeCallOperands
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
Definition: PPCCCState.h:57
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::CCAssignFn
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change.
Definition: CallingConvLower.h:177
llvm::AIXCCState::AIXCCState
AIXCCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &Locs, LLVMContext &C)
Definition: PPCCCState.h:46
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::PPCCCState::PreAnalyzeFormalArguments
void PreAnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins)
Definition: PPCCCState.cpp:26
llvm::PPCCCState::PPCCCState
PPCCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &locs, LLVMContext &C)
Definition: PPCCCState.h:33
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::CCState::isVarArg
bool isVarArg() const
Definition: CallingConvLower.h:260
llvm::BitVector::test
bool test(unsigned Idx) const
Definition: BitVector.h:447
llvm::AIXCCState::isFixed
bool isFixed(unsigned ValNo) const
Definition: PPCCCState.h:68
CallingConvLower.h
llvm::AIXCCState
Definition: PPCCCState.h:41
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:585
PPCISelLowering.h
SmallVector.h
llvm::MipsISD::Ins
@ Ins
Definition: MipsISelLowering.h:157
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::PPCCCState::clearWasPPCF128
void clearWasPPCF128()
Definition: PPCCCState.h:38