LLVM: lib/CodeGen/GlobalISel/CallLowering.cpp File Reference (original) (raw)
This file implements some simple delegations needed for call lowering. More...
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "call-lowering" |
| Functions | |
|---|---|
| static void | addFlagsUsingAttrFn (ISD::ArgFlagsTy &Flags, const std::function< bool(Attribute::AttrKind)> &AttrFn) |
| Helper function which updates Flags when AttrFn returns true. | |
| static MachineInstrBuilder | mergeVectorRegsToResultRegs (MachineIRBuilder &B, ArrayRef< Register > DstRegs, ArrayRef< Register > SrcRegs) |
| Pack values SrcRegs to cover the vector type result DstRegs. | |
| static void | buildCopyFromRegs (MachineIRBuilder &B, ArrayRef< Register > OrigRegs, ArrayRef< Register > Regs, LLT LLTy, LLT PartLLT, const ISD::ArgFlagsTy Flags) |
| Create a sequence of instructions to combine pieces split into register typed values to the original IR value. | |
| static void | buildCopyToRegs (MachineIRBuilder &B, ArrayRef< Register > DstRegs, Register SrcReg, LLT SrcTy, LLT PartTy, unsigned ExtendOp=TargetOpcode::G_ANYEXT) |
| Create a sequence of instructions to expand the value in SrcReg (of type SrcTy) to the types in DstRegs (of type PartTy). | |
| static unsigned | extendOpFromFlags (llvm::ISD::ArgFlagsTy Flags) |
| static bool | isCopyCompatibleType (LLT SrcTy, LLT DstTy) |
| Check if we can use a basic COPY instruction between the two types. |
This file implements some simple delegations needed for call lowering.
Definition in file CallLowering.cpp.
◆ DEBUG_TYPE
#define DEBUG_TYPE "call-lowering"
◆ addFlagsUsingAttrFn()
◆ buildCopyFromRegs()
Create a sequence of instructions to combine pieces split into register typed values to the original IR value.
OrigRegs contains the destination value registers of type LLTy, and Regs contains the legalized pieces with type PartLLT. This is used for incoming values (physregs to vregs).
Definition at line 378 of file CallLowering.cpp.
References assert(), B(), llvm::LLT::changeElementCount(), llvm::LLT::changeElementType(), llvm::divideCeil(), llvm::ArrayRef< T >::drop_front(), llvm::LLT::fixed_vector(), llvm::LLT::getElementCount(), llvm::LLT::getElementType(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::getGCDType(), llvm::LLT::getNumElements(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getScalarType(), llvm::LLT::getSizeInBits(), I, llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGT(), llvm::LLT::isPointer(), llvm::LLT::isVector(), Merge, mergeVectorRegsToResultRegs(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, llvm::SmallVectorImpl< T >::reserve(), llvm::LLT::scalar(), llvm::ArrayRef< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::ArrayRef< T >::take_front(), and llvm::SmallVectorImpl< T >::truncate().
Referenced by llvm::CallLowering::handleAssignments().
◆ buildCopyToRegs()
Create a sequence of instructions to expand the value in SrcReg (of type SrcTy) to the types in DstRegs (of type PartTy).
ExtendOp should contain the type of scalar value extension if necessary.
This is used for outgoing values (vregs to physregs)
Definition at line 563 of file CallLowering.cpp.
References llvm::alignTo(), assert(), B(), llvm::ArrayRef< T >::front(), llvm::getCoverTy(), llvm::LLT::getElementCount(), llvm::getGCDType(), getReg(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGT(), llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::isKnownLT(), llvm::LLT::isScalar(), llvm::LLT::isVector(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LLT::scalar(), Size, llvm::ArrayRef< T >::size(), and llvm::LLT::vector().
Referenced by llvm::CallLowering::handleAssignments().
◆ extendOpFromFlags()
◆ isCopyCompatibleType()
| bool isCopyCompatibleType ( LLT SrcTy, LLT DstTy ) | static |
|---|
◆ mergeVectorRegsToResultRegs()
Pack values SrcRegs to cover the vector type result DstRegs.
Definition at line 332 of file CallLowering.cpp.
References assert(), B(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::copy(), llvm::getCoverTy(), llvm::LLT::getSizeInBits(), I, MRI, llvm::ArrayRef< T >::size(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by buildCopyFromRegs().