LLVM  12.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::InlineAsmLowering Class Reference

#include "llvm/CodeGen/GlobalISel/InlineAsmLowering.h"

Public Member Functions

bool lowerInlineAsm (MachineIRBuilder &MIRBuilder, const CallBase &CB, std::function< ArrayRef< Register >(const Value &Val)> GetOrCreateVRegs) const
 Lower the given inline asm call instruction GetOrCreateVRegs is a callback to materialize a register for the input and output operands of the inline asm. More...
 
virtual bool lowerAsmOperandForConstraint (Value *Val, StringRef Constraint, std::vector< MachineOperand > &Ops, MachineIRBuilder &MIRBuilder) const
 Lower the specified operand into the Ops vector. More...
 
 InlineAsmLowering (const TargetLowering *TLI)
 
virtual ~InlineAsmLowering ()=default
 

Protected Member Functions

const TargetLoweringgetTLI () const
 Getter for generic TargetLowering class. More...
 
template<class XXXTargetLowering >
const XXXTargetLowering * getTLI () const
 Getter for target specific TargetLowering class. More...
 

Detailed Description

Definition at line 28 of file InlineAsmLowering.h.

Constructor & Destructor Documentation

◆ InlineAsmLowering()

llvm::InlineAsmLowering::InlineAsmLowering ( const TargetLowering TLI)
inline

Definition at line 61 of file InlineAsmLowering.h.

References ~InlineAsmLowering().

◆ ~InlineAsmLowering()

virtual llvm::InlineAsmLowering::~InlineAsmLowering ( )
virtualdefault

Referenced by InlineAsmLowering().

Member Function Documentation

◆ getTLI() [1/2]

const TargetLowering* llvm::InlineAsmLowering::getTLI ( ) const
inlineprotected

Getter for generic TargetLowering class.

Definition at line 53 of file InlineAsmLowering.h.

◆ getTLI() [2/2]

template<class XXXTargetLowering >
const XXXTargetLowering* llvm::InlineAsmLowering::getTLI ( ) const
inlineprotected

Getter for target specific TargetLowering class.

Definition at line 56 of file InlineAsmLowering.h.

◆ lowerAsmOperandForConstraint()

bool InlineAsmLowering::lowerAsmOperandForConstraint ( Value Val,
StringRef  Constraint,
std::vector< MachineOperand > &  Ops,
MachineIRBuilder MIRBuilder 
) const
virtual

Lower the specified operand into the Ops vector.

Val is the IR input value to be lowered Constraint is the user supplied constraint string Ops is the vector to be filled with the lowered operands

Returns
True if the lowering succeeds, false otherwise.

Definition at line 645 of file InlineAsmLowering.cpp.

References assert(), llvm::MachineOperand::CreateImm(), and llvm::StringRef::size().

Referenced by lowerInlineAsm().

◆ lowerInlineAsm()

bool InlineAsmLowering::lowerInlineAsm ( MachineIRBuilder MIRBuilder,
const CallBase CB,
std::function< ArrayRef< Register >(const Value &Val)>  GetOrCreateVRegs 
) const

Lower the given inline asm call instruction GetOrCreateVRegs is a callback to materialize a register for the input and output operands of the inline asm.

Returns
True if the lowering succeeds, false otherwise.

ConstraintOperands - Information about all of the constraints.

Definition at line 273 of file InlineAsmLowering.cpp.

References llvm::MachineInstrBuilder::addExternalSymbol(), assert(), buildAnyextOrCopy(), llvm::MachineIRBuilder::buildCopy(), llvm::MachineIRBuilder::buildInstrNoInsert(), llvm::MachineIRBuilder::buildTrunc(), llvm::TargetLowering::C_Immediate, llvm::TargetLowering::C_Memory, llvm::TargetLowering::C_Other, llvm::TargetLowering::C_Register, llvm::TargetLowering::C_RegisterClass, llvm::TargetLowering::C_Unknown, computeConstraintToUse(), llvm::InlineAsm::Constraint_Unknown, llvm::MachineRegisterInfo::createGenericVirtualRegister(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::tgtok::Def, llvm::RegState::Define, DL, llvm::dyn_cast(), llvm::numbers::e, llvm::RegState::EarlyClobber, F(), llvm::CallBase::getArgOperand(), llvm::InlineAsm::getAsmString(), llvm::CallBase::getCalledOperand(), llvm::Module::getDataLayout(), llvm::PointerType::getElementType(), llvm::InlineAsm::getFlagWord(), llvm::InlineAsm::getFlagWordForMatchingOp(), llvm::InlineAsm::getFlagWordForMem(), llvm::InlineAsm::getFlagWordForRegClass(), llvm::MachineFunction::getFunction(), llvm::TargetRegisterClass::getID(), llvm::getImplRegState(), llvm::Instruction::getMetadata(), llvm::MachineIRBuilder::getMF(), llvm::MachineIRBuilder::getMRI(), llvm::MachineInstr::getNumOperands(), getNumOpRegs(), llvm::GlobalValue::getParent(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetSubtargetInfo::getRegisterInfo(), getRegistersForValue(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::LLT::getSizeInBits(), llvm::MachineFunction::getSubtarget(), llvm::Value::getType(), llvm::MachineRegisterInfo::getType(), llvm::ISD::INLINEASM, llvm::MachineIRBuilder::insertInstr(), llvm::InlineAsm::isClobber, llvm::InlineAsm::isInput, llvm::InlineAsm::isMemKind(), llvm::InlineAsm::isOutput, llvm::Register::isPhysical(), llvm::InlineAsm::isRegDefEarlyClobberKind(), llvm::InlineAsm::isRegDefKind(), llvm::Type::isSingleValueType(), llvm::Type::isVoidTy(), llvm::InlineAsm::Kind_Clobber, llvm::InlineAsm::Kind_Imm, llvm::InlineAsm::Kind_Mem, llvm::InlineAsm::Kind_RegDef, llvm::InlineAsm::Kind_RegDefEarlyClobber, llvm::InlineAsm::Kind_RegUse, LLVM_DEBUG, lowerAsmOperandForConstraint(), MRI, llvm::MVT::Other, Reg, llvm::report_fatal_error(), llvm::LLT::scalar(), llvm::ArrayRef< T >::size(), and TRI.

Referenced by getConstrainedOpcode().


The documentation for this class was generated from the following files: