LLVM 20.0.0git
Macros | Functions | Variables
MSP430ISelLowering.cpp File Reference
#include "MSP430ISelLowering.h"
#include "MSP430.h"
#include "MSP430MachineFunctionInfo.h"
#include "MSP430Subtarget.h"
#include "MSP430TargetMachine.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "MSP430GenCallingConv.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "msp430-lower"
 

Functions

template<typename ArgT >
static void ParseFunctionArgs (const SmallVectorImpl< ArgT > &Args, SmallVectorImpl< unsigned > &Out)
 For each argument in a function store the number of pieces it is composed of.
 
static void AnalyzeVarArgs (CCState &State, const SmallVectorImpl< ISD::OutputArg > &Outs)
 
static void AnalyzeVarArgs (CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins)
 
template<typename ArgT >
static void AnalyzeArguments (CCState &State, SmallVectorImpl< CCValAssign > &ArgLocs, const SmallVectorImpl< ArgT > &Args)
 Analyze incoming and outgoing function arguments.
 
static void AnalyzeRetResult (CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins)
 
static void AnalyzeRetResult (CCState &State, const SmallVectorImpl< ISD::OutputArg > &Outs)
 
template<typename ArgT >
static void AnalyzeReturnValues (CCState &State, SmallVectorImpl< CCValAssign > &RVLocs, const SmallVectorImpl< ArgT > &Args)
 
static SDValue EmitCMP (SDValue &LHS, SDValue &RHS, SDValue &TargetCC, ISD::CondCode CC, const SDLoc &dl, SelectionDAG &DAG)
 

Variables

static cl::opt< boolMSP430NoLegalImmediate ("msp430-no-legal-immediate", cl::Hidden, cl::desc("Enable non legal immediates (for testing purposes only)"), cl::init(false))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "msp430-lower"

Definition at line 35 of file MSP430ISelLowering.cpp.

Function Documentation

◆ AnalyzeArguments()

template<typename ArgT >
static void AnalyzeArguments ( CCState State,
SmallVectorImpl< CCValAssign > &  ArgLocs,
const SmallVectorImpl< ArgT > &  Args 
)
static

Analyze incoming and outgoing function arguments.

We need custom C++ code to handle special constraints in the ABI like reversing the order of the pieces of splitted arguments. In addition, all pieces of a certain argument have to be passed either using registers or the stack but never mixing both.

Definition at line 454 of file MSP430ISelLowering.cpp.

References llvm::CCState::addLoc(), llvm::CCValAssign::AExt, llvm::CCState::AllocateReg(), AnalyzeVarArgs(), assert(), llvm::CCValAssign::Full, llvm::CCState::getCallingConv(), llvm::CCValAssign::getReg(), llvm::CCState::HandleByVal(), llvm::ISD::ArgFlagsTy::isByVal(), llvm::ISD::ArgFlagsTy::isSExt(), llvm::CCState::isVarArg(), llvm::ISD::ArgFlagsTy::isZExt(), llvm::CallingConv::MSP430_BUILTIN, ParseFunctionArgs(), llvm::CCValAssign::SExt, llvm::SmallVectorBase< Size_T >::size(), and llvm::CCValAssign::ZExt.

◆ AnalyzeRetResult() [1/2]

static void AnalyzeRetResult ( CCState State,
const SmallVectorImpl< ISD::InputArg > &  Ins 
)
static

Definition at line 548 of file MSP430ISelLowering.cpp.

References llvm::CCState::AnalyzeCallResult().

Referenced by AnalyzeReturnValues().

◆ AnalyzeRetResult() [2/2]

static void AnalyzeRetResult ( CCState State,
const SmallVectorImpl< ISD::OutputArg > &  Outs 
)
static

Definition at line 553 of file MSP430ISelLowering.cpp.

References llvm::CCState::AnalyzeReturn().

◆ AnalyzeReturnValues()

template<typename ArgT >
static void AnalyzeReturnValues ( CCState State,
SmallVectorImpl< CCValAssign > &  RVLocs,
const SmallVectorImpl< ArgT > &  Args 
)
static

Definition at line 559 of file MSP430ISelLowering.cpp.

References AnalyzeRetResult().

◆ AnalyzeVarArgs() [1/2]

static void AnalyzeVarArgs ( CCState State,
const SmallVectorImpl< ISD::InputArg > &  Ins 
)
static

Definition at line 444 of file MSP430ISelLowering.cpp.

References llvm::CCState::AnalyzeFormalArguments().

◆ AnalyzeVarArgs() [2/2]

static void AnalyzeVarArgs ( CCState State,
const SmallVectorImpl< ISD::OutputArg > &  Outs 
)
static

Definition at line 439 of file MSP430ISelLowering.cpp.

References llvm::CCState::AnalyzeCallOperands().

Referenced by AnalyzeArguments().

◆ EmitCMP()

static SDValue EmitCMP ( SDValue LHS,
SDValue RHS,
SDValue TargetCC,
ISD::CondCode  CC,
const SDLoc dl,
SelectionDAG DAG 
)
static

◆ ParseFunctionArgs()

template<typename ArgT >
static void ParseFunctionArgs ( const SmallVectorImpl< ArgT > &  Args,
SmallVectorImpl< unsigned > &  Out 
)
static

For each argument in a function store the number of pieces it is composed of.

Definition at line 419 of file MSP430ISelLowering.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by AnalyzeArguments().

Variable Documentation

◆ MSP430NoLegalImmediate

cl::opt< bool > MSP430NoLegalImmediate("msp430-no-legal-immediate", cl::Hidden, cl::desc("Enable non legal immediates (for testing purposes only)"), cl::init(false)) ( "msp430-no-legal-immediate"  ,
cl::Hidden  ,
cl::desc("Enable non legal immediates (for testing purposes only)")  ,
cl::init(false)   
)
static