class FastISel

Declaration

class FastISel { /* full declaration omitted */ };

Description

This is a fast-path instruction selection class that generates poor code and doesn't support illegal types or non-trivial lowering, but runs quickly.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:65

Member Variables

protected DenseMap<const llvm::Value*, llvm::Register> LocalValueMap
protected llvm::FunctionLoweringInfo& FuncInfo
protected llvm::MachineFunction* MF
protected llvm::MachineRegisterInfo& MRI
protected llvm::MachineFrameInfo& MFI
protected llvm::MachineConstantPool& MCP
protected llvm::DebugLoc DbgLoc
protected const llvm::TargetMachine& TM
protected const llvm::DataLayout& DL
protected const llvm::TargetInstrInfo& TII
protected const llvm::TargetLowering& TLI
protected const llvm::TargetRegisterInfo& TRI
protected const llvm::TargetLibraryInfo* LibInfo
protected bool SkipTargetIndependentISel
protected bool UseInstrRefDebugInfo = false
protected llvm::MachineInstr* LastLocalValue = nullptr
The position of the last instruction for materializing constants for use in the current block. It resets to EmitStartPt when it makes sense (for example, it's usually profitable to avoid function calls between the definition and the use)
protected llvm::MachineInstr* EmitStartPt = nullptr
The top most instruction in the current block that is allowed for emitting local variables. LastLocalValue resets to EmitStartPt when it makes sense (for example, on function calls)
private MachineBasicBlock::iterator SavedInsertPt
Insertion point before trying to select the current instruction.

Method Overview

  • protected FastISel(llvm::FunctionLoweringInfo & FuncInfo, const llvm::TargetLibraryInfo * LibInfo, bool SkipTargetIndependentISel = false)
  • private bool addStackMapLiveVars(SmallVectorImpl<llvm::MachineOperand> & Ops, const llvm::CallInst * CI, unsigned int StartIdx)
  • protected bool canFoldAddIntoGEP(const llvm::User * GEP, const llvm::Value * Add)
  • protected llvm::Register constrainOperandRegClass(const llvm::MCInstrDesc & II, llvm::Register Op, unsigned int OpNum)
  • protected llvm::MachineMemOperand * createMachineMemOperandFor(const llvm::Instruction * I) const
  • protected llvm::Register createResultReg(const llvm::TargetRegisterClass * RC)
  • public llvm::FastISel::SavePoint enterLocalValueArea()
  • protected void fastEmitBranch(llvm::MachineBasicBlock * MSucc, const llvm::DebugLoc & DbgLoc)
  • protected llvm::Register fastEmitInst_(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC)
  • protected llvm::Register fastEmitInst_extractsubreg(llvm::MVT RetVT, unsigned int Op0, uint32_t Idx)
  • protected llvm::Register fastEmitInst_f(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, const llvm::ConstantFP * FPImm)
  • protected llvm::Register fastEmitInst_i(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, uint64_t Imm)
  • protected llvm::Register fastEmitInst_r(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0)
  • protected llvm::Register fastEmitInst_ri(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0, uint64_t Imm)
  • protected llvm::Register fastEmitInst_rii(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0, uint64_t Imm1, uint64_t Imm2)
  • protected llvm::Register fastEmitInst_rr(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0, unsigned int Op1)
  • protected llvm::Register fastEmitInst_rri(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0, unsigned int Op1, uint64_t Imm)
  • protected llvm::Register fastEmitInst_rrr(unsigned int MachineInstOpcode, const llvm::TargetRegisterClass * RC, unsigned int Op0, unsigned int Op1, unsigned int Op2)
  • protected llvm::Register fastEmitZExtFromI1(llvm::MVT VT, unsigned int Op0)
  • protected virtual unsigned int fastEmit_(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode)
  • protected virtual unsigned int fastEmit_f(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode, const llvm::ConstantFP * FPImm)
  • protected virtual unsigned int fastEmit_i(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode, uint64_t Imm)
  • protected virtual unsigned int fastEmit_r(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode, unsigned int Op0)
  • protected virtual unsigned int fastEmit_ri(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode, unsigned int Op0, uint64_t Imm)
  • protected llvm::Register fastEmit_ri_(llvm::MVT VT, unsigned int Opcode, unsigned int Op0, uint64_t Imm, llvm::MVT ImmType)
  • protected virtual unsigned int fastEmit_rr(llvm::MVT VT, llvm::MVT RetVT, unsigned int Opcode, unsigned int Op0, unsigned int Op1)
  • protected virtual bool fastLowerArguments()
  • protected virtual bool fastLowerCall(llvm::FastISel::CallLoweringInfo & CLI)
  • protected virtual bool fastLowerIntrinsicCall(const llvm::IntrinsicInst * II)
  • protected virtual unsigned int fastMaterializeAlloca(const llvm::AllocaInst * C)
  • protected virtual unsigned int fastMaterializeConstant(const llvm::Constant * C)
  • protected virtual unsigned int fastMaterializeFloatZero(const llvm::ConstantFP * CF)
  • protected virtual bool fastSelectInstruction(const llvm::Instruction * I)
  • public void finishBasicBlock()
  • protected void finishCondBranch(const llvm::BasicBlock * BranchBB, llvm::MachineBasicBlock * TrueMBB, llvm::MachineBasicBlock * FalseMBB)
  • private void flushLocalValueMap()
  • public llvm::DebugLoc getCurDebugLoc() const
  • public llvm::MachineInstr * getLastLocalValue()
  • public llvm::Register getRegForGEPIndex(const llvm::Value * Idx)
  • public llvm::Register getRegForValue(const llvm::Value * V)
  • private bool handlePHINodesInSuccessorBlocks(const llvm::BasicBlock * LLVMBB)
  • public void leaveLocalValueArea(llvm::FastISel::SavePoint Old)
  • public llvm::Register lookUpRegForValue(const llvm::Value * V)
  • public bool lowerArguments()
  • protected bool lowerCall(const llvm::CallInst * I)
  • private bool lowerCallOperands(const llvm::CallInst * CI, unsigned int ArgIdx, unsigned int NumArgs, const llvm::Value * Callee, bool ForceRetVoidTy, llvm::FastISel::CallLoweringInfo & CLI)
  • protected bool lowerCallTo(llvm::FastISel::CallLoweringInfo & CLI)
  • protected bool lowerCallTo(const llvm::CallInst * CI, llvm::MCSymbol * Symbol, unsigned int NumArgs)
  • protected bool lowerCallTo(const llvm::CallInst * CI, const char * SymName, unsigned int NumArgs)
  • private llvm::Register materializeConstant(const llvm::Value * V, llvm::MVT VT)
  • private llvm::Register materializeRegForValue(const llvm::Value * V, llvm::MVT VT)
  • protected CmpInst::Predicate optimizeCmpPredicate(const llvm::CmpInst * CI) const
  • public void recomputeInsertPt()
  • public void removeDeadCode(MachineBasicBlock::iterator I, MachineBasicBlock::iterator E)
  • private void removeDeadLocalValueCode(llvm::MachineInstr * SavedLastLocalValue)
  • protected bool selectBinaryOp(const llvm::User * I, unsigned int ISDOpcode)
  • protected bool selectBitCast(const llvm::User * I)
  • protected bool selectCall(const llvm::User * I)
  • protected bool selectCast(const llvm::User * I, unsigned int Opcode)
  • protected bool selectExtractValue(const llvm::User * U)
  • protected bool selectFNeg(const llvm::User * I, const llvm::Value * In)
  • protected bool selectFreeze(const llvm::User * I)
  • protected bool selectGetElementPtr(const llvm::User * I)
  • public bool selectInstruction(const llvm::Instruction * I)
  • protected bool selectIntrinsicCall(const llvm::IntrinsicInst * II)
  • public bool selectOperator(const llvm::User * I, unsigned int Opcode)
  • protected bool selectPatchpoint(const llvm::CallInst * I)
  • protected bool selectStackmap(const llvm::CallInst * I)
  • protected bool selectXRayCustomEvent(const llvm::CallInst * II)
  • protected bool selectXRayTypedEvent(const llvm::CallInst * II)
  • public void setLastLocalValue(llvm::MachineInstr * I)
  • protected bool shouldOptForSize(const llvm::MachineFunction * MF) const
  • public void startNewBlock()
  • public bool tryToFoldLoad(const llvm::LoadInst * LI, const llvm::Instruction * FoldInst)
  • public virtual bool tryToFoldLoadIntoMI(llvm::MachineInstr *, unsigned int, const llvm::LoadInst *)
  • protected void updateValueMap(const llvm::Value * I, llvm::Register Reg, unsigned int NumRegs = 1)
  • public void useInstrRefDebugInfo(bool Flag)
  • public virtual ~FastISel()

Methods

FastISel(llvm::FunctionLoweringInfo& FuncInfo,
         const llvm::TargetLibraryInfo* LibInfo,
         bool SkipTargetIndependentISel = false)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:329

Parameters

llvm::FunctionLoweringInfo& FuncInfo
const llvm::TargetLibraryInfo* LibInfo
bool SkipTargetIndependentISel = false

bool addStackMapLiveVars(
    SmallVectorImpl<llvm::MachineOperand>& Ops,
    const llvm::CallInst* CI,
    unsigned int StartIdx)

Description

Add a stackmap or patchpoint intrinsic call's live variable operands to a stackmap or patchpoint machine instruction.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:559

Parameters

SmallVectorImpl<llvm::MachineOperand>& Ops
const llvm::CallInst* CI
unsigned int StartIdx

bool canFoldAddIntoGEP(const llvm::User* GEP,
                       const llvm::Value* Add)

Description

Check if \c Add is an add that can be safely folded into \c GEP. \c Add can be folded into \c GEP if: - \c Add is an add, - \c Add's size matches \c GEP's, - \c Add is in the same basic block as \c GEP, and - \c Add has a constant operand.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:493

Parameters

const llvm::User* GEP
const llvm::Value* Add

llvm::Register constrainOperandRegClass(
    const llvm::MCInstrDesc& II,
    llvm::Register Op,
    unsigned int OpNum)

Description

Try to constrain Op so that it is usable by argument OpNum of the provided MCInstrDesc. If this fails, create a new virtual register in the correct class and COPY the value there.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:470

Parameters

const llvm::MCInstrDesc& II
llvm::Register Op
unsigned int OpNum

llvm::MachineMemOperand*
createMachineMemOperandFor(
    const llvm::Instruction* I) const

Description

Create a machine mem operand from the given instruction.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:496

Parameters

const llvm::Instruction* I

llvm::Register createResultReg(
    const llvm::TargetRegisterClass* RC)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:465

Parameters

const llvm::TargetRegisterClass* RC

llvm::FastISel::SavePoint enterLocalValueArea()

Description

Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:317

void fastEmitBranch(
    llvm::MachineBasicBlock* MSucc,
    const llvm::DebugLoc& DbgLoc)

Description

Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:449

Parameters

llvm::MachineBasicBlock* MSucc
const llvm::DebugLoc& DbgLoc

llvm::Register fastEmitInst_(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC)

Description

Emit a MachineInstr with no operands and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:390

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC

llvm::Register fastEmitInst_extractsubreg(
    llvm::MVT RetVT,
    unsigned int Op0,
    uint32_t Idx)

Description

Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:441

Parameters

llvm::MVT RetVT
unsigned int Op0
uint32_t Idx

llvm::Register fastEmitInst_f(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    const llvm::ConstantFP* FPImm)

Description

Emit a MachineInstr with a floating point immediate, and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:424

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
const llvm::ConstantFP* FPImm

llvm::Register fastEmitInst_i(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    uint64_t Imm)

Description

Emit a MachineInstr with a single immediate operand, and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:436

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
uint64_t Imm

llvm::Register fastEmitInst_r(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0)

Description

Emit a MachineInstr with one register operand and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:395

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0

llvm::Register fastEmitInst_ri(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0,
    uint64_t Imm)

Description

Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:412

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0
uint64_t Imm

llvm::Register fastEmitInst_rii(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0,
    uint64_t Imm1,
    uint64_t Imm2)

Description

Emit a MachineInstr with one register operand and two immediate operands.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:418

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0
uint64_t Imm1
uint64_t Imm2

llvm::Register fastEmitInst_rr(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0,
    unsigned int Op1)

Description

Emit a MachineInstr with two register operands and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:400

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0
unsigned int Op1

llvm::Register fastEmitInst_rri(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0,
    unsigned int Op1,
    uint64_t Imm)

Description

Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:430

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0
unsigned int Op1
uint64_t Imm

llvm::Register fastEmitInst_rrr(
    unsigned int MachineInstOpcode,
    const llvm::TargetRegisterClass* RC,
    unsigned int Op0,
    unsigned int Op1,
    unsigned int Op2)

Description

Emit a MachineInstr with three register operands and a result register in the given register class.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:406

Parameters

unsigned int MachineInstOpcode
const llvm::TargetRegisterClass* RC
unsigned int Op0
unsigned int Op1
unsigned int Op2

llvm::Register fastEmitZExtFromI1(
    llvm::MVT VT,
    unsigned int Op0)

Description

Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:445

Parameters

llvm::MVT VT
unsigned int Op0

virtual unsigned int fastEmit_(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode)

Description

This method is called by target-independent code to request that an instruction with the given type and opcode be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:353

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode

virtual unsigned int fastEmit_f(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode,
    const llvm::ConstantFP* FPImm)

Description

This method is called by target-independent code to request that an instruction with the given type, opcode, and floating-point immediate operand be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:385

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode
const llvm::ConstantFP* FPImm

virtual unsigned int fastEmit_i(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode,
    uint64_t Imm)

Description

This method is called by target-independent code to request that an instruction with the given type, opcode, and immediate operand be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:380

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode
uint64_t Imm

virtual unsigned int fastEmit_r(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode,
    unsigned int Op0)

Description

This method is called by target-independent code to request that an instruction with the given type, opcode, and register operand be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:357

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode
unsigned int Op0

virtual unsigned int fastEmit_ri(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode,
    unsigned int Op0,
    uint64_t Imm)

Description

This method is called by target-independent code to request that an instruction with the given type, opcode, and register and immediate operands be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:367

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode
unsigned int Op0
uint64_t Imm

llvm::Register fastEmit_ri_(llvm::MVT VT,
                            unsigned int Opcode,
                            unsigned int Op0,
                            uint64_t Imm,
                            llvm::MVT ImmType)

Description

This method is a wrapper of fastEmit_ri. It first tries to emit an instruction with an immediate operand using fastEmit_ri. If that fails, it materializes the immediate into a register and try fastEmit_rr instead.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:375

Parameters

llvm::MVT VT
unsigned int Opcode
unsigned int Op0
uint64_t Imm
llvm::MVT ImmType

virtual unsigned int fastEmit_rr(
    llvm::MVT VT,
    llvm::MVT RetVT,
    unsigned int Opcode,
    unsigned int Op0,
    unsigned int Op1)

Description

This method is called by target-independent code to request that an instruction with the given type, opcode, and register operands be emitted.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:361

Parameters

llvm::MVT VT
llvm::MVT RetVT
unsigned int Opcode
unsigned int Op0
unsigned int Op1

virtual bool fastLowerArguments()

Description

This method is called by target-independent code to do target- specific argument lowering. It returns true if it was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:341

virtual bool fastLowerCall(
    llvm::FastISel::CallLoweringInfo& CLI)

Description

This method is called by target-independent code to do target- specific call lowering. It returns true if it was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:345

Parameters

llvm::FastISel::CallLoweringInfo& CLI

virtual bool fastLowerIntrinsicCall(
    const llvm::IntrinsicInst* II)

Description

This method is called by target-independent code to do target- specific intrinsic lowering. It returns true if it was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:349

Parameters

const llvm::IntrinsicInst* II

virtual unsigned int fastMaterializeAlloca(
    const llvm::AllocaInst* C)

Description

Emit an alloca address in a register using target-specific logic.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:478

Parameters

const llvm::AllocaInst* C

virtual unsigned int fastMaterializeConstant(
    const llvm::Constant* C)

Description

Emit a constant in a register using target-specific logic, such as constant pool loads.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:475

Parameters

const llvm::Constant* C

virtual unsigned int fastMaterializeFloatZero(
    const llvm::ConstantFP* CF)

Description

Emit the floating-point constant +0.0 in a register using target- specific logic.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:482

Parameters

const llvm::ConstantFP* CF

virtual bool fastSelectInstruction(
    const llvm::Instruction* I)

Description

This method is called by target-independent code when the normal FastISel process fails to select an instruction. This gives targets a chance to emit code for anything that doesn't fit into FastISel's framework. It returns true if it was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:337

Parameters

const llvm::Instruction* I

void finishBasicBlock()

Description

Flush the local value map.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:247

void finishCondBranch(
    const llvm::BasicBlock* BranchBB,
    llvm::MachineBasicBlock* TrueMBB,
    llvm::MachineBasicBlock* FalseMBB)

Description

Emit an unconditional branch to \p FalseMBB, obtains the branch weight and adds TrueMBB and FalseMBB to the successor list.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:453

Parameters

const llvm::BasicBlock* BranchBB
llvm::MachineBasicBlock* TrueMBB
llvm::MachineBasicBlock* FalseMBB

void flushLocalValueMap()

Description

Clears LocalValueMap and moves the area for the new local variables to the beginning of the block. It helps to avoid spilling cached variables across heavy instructions like calls.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:549

llvm::DebugLoc getCurDebugLoc() const

Description

Return current debug location information.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:250

llvm::MachineInstr* getLastLocalValue()

Description

Return the position of the last instruction emitted for materializing constants for use in the current block.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:233

llvm::Register getRegForGEPIndex(
    const llvm::Value* Idx)

Description

This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:278

Parameters

const llvm::Value* Idx

llvm::Register getRegForValue(
    const llvm::Value* V)

Description

Create a virtual register and arrange for it to be assigned the value for the given LLVM value.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:269

Parameters

const llvm::Value* V

bool handlePHINodesInSuccessorBlocks(
    const llvm::BasicBlock* LLVMBB)

Description

Handle PHI nodes in successor blocks. Emit code to ensure constants are copied into registers when needed. Remember the virtual registers that need to be added to the Machine PHI nodes as input. We cannot just directly add them, because expansion might result in multiple MBB's for one BB. As such, the start of the BB might correspond to a different MBB than the end.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:535

Parameters

const llvm::BasicBlock* LLVMBB

void leaveLocalValueArea(
    llvm::FastISel::SavePoint Old)

Description

Reset InsertPt to the given old insert position.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:320

Parameters

llvm::FastISel::SavePoint Old

llvm::Register lookUpRegForValue(
    const llvm::Value* V)

Description

Look up the value to see if its value is already cached in a register. It may be defined by instructions across blocks or defined locally.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:274

Parameters

const llvm::Value* V

bool lowerArguments()

Description

Do "fast" instruction selection for function arguments and append the machine instructions to the current block. Returns true when successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:255

bool lowerCall(const llvm::CallInst* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:505

Parameters

const llvm::CallInst* I

bool lowerCallOperands(
    const llvm::CallInst* CI,
    unsigned int ArgIdx,
    unsigned int NumArgs,
    const llvm::Value* Callee,
    bool ForceRetVoidTy,
    llvm::FastISel::CallLoweringInfo& CLI)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:561

Parameters

const llvm::CallInst* CI
unsigned int ArgIdx
unsigned int NumArgs
const llvm::Value* Callee
bool ForceRetVoidTy
llvm::FastISel::CallLoweringInfo& CLI

bool lowerCallTo(
    llvm::FastISel::CallLoweringInfo& CLI)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:503

Parameters

llvm::FastISel::CallLoweringInfo& CLI

bool lowerCallTo(const llvm::CallInst* CI,
                 llvm::MCSymbol* Symbol,
                 unsigned int NumArgs)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:500

Parameters

const llvm::CallInst* CI
llvm::MCSymbol* Symbol
unsigned int NumArgs

bool lowerCallTo(const llvm::CallInst* CI,
                 const char* SymName,
                 unsigned int NumArgs)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:501

Parameters

const llvm::CallInst* CI
const char* SymName
unsigned int NumArgs

llvm::Register materializeConstant(
    const llvm::Value* V,
    llvm::MVT VT)

Description

Helper for materializeRegForValue to materialize a constant in a target-independent way.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:539

Parameters

const llvm::Value* V
llvm::MVT VT

llvm::Register materializeRegForValue(
    const llvm::Value* V,
    llvm::MVT VT)

Description

Helper for getRegForVale. This function is called when the value isn't already available in a register and must be materialized with new instructions.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:544

Parameters

const llvm::Value* V
llvm::MVT VT

CmpInst::Predicate optimizeCmpPredicate(
    const llvm::CmpInst* CI) const

Declared at: llvm/include/llvm/CodeGen/FastISel.h:498

Parameters

const llvm::CmpInst* CI

void recomputeInsertPt()

Description

Reset InsertPt to prepare for inserting instructions into the current block.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:307

void removeDeadCode(MachineBasicBlock::iterator I,
                    MachineBasicBlock::iterator E)

Description

Remove all dead instructions between the I and E.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:310

Parameters

MachineBasicBlock::iterator I
MachineBasicBlock::iterator E

void removeDeadLocalValueCode(
    llvm::MachineInstr* SavedLastLocalValue)

Description

Removes dead local value instructions after SavedLastLocalvalue.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:552

Parameters

llvm::MachineInstr* SavedLastLocalValue

bool selectBinaryOp(const llvm::User* I,
                    unsigned int ISDOpcode)

Description

Select and emit code for a binary operator instruction, which has an opcode which directly corresponds to the given ISD opcode.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:508

Parameters

const llvm::User* I
unsigned int ISDOpcode

bool selectBitCast(const llvm::User* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:515

Parameters

const llvm::User* I

bool selectCall(const llvm::User* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:513

Parameters

const llvm::User* I

bool selectCast(const llvm::User* I,
                unsigned int Opcode)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:517

Parameters

const llvm::User* I
unsigned int Opcode

bool selectExtractValue(const llvm::User* U)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:518

Parameters

const llvm::User* U

bool selectFNeg(const llvm::User* I,
                const llvm::Value* In)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:509

Parameters

const llvm::User* I
const llvm::Value* In

bool selectFreeze(const llvm::User* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:516

Parameters

const llvm::User* I

bool selectGetElementPtr(const llvm::User* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:510

Parameters

const llvm::User* I

bool selectInstruction(const llvm::Instruction* I)

Description

Do "fast" instruction selection for the given LLVM IR instruction and append the generated machine instructions to the current block. Returns true if selection was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:260

Parameters

const llvm::Instruction* I

bool selectIntrinsicCall(
    const llvm::IntrinsicInst* II)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:514

Parameters

const llvm::IntrinsicInst* II

bool selectOperator(const llvm::User* I,
                    unsigned int Opcode)

Description

Do "fast" instruction selection for the given LLVM IR operator (Instruction or ConstantExpr), and append generated machine instructions to the current block. Return true if selection was successful.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:265

Parameters

const llvm::User* I
unsigned int Opcode

bool selectPatchpoint(const llvm::CallInst* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:512

Parameters

const llvm::CallInst* I

bool selectStackmap(const llvm::CallInst* I)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:511

Parameters

const llvm::CallInst* I

bool selectXRayCustomEvent(
    const llvm::CallInst* II)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:519

Parameters

const llvm::CallInst* II

bool selectXRayTypedEvent(
    const llvm::CallInst* II)

Declared at: llvm/include/llvm/CodeGen/FastISel.h:520

Parameters

const llvm::CallInst* II

void setLastLocalValue(llvm::MachineInstr* I)

Description

Update the position of the last instruction emitted for materializing constants for use in the current block.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:237

Parameters

llvm::MachineInstr* I

bool shouldOptForSize(
    const llvm::MachineFunction* MF) const

Declared at: llvm/include/llvm/CodeGen/FastISel.h:522

Parameters

const llvm::MachineFunction* MF

void startNewBlock()

Description

Set the current block to which generated machine instructions will be appended.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:244

bool tryToFoldLoad(
    const llvm::LoadInst* LI,
    const llvm::Instruction* FoldInst)

Description

We're checking to see if we can fold \p LI into \p FoldInst. Note that we could have a sequence where multiple LLVM IR instructions are folded into the same machineinstr. For example we could have: A: x = load i32 *P B: y = icmp A, 42 C: br y, ... In this scenario, \p LI is "A", and \p FoldInst is "C". We know about "B" (and any other folded instructions) because it is between A and C. If we succeed folding, return true.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:292

Parameters

const llvm::LoadInst* LI
const llvm::Instruction* FoldInst

virtual bool tryToFoldLoadIntoMI(
    llvm::MachineInstr*,
    unsigned int,
    const llvm::LoadInst*)

Description

The specified machine instr operand is a vreg, and that vreg is being provided by the specified load instruction. If possible, try to fold the load as an operand to the instruction, returning true if possible. This method should be implemented by targets.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:300

Parameters

llvm::MachineInstr*
unsigned int
const llvm::LoadInst*

void updateValueMap(const llvm::Value* I,
                    llvm::Register Reg,
                    unsigned int NumRegs = 1)

Description

Update the value map to include the new mapping for this instruction, or insert an extra copy to get the result in a previous determined register. NOTE: This is only necessary because we might select a block that uses a value before we select the block that defines the value. It might be possible to fix this by selecting blocks in reverse postorder.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:463

Parameters

const llvm::Value* I
llvm::Register Reg
unsigned int NumRegs = 1

void useInstrRefDebugInfo(bool Flag)

Description

Signal whether instruction referencing variable locations are desired for this function's debug-info.

Declared at: llvm/include/llvm/CodeGen/FastISel.h:324

Parameters

bool Flag

virtual ~FastISel()

Declared at: llvm/include/llvm/CodeGen/FastISel.h:229