LLVM 20.0.0git
|
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. More...
#include "llvm/CodeGen/FastISel.h"
Classes | |
struct | CallLoweringInfo |
Public Types | |
using | ArgListEntry = TargetLoweringBase::ArgListEntry |
using | ArgListTy = TargetLoweringBase::ArgListTy |
using | SavePoint = MachineBasicBlock::iterator |
Public Member Functions | |
virtual | ~FastISel () |
MachineInstr * | getLastLocalValue () |
Return the position of the last instruction emitted for materializing constants for use in the current block. | |
void | setLastLocalValue (MachineInstr *I) |
Update the position of the last instruction emitted for materializing constants for use in the current block. | |
void | startNewBlock () |
Set the current block to which generated machine instructions will be appended. | |
void | finishBasicBlock () |
Flush the local value map. | |
DebugLoc | getCurDebugLoc () const |
Return current debug location information. | |
bool | lowerArguments () |
Do "fast" instruction selection for function arguments and append the machine instructions to the current block. | |
bool | selectInstruction (const Instruction *I) |
Do "fast" instruction selection for the given LLVM IR instruction and append the generated machine instructions to the current block. | |
bool | selectOperator (const User *I, unsigned Opcode) |
Do "fast" instruction selection for the given LLVM IR operator (Instruction or ConstantExpr), and append generated machine instructions to the current block. | |
Register | getRegForValue (const Value *V) |
Create a virtual register and arrange for it to be assigned the value for the given LLVM value. | |
Register | lookUpRegForValue (const Value *V) |
Look up the value to see if its value is already cached in a register. | |
Register | getRegForGEPIndex (const Value *Idx) |
This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value. | |
bool | tryToFoldLoad (const LoadInst *LI, const Instruction *FoldInst) |
We're checking to see if we can fold LI into FoldInst . | |
virtual bool | tryToFoldLoadIntoMI (MachineInstr *, unsigned, const LoadInst *) |
The specified machine instr operand is a vreg, and that vreg is being provided by the specified load instruction. | |
void | recomputeInsertPt () |
Reset InsertPt to prepare for inserting instructions into the current block. | |
void | removeDeadCode (MachineBasicBlock::iterator I, MachineBasicBlock::iterator E) |
Remove all dead instructions between the I and E. | |
SavePoint | enterLocalValueArea () |
Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position. | |
void | leaveLocalValueArea (SavePoint Old) |
Reset InsertPt to the given old insert position. | |
void | handleDbgInfo (const Instruction *II) |
Target-independent lowering of non-instruction debug info associated with this instruction. | |
Protected Member Functions | |
FastISel (FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo, bool SkipTargetIndependentISel=false) | |
virtual bool | fastSelectInstruction (const Instruction *I)=0 |
This method is called by target-independent code when the normal FastISel process fails to select an instruction. | |
virtual bool | fastLowerArguments () |
This method is called by target-independent code to do target- specific argument lowering. | |
virtual bool | fastLowerCall (CallLoweringInfo &CLI) |
This method is called by target-independent code to do target- specific call lowering. | |
virtual bool | fastLowerIntrinsicCall (const IntrinsicInst *II) |
This method is called by target-independent code to do target- specific intrinsic lowering. | |
virtual unsigned | fastEmit_ (MVT VT, MVT RetVT, unsigned Opcode) |
This method is called by target-independent code to request that an instruction with the given type and opcode be emitted. | |
virtual unsigned | fastEmit_r (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0) |
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operand be emitted. | |
virtual unsigned | fastEmit_rr (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, unsigned Op1) |
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operands be emitted. | |
virtual unsigned | fastEmit_ri (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, uint64_t Imm) |
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. | |
Register | fastEmit_ri_ (MVT VT, unsigned Opcode, unsigned Op0, uint64_t Imm, MVT ImmType) |
This method is a wrapper of fastEmit_ri. | |
virtual unsigned | fastEmit_i (MVT VT, MVT RetVT, unsigned Opcode, uint64_t Imm) |
This method is called by target-independent code to request that an instruction with the given type, opcode, and immediate operand be emitted. | |
virtual unsigned | fastEmit_f (MVT VT, MVT RetVT, unsigned Opcode, const ConstantFP *FPImm) |
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. | |
Register | fastEmitInst_ (unsigned MachineInstOpcode, const TargetRegisterClass *RC) |
Emit a MachineInstr with no operands and a result register in the given register class. | |
Register | fastEmitInst_r (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0) |
Emit a MachineInstr with one register operand and a result register in the given register class. | |
Register | fastEmitInst_rr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, unsigned Op1) |
Emit a MachineInstr with two register operands and a result register in the given register class. | |
Register | fastEmitInst_rrr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, unsigned Op1, unsigned Op2) |
Emit a MachineInstr with three register operands and a result register in the given register class. | |
Register | fastEmitInst_ri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, uint64_t Imm) |
Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class. | |
Register | fastEmitInst_rii (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, uint64_t Imm1, uint64_t Imm2) |
Emit a MachineInstr with one register operand and two immediate operands. | |
Register | fastEmitInst_f (unsigned MachineInstOpcode, const TargetRegisterClass *RC, const ConstantFP *FPImm) |
Emit a MachineInstr with a floating point immediate, and a result register in the given register class. | |
Register | fastEmitInst_rri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, unsigned Op1, uint64_t Imm) |
Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class. | |
Register | fastEmitInst_i (unsigned MachineInstOpcode, const TargetRegisterClass *RC, uint64_t Imm) |
Emit a MachineInstr with a single immediate operand, and a result register in the given register class. | |
Register | fastEmitInst_extractsubreg (MVT RetVT, unsigned Op0, uint32_t Idx) |
Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type. | |
Register | fastEmitZExtFromI1 (MVT VT, unsigned Op0) |
Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero. | |
void | fastEmitBranch (MachineBasicBlock *MSucc, const DebugLoc &DbgLoc) |
Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG. | |
void | finishCondBranch (const BasicBlock *BranchBB, MachineBasicBlock *TrueMBB, MachineBasicBlock *FalseMBB) |
Emit an unconditional branch to FalseMBB , obtains the branch weight and adds TrueMBB and FalseMBB to the successor list. | |
void | updateValueMap (const Value *I, Register Reg, unsigned NumRegs=1) |
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. | |
Register | createResultReg (const TargetRegisterClass *RC) |
Register | constrainOperandRegClass (const MCInstrDesc &II, Register Op, unsigned OpNum) |
Try to constrain Op so that it is usable by argument OpNum of the provided MCInstrDesc. | |
virtual unsigned | fastMaterializeConstant (const Constant *C) |
Emit a constant in a register using target-specific logic, such as constant pool loads. | |
virtual unsigned | fastMaterializeAlloca (const AllocaInst *C) |
Emit an alloca address in a register using target-specific logic. | |
virtual unsigned | fastMaterializeFloatZero (const ConstantFP *CF) |
Emit the floating-point constant +0.0 in a register using target- specific logic. | |
bool | canFoldAddIntoGEP (const User *GEP, const Value *Add) |
Check if Add is an add that can be safely folded into GEP . | |
MachineMemOperand * | createMachineMemOperandFor (const Instruction *I) const |
Create a machine mem operand from the given instruction. | |
CmpInst::Predicate | optimizeCmpPredicate (const CmpInst *CI) const |
bool | lowerCallTo (const CallInst *CI, MCSymbol *Symbol, unsigned NumArgs) |
bool | lowerCallTo (const CallInst *CI, const char *SymName, unsigned NumArgs) |
bool | lowerCallTo (CallLoweringInfo &CLI) |
bool | lowerCall (const CallInst *I) |
bool | selectBinaryOp (const User *I, unsigned ISDOpcode) |
Select and emit code for a binary operator instruction, which has an opcode which directly corresponds to the given ISD opcode. | |
bool | selectFNeg (const User *I, const Value *In) |
Emit an FNeg operation. | |
bool | selectGetElementPtr (const User *I) |
bool | selectStackmap (const CallInst *I) |
bool | selectPatchpoint (const CallInst *I) |
bool | selectCall (const User *I) |
bool | selectIntrinsicCall (const IntrinsicInst *II) |
bool | selectBitCast (const User *I) |
bool | selectFreeze (const User *I) |
bool | selectCast (const User *I, unsigned Opcode) |
bool | selectExtractValue (const User *U) |
bool | selectXRayCustomEvent (const CallInst *II) |
bool | selectXRayTypedEvent (const CallInst *II) |
bool | shouldOptForSize (const MachineFunction *MF) const |
virtual bool | lowerDbgValue (const Value *V, DIExpression *Expr, DILocalVariable *Var, const DebugLoc &DL) |
Target-independent lowering of debug information. | |
virtual bool | lowerDbgDeclare (const Value *V, DIExpression *Expr, DILocalVariable *Var, const DebugLoc &DL) |
Target-independent lowering of debug information. | |
Protected Attributes | |
DenseMap< const Value *, Register > | LocalValueMap |
FunctionLoweringInfo & | FuncInfo |
MachineFunction * | MF |
MachineRegisterInfo & | MRI |
MachineFrameInfo & | MFI |
MachineConstantPool & | MCP |
MIMetadata | MIMD |
const TargetMachine & | TM |
const DataLayout & | DL |
const TargetInstrInfo & | TII |
const TargetLowering & | TLI |
const TargetRegisterInfo & | TRI |
const TargetLibraryInfo * | LibInfo |
bool | SkipTargetIndependentISel |
MachineInstr * | LastLocalValue = nullptr |
The position of the last instruction for materializing constants for use in the current block. | |
MachineInstr * | EmitStartPt = nullptr |
The top most instruction in the current block that is allowed for emitting local variables. | |
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.
Definition at line 66 of file FastISel.h.
Definition at line 68 of file FastISel.h.
Definition at line 69 of file FastISel.h.
Definition at line 313 of file FastISel.h.
|
virtualdefault |
|
explicitprotected |
Definition at line 1920 of file FastISel.cpp.
Check if Add
is an add that can be safely folded into GEP
.
Add
can be folded into GEP
if:
Add
is an add,Add's
size matches GEP's
,Add
is in the same basic block as GEP
, andAdd
has a constant operand. Definition at line 2365 of file FastISel.cpp.
References llvm::Add, DL, FuncInfo, GEP, llvm::FunctionLoweringInfo::getMBB(), llvm::DataLayout::getTypeSizeInBits(), and llvm::FunctionLoweringInfo::MBB.
|
protected |
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.
Definition at line 2009 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), llvm::TargetInstrInfo::getRegClass(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, MIMD, MRI, TII, and TRI.
Referenced by fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), and fastEmitInst_rrr().
|
protected |
Create a machine mem operand from the given instruction.
Definition at line 2382 of file FastISel.cpp.
References DL, FuncInfo, llvm::DataLayout::getABITypeAlign(), llvm::MachineFunction::getMachineMemOperand(), llvm::DataLayout::getTypeStoreSize(), I, llvm::FunctionLoweringInfo::MF, llvm::MachineMemOperand::MODereferenceable, llvm::MachineMemOperand::MOInvariant, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MONonTemporal, llvm::MachineMemOperand::MOStore, llvm::MachineMemOperand::MOVolatile, Ptr, and Size.
|
protected |
Definition at line 2005 of file FastISel.cpp.
References llvm::MachineRegisterInfo::createVirtualRegister(), and MRI.
Referenced by constrainOperandRegClass(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), fastEmitInst_rrr(), selectFreeze(), and selectPatchpoint().
FastISel::SavePoint FastISel::enterLocalValueArea | ( | ) |
Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position.
Definition at line 431 of file FastISel.cpp.
References FuncInfo, llvm::FunctionLoweringInfo::InsertPt, and recomputeInsertPt().
Referenced by getRegForValue().
This method is called by target-independent code to request that an instruction with the given type and opcode be emitted.
Definition at line 1941 of file FastISel.cpp.
Referenced by selectOperator().
|
protectedvirtual |
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.
Definition at line 1956 of file FastISel.cpp.
This method is called by target-independent code to request that an instruction with the given type, opcode, and immediate operand be emitted.
Definition at line 1952 of file FastISel.cpp.
Referenced by fastEmit_ri_().
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operand be emitted.
Definition at line 1943 of file FastISel.cpp.
Referenced by getRegForGEPIndex(), selectBitCast(), selectCast(), and selectFNeg().
|
protectedvirtual |
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.
Definition at line 1961 of file FastISel.cpp.
Referenced by fastEmit_ri_(), and fastEmitZExtFromI1().
|
protected |
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.
Definition at line 1970 of file FastISel.cpp.
References llvm::ISD::Constant, fastEmit_i(), fastEmit_ri(), fastEmit_rr(), llvm::FunctionLoweringInfo::Fn, FuncInfo, llvm::IntegerType::get(), llvm::Function::getContext(), getRegForValue(), llvm::MVT::getSizeInBits(), llvm::isPowerOf2_64(), llvm::Log2_64(), llvm::ISD::MUL, llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SRL, and llvm::ISD::UDIV.
Referenced by selectBinaryOp(), selectFNeg(), and selectGetElementPtr().
|
protectedvirtual |
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operands be emitted.
Definition at line 1947 of file FastISel.cpp.
Referenced by fastEmit_ri_(), selectBinaryOp(), and selectGetElementPtr().
|
protected |
Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.
Definition at line 1666 of file FastISel.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::addSuccessorWithoutProb(), llvm::BasicBlock::back(), llvm::FunctionLoweringInfo::BPI, llvm::BasicBlock::front(), FuncInfo, llvm::MachineBasicBlock::getBasicBlock(), llvm::BranchProbabilityInfo::getEdgeProbability(), llvm::BasicBlock::getModule(), llvm::TargetInstrInfo::insertBranch(), llvm::MachineBasicBlock::isLayoutSuccessor(), llvm::Module::IsNewDbgInfoFormat, llvm::FunctionLoweringInfo::MBB, llvm::BasicBlock::sizeWithoutDebug(), and TII.
Referenced by finishCondBranch(), and selectOperator().
|
protected |
Emit a MachineInstr with no operands and a result register in the given register class.
Definition at line 2026 of file FastISel.cpp.
References llvm::BuildMI(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type.
Definition at line 2218 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetLoweringBase::getRegClassFor(), llvm::TargetRegisterInfo::getSubClassWithSubReg(), Idx, llvm::FunctionLoweringInfo::InsertPt, llvm::Register::isVirtualRegister(), llvm::FunctionLoweringInfo::MBB, MIMD, MRI, TII, TLI, and TRI.
|
protected |
Emit a MachineInstr with a floating point immediate, and a result register in the given register class.
Definition at line 2155 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addFPImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with a single immediate operand, and a result register in the given register class.
Definition at line 2201 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with one register operand and a result register in the given register class.
Definition at line 2035 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class.
Definition at line 2107 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with one register operand and two immediate operands.
Definition at line 2130 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 2056 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class.
Definition at line 2175 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
|
protected |
Emit a MachineInstr with three register operands and a result register in the given register class.
Definition at line 2080 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), FuncInfo, llvm::MCInstrInfo::get(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, MIMD, and TII.
Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.
Definition at line 2232 of file FastISel.cpp.
References llvm::ISD::AND, and fastEmit_ri().
|
protectedvirtual |
This method is called by target-independent code to do target- specific argument lowering.
It returns true if it was successful.
Definition at line 1933 of file FastISel.cpp.
Referenced by lowerArguments().
|
protectedvirtual |
This method is called by target-independent code to do target- specific call lowering.
It returns true if it was successful.
Definition at line 1935 of file FastISel.cpp.
Referenced by lowerCallTo().
|
protectedvirtual |
This method is called by target-independent code to do target- specific intrinsic lowering.
It returns true if it was successful.
Definition at line 1937 of file FastISel.cpp.
Referenced by selectIntrinsicCall().
|
inlineprotectedvirtual |
Emit an alloca address in a register using target-specific logic.
Definition at line 476 of file FastISel.h.
|
inlineprotectedvirtual |
Emit a constant in a register using target-specific logic, such as constant pool loads.
Definition at line 473 of file FastISel.h.
|
inlineprotectedvirtual |
Emit the floating-point constant +0.0 in a register using target- specific logic.
Definition at line 480 of file FastISel.h.
|
protectedpure virtual |
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.
Referenced by selectInstruction().
void FastISel::finishBasicBlock | ( | ) |
Flush the local value map.
Definition at line 137 of file FastISel.cpp.
|
protected |
Emit an unconditional branch to FalseMBB
, obtains the branch weight and adds TrueMBB and FalseMBB to the successor list.
Definition at line 1690 of file FastISel.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::addSuccessorWithoutProb(), llvm::FunctionLoweringInfo::BPI, fastEmitBranch(), FuncInfo, llvm::MachineBasicBlock::getBasicBlock(), llvm::MIMetadata::getDL(), llvm::BranchProbabilityInfo::getEdgeProbability(), llvm::FunctionLoweringInfo::MBB, and MIMD.
|
inline |
Return current debug location information.
Definition at line 250 of file FastISel.h.
References llvm::MIMetadata::getDL(), and MIMD.
|
inline |
Return the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 233 of file FastISel.h.
References LastLocalValue.
Referenced by recomputeInsertPt(), and selectInstruction().
This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value.
Definition at line 384 of file FastISel.cpp.
References llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), DL, fastEmit_r(), llvm::EVT::getEVT(), llvm::TargetLoweringBase::getPointerTy(), getRegForValue(), llvm::EVT::getSimpleVT(), Idx, llvm::ISD::SIGN_EXTEND, TLI, and llvm::ISD::TRUNCATE.
Referenced by selectGetElementPtr().
Create a virtual register and arrange for it to be assigned the value for the given LLVM value.
Definition at line 239 of file FastISel.cpp.
References DL, enterLocalValueArea(), FuncInfo, llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getTypeToTransformTo(), llvm::TargetLoweringBase::getValueType(), llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::isTypeLegal(), leaveLocalValueArea(), lookUpRegForValue(), llvm::FunctionLoweringInfo::StaticAllocaMap, and TLI.
Referenced by fastEmit_ri_(), getRegForGEPIndex(), lowerDbgValue(), selectBinaryOp(), selectBitCast(), selectCast(), selectFNeg(), selectFreeze(), selectGetElementPtr(), selectIntrinsicCall(), selectOperator(), selectPatchpoint(), selectXRayCustomEvent(), selectXRayTypedEvent(), and tryToFoldLoad().
void FastISel::handleDbgInfo | ( | const Instruction * | II | ) |
Target-independent lowering of non-instruction debug info associated with this instruction.
Definition at line 1193 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addMetadata(), assert(), llvm::DbgVariableRecord::Assign, llvm::BuildMI(), llvm::dbgs(), llvm::DbgVariableRecord::Declare, FuncInfo, llvm::MCInstrInfo::get(), llvm::DbgRecord::getDebugLoc(), llvm::DbgVariableRecord::getExpression(), llvm::DbgVariableRecord::getType(), llvm::DbgVariableRecord::getVariable(), llvm::DbgVariableRecord::getVariableLocationOp(), llvm::DbgVariableRecord::hasArgList(), II, llvm::FunctionLoweringInfo::InsertPt, LLVM_DEBUG, lowerDbgDeclare(), lowerDbgValue(), llvm::FunctionLoweringInfo::MBB, MIMD, llvm::FunctionLoweringInfo::PreprocessedDVRDeclares, recomputeInsertPt(), llvm::reverse(), TII, and llvm::DbgVariableRecord::Value.
void FastISel::leaveLocalValueArea | ( | SavePoint | Old | ) |
Reset InsertPt to the given old insert position.
Definition at line 437 of file FastISel.cpp.
References llvm::MachineBasicBlock::begin(), FuncInfo, llvm::FunctionLoweringInfo::InsertPt, LastLocalValue, and llvm::FunctionLoweringInfo::MBB.
Referenced by getRegForValue().
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.
Definition at line 352 of file FastISel.cpp.
References FuncInfo, I, LocalValueMap, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by getRegForValue(), lowerDbgDeclare(), and lowerDbgValue().
bool FastISel::lowerArguments | ( | ) |
Do "fast" instruction selection for function arguments and append the machine instructions to the current block.
Returns true when successful.
Definition at line 139 of file FastISel.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), assert(), llvm::FunctionLoweringInfo::CanLowerReturn, fastLowerArguments(), llvm::FunctionLoweringInfo::Fn, FuncInfo, I, LocalValueMap, and llvm::FunctionLoweringInfo::ValueMap.
Definition at line 1115 of file FastISel.cpp.
References llvm::CallBase::arg_begin(), llvm::CallBase::arg_end(), llvm::CallBase::arg_size(), llvm::diagnoseDontCall(), llvm::CallBase::getCalledOperand(), llvm::Function::getFnAttribute(), llvm::MachineFunction::getFunction(), llvm::CallBase::getFunctionType(), llvm::Value::getType(), llvm::Attribute::getValueAsBool(), llvm::isInTailCallPosition(), llvm::CallInst::isMustTailCall(), llvm::CallInst::isTailCall(), lowerCallTo(), MF, RetTy, llvm::FastISel::CallLoweringInfo::setCallee(), llvm::FastISel::CallLoweringInfo::setTailCall(), and TM.
Referenced by selectCall().
|
protected |
Definition at line 995 of file FastISel.cpp.
References llvm::ISD::InputArg::ArgVT, assert(), llvm::FastISel::CallLoweringInfo::Call, llvm::FastISel::CallLoweringInfo::CallConv, llvm::TargetLowering::CanLowerReturn(), llvm::FastISel::CallLoweringInfo::CB, llvm::FastISel::CallLoweringInfo::clearIns(), llvm::FastISel::CallLoweringInfo::clearOuts(), llvm::ComputeValueVTs(), DL, fastLowerCall(), llvm::ISD::InputArg::Flags, FuncInfo, llvm::TargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::DataLayout::getABITypeAlign(), llvm::FastISel::CallLoweringInfo::getArgs(), llvm::TargetLoweringBase::getByValTypeAlignment(), llvm::Type::getContext(), llvm::Instruction::getMetadata(), llvm::TargetLoweringBase::getNumRegisters(), llvm::TargetLoweringBase::getRegisterType(), getReturnAttrs(), llvm::GetReturnInfo(), llvm::DataLayout::getTypeAllocSize(), llvm::FastISel::CallLoweringInfo::InRegs, llvm::FastISel::CallLoweringInfo::Ins, llvm::FastISel::CallLoweringInfo::IsInReg, llvm::FastISel::CallLoweringInfo::IsReturnValueUsed, llvm::FastISel::CallLoweringInfo::IsVarArg, MF, llvm::FunctionLoweringInfo::MF, llvm::FastISel::CallLoweringInfo::NumResultRegs, llvm::FastISel::CallLoweringInfo::OutFlags, llvm::FastISel::CallLoweringInfo::OutVals, llvm::FastISel::CallLoweringInfo::ResultReg, llvm::FastISel::CallLoweringInfo::RetSExt, llvm::FastISel::CallLoweringInfo::RetTy, llvm::FastISel::CallLoweringInfo::RetZExt, llvm::MachineInstr::setHeapAllocMarker(), llvm::ISD::ArgFlagsTy::setInReg(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::ISD::ArgFlagsTy::setSExt(), llvm::ISD::ArgFlagsTy::setZExt(), TLI, TRI, updateValueMap(), llvm::ISD::InputArg::Used, and llvm::ISD::InputArg::VT.
|
protected |
Definition at line 957 of file FastISel.cpp.
References DL, llvm::MachineFunction::getContext(), llvm::Mangler::getNameWithPrefix(), llvm::MCContext::getOrCreateSymbol(), lowerCallTo(), MF, and Sym.
Definition at line 966 of file FastISel.cpp.
References assert(), llvm::CallBase::getCallingConv(), llvm::CallBase::getFunctionType(), llvm::User::getOperand(), llvm::Value::getType(), lowerCallTo(), llvm::TargetLoweringBase::markLibCallAttributes(), MF, RetTy, llvm::FastISel::CallLoweringInfo::setCallee(), and TLI.
Referenced by lowerCall(), and lowerCallTo().
|
protectedvirtual |
Target-independent lowering of debug information.
Returns false if the debug information couldn't be lowered and was instead discarded.
Definition at line 1323 of file FastISel.cpp.
References llvm::Address, assert(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), llvm::dbgs(), DL, llvm::dwarf::DW_OP_LLVM_arg, FuncInfo, llvm::MCInstrInfo::get(), llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::FunctionLoweringInfo::InsertPt, llvm::DILocalVariable::isValidLocationForIntrinsic(), LLVM_DEBUG, lookUpRegForValue(), llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, llvm::DIExpression::prependOpcodes(), llvm::FunctionLoweringInfo::StaticAllocaMap, TII, and llvm::MachineFunction::useDebugInstrRef().
Referenced by handleDbgInfo(), and selectIntrinsicCall().
|
protectedvirtual |
Target-independent lowering of debug information.
Returns false if the debug information couldn't be lowered and was instead discarded.
Definition at line 1237 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addCImm(), llvm::MachineInstrBuilder::addFPImm(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMetadata(), assert(), llvm::BuildMI(), llvm::DIExpression::constantFold(), llvm::MachineOperand::CreateFI(), llvm::MachineOperand::CreateReg(), llvm::dbgs(), DL, llvm::dwarf::DW_OP_LLVM_arg, FuncInfo, llvm::MCInstrInfo::get(), getRegForValue(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::DIExpression::isEntryValue(), llvm::MachineRegisterInfo::liveins(), LLVM_DEBUG, lookUpRegForValue(), llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, llvm::DIExpression::prependOpcodes(), llvm::FunctionLoweringInfo::RegInfo, llvm::FunctionLoweringInfo::StaticAllocaMap, TII, and llvm::MachineFunction::useDebugInstrRef().
Referenced by handleDbgInfo(), and selectIntrinsicCall().
|
protected |
Definition at line 2429 of file FastISel.cpp.
References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, and llvm_unreachable.
void FastISel::recomputeInsertPt | ( | ) |
Reset InsertPt to prepare for inserting instructions into the current block.
Definition at line 402 of file FastISel.cpp.
References FuncInfo, llvm::MachineBasicBlock::getFirstNonPHI(), getLastLocalValue(), llvm::FunctionLoweringInfo::InsertPt, and llvm::FunctionLoweringInfo::MBB.
Referenced by enterLocalValueArea(), handleDbgInfo(), removeDeadCode(), and selectInstruction().
void FastISel::removeDeadCode | ( | MachineBasicBlock::iterator | I, |
MachineBasicBlock::iterator | E | ||
) |
Remove all dead instructions between the I and E.
Definition at line 411 of file FastISel.cpp.
References assert(), EmitStartPt, I, llvm::MachineInstrBundleIterator< Ty, IsReverse >::isValid(), LastLocalValue, and recomputeInsertPt().
Referenced by selectInstruction().
Select and emit code for a binary operator instruction, which has an opcode which directly corresponds to the given ISD opcode.
Definition at line 445 of file FastISel.cpp.
References llvm::ISD::AND, fastEmit_ri_(), fastEmit_rr(), llvm::EVT::getEVT(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getTypeToTransformTo(), I, llvm::ISD::isBitwiseLogicOp(), isCommutative(), llvm::isPowerOf2_64(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::isTypeLegal(), llvm::Log2_64(), llvm::ISD::SDIV, llvm::ISD::SRA, TLI, updateValueMap(), and llvm::ISD::UREM.
Referenced by selectOperator().
Definition at line 1513 of file FastISel.cpp.
References llvm::ISD::BITCAST, DL, fastEmit_r(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getValueType(), I, llvm::TargetLoweringBase::isTypeLegal(), TLI, and updateValueMap().
Referenced by selectOperator().
Definition at line 1156 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addExternalSymbol(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMetadata(), llvm::BuildMI(), llvm::InlineAsm::Extra_AsmDialect, llvm::InlineAsm::Extra_HasSideEffects, llvm::InlineAsm::Extra_IsAlignStack, llvm::InlineAsm::Extra_IsConvergent, FuncInfo, llvm::MCInstrInfo::get(), I, II, llvm::FunctionLoweringInfo::InsertPt, lowerCall(), llvm::FunctionLoweringInfo::MBB, MIMD, selectIntrinsicCall(), and TII.
Referenced by selectOperator().
Definition at line 1482 of file FastISel.cpp.
References DL, fastEmit_r(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getValueType(), I, llvm::EVT::isSimple(), llvm::TargetLoweringBase::isTypeLegal(), TLI, and updateValueMap().
Referenced by selectOperator().
Definition at line 1751 of file FastISel.cpp.
References llvm::ComputeLinearIndex(), llvm::ComputeValueVTs(), DL, llvm::FunctionLoweringInfo::Fn, FuncInfo, llvm::Function::getContext(), llvm::ExtractValueInst::getIndices(), llvm::TargetLoweringBase::getNumRegisters(), llvm::User::getOperand(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::TargetLoweringBase::getValueType(), I, llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::isTypeLegal(), TLI, updateValueMap(), and llvm::FunctionLoweringInfo::ValueMap.
Referenced by selectOperator().
Emit an FNeg operation.
Definition at line 1709 of file FastISel.cpp.
References llvm::ISD::BITCAST, DL, fastEmit_r(), fastEmit_ri_(), llvm::ISD::FNEG, llvm::EVT::getIntegerVT(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::TargetLoweringBase::getValueType(), I, llvm::TargetLoweringBase::isTypeLegal(), TLI, updateValueMap(), and llvm::ISD::XOR.
Referenced by selectOperator().
Definition at line 1542 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::TargetLoweringBase::getRegClassFor(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getValueType(), I, llvm::FunctionLoweringInfo::InsertPt, llvm::TargetLoweringBase::isTypeLegal(), llvm::FunctionLoweringInfo::MBB, MIMD, TII, TLI, and updateValueMap().
Referenced by selectOperator().
Definition at line 532 of file FastISel.cpp.
References llvm::ISD::ADD, DL, fastEmit_ri_(), fastEmit_rr(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::StructLayout::getElementOffset(), llvm::TargetLoweringBase::getPointerTy(), getRegForGEPIndex(), getRegForValue(), llvm::DataLayout::getStructLayout(), I, Idx, llvm::ISD::MUL, N, TLI, and updateValueMap().
Referenced by selectOperator().
bool FastISel::selectInstruction | ( | const Instruction * | I | ) |
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.
Definition at line 1582 of file FastISel.cpp.
References F, fastSelectInstruction(), FuncInfo, getLastLocalValue(), llvm::TargetLibraryInfo::getLibFunc(), llvm::TargetLibraryInfo::hasOptimizedCodeGen(), I, llvm::FunctionLoweringInfo::InsertPt, LibInfo, MIMD, llvm::LLVMContext::OB_funclet, llvm::FunctionLoweringInfo::OrigNumPHINodesToUpdate, llvm::FunctionLoweringInfo::PHINodesToUpdate, recomputeInsertPt(), removeDeadCode(), selectOperator(), and SkipTargetIndependentISel.
|
protected |
Definition at line 1382 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addMetadata(), llvm::Address, assert(), llvm::BuildMI(), llvm::dbgs(), fastLowerIntrinsicCall(), FuncInfo, llvm::MCInstrInfo::get(), llvm::DbgDeclareInst::getAddress(), llvm::MIMetadata::getDL(), llvm::DbgVariableIntrinsic::getExpression(), llvm::DbgLabelInst::getLabel(), getRegForValue(), llvm::ConstantInt::getTrue(), llvm::DbgValueInst::getValue(), llvm::DbgVariableIntrinsic::getVariable(), llvm::DbgVariableIntrinsic::hasArgList(), II, llvm::FunctionLoweringInfo::InsertPt, llvm::DILocalVariable::isValidLocationForIntrinsic(), LLVM_DEBUG, llvm_unreachable, lowerDbgDeclare(), lowerDbgValue(), llvm::FunctionLoweringInfo::MBB, MIMD, llvm::FunctionLoweringInfo::PreprocessedDbgDeclares, selectPatchpoint(), selectStackmap(), selectXRayCustomEvent(), selectXRayTypedEvent(), TII, and updateValueMap().
Referenced by selectCall().
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.
Definition at line 1791 of file FastISel.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), DL, llvm::ISD::FADD, fastEmit_(), fastEmitBranch(), llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FP_TO_SINT, llvm::ISD::FREM, llvm::ISD::FSUB, FuncInfo, llvm::Instruction::getDebugLoc(), llvm::FunctionLoweringInfo::getMBB(), getRegForValue(), llvm::BranchInst::getSuccessor(), llvm::TargetMachine::getTargetTriple(), llvm::TargetLoweringBase::getValueType(), I, llvm::Triple::isOSAIX(), llvm::BranchInst::isUnconditional(), llvm_unreachable, llvm::ISD::MUL, llvm::TargetMachine::Options, llvm::ISD::OR, llvm::ISD::SDIV, selectBinaryOp(), selectBitCast(), selectCall(), selectCast(), selectExtractValue(), selectFNeg(), selectFreeze(), selectGetElementPtr(), llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::FunctionLoweringInfo::StaticAllocaMap, llvm::ISD::SUB, TLI, TM, llvm::ISD::TRAP, llvm::TargetOptions::TrapUnreachable, llvm::ISD::TRUNCATE, llvm::ISD::UDIV, updateValueMap(), llvm::ISD::UREM, llvm::ISD::XOR, and llvm::ISD::ZERO_EXTEND.
Referenced by selectInstruction().
Definition at line 755 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::CallingConv::AnyReg, assert(), llvm::BuildMI(), llvm::CallingConv::C, llvm::FastISel::CallLoweringInfo::Call, CC, llvm::PatchPointOpers::CCPos, llvm::MachineOperand::CreateGA(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::MachineOperand::CreateRegMask(), createResultReg(), DL, llvm::MachineInstr::eraseFromParent(), FuncInfo, llvm::MCInstrInfo::get(), llvm::TargetRegisterInfo::getCallPreservedMask(), llvm::MachineFunction::getFrameInfo(), llvm::TargetLoweringBase::getRegClassFor(), getRegForValue(), llvm::TargetLowering::getScratchRegisters(), llvm::TargetLoweringBase::getSimpleValueType(), I, llvm::PatchPointOpers::IDPos, llvm::FastISel::CallLoweringInfo::InRegs, llvm_unreachable, llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, MIMD, llvm::PatchPointOpers::NArgPos, llvm::PatchPointOpers::NBytesPos, llvm::FastISel::CallLoweringInfo::NumResultRegs, llvm::FastISel::CallLoweringInfo::OutRegs, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::FastISel::CallLoweringInfo::ResultReg, llvm::MachineFrameInfo::setHasPatchPoint(), llvm::FastISel::CallLoweringInfo::setIsPatchPoint(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::PatchPointOpers::TargetPos, TII, TLI, TRI, and updateValueMap().
Referenced by selectIntrinsicCall().
Definition at line 643 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), CC, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), FuncInfo, llvm::MCInstrInfo::get(), llvm::TargetInstrInfo::getCallFrameDestroyOpcode(), llvm::TargetInstrInfo::getCallFrameSetupOpcode(), llvm::MachineFunction::getFrameInfo(), llvm::MCInstrDesc::getNumOperands(), llvm::TargetLowering::getScratchRegisters(), I, llvm::PatchPointOpers::IDPos, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, MIMD, llvm::PatchPointOpers::NBytesPos, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineFrameInfo::setHasStackMap(), TII, and TLI.
Referenced by selectIntrinsicCall().
Definition at line 902 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), FuncInfo, llvm::MCInstrInfo::get(), llvm::Triple::getArch(), getRegForValue(), llvm::TargetMachine::getTargetTriple(), I, llvm::FunctionLoweringInfo::InsertPt, llvm::Triple::isAArch64(), llvm::FunctionLoweringInfo::MBB, MIMD, llvm::SmallVectorTemplateBase< T, bool >::push_back(), TII, TM, and llvm::Triple::x86_64.
Referenced by selectIntrinsicCall().
Definition at line 921 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), FuncInfo, llvm::MCInstrInfo::get(), llvm::Triple::getArch(), getRegForValue(), llvm::TargetMachine::getTargetTriple(), I, llvm::FunctionLoweringInfo::InsertPt, llvm::Triple::isAArch64(), llvm::FunctionLoweringInfo::MBB, MIMD, llvm::SmallVectorTemplateBase< T, bool >::push_back(), TII, TM, and llvm::Triple::x86_64.
Referenced by selectIntrinsicCall().
|
inline |
Update the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 237 of file FastISel.h.
References EmitStartPt, I, and LastLocalValue.
|
inlineprotected |
Definition at line 520 of file FastISel.h.
References llvm::MachineFunction::getFunction(), llvm::Function::hasOptSize(), and MF.
void FastISel::startNewBlock | ( | ) |
Set the current block to which generated machine instructions will be appended.
Definition at line 124 of file FastISel.cpp.
References assert(), llvm::MachineBasicBlock::back(), EmitStartPt, llvm::MachineBasicBlock::empty(), FuncInfo, LastLocalValue, LocalValueMap, and llvm::FunctionLoweringInfo::MBB.
bool FastISel::tryToFoldLoad | ( | const LoadInst * | LI, |
const Instruction * | FoldInst | ||
) |
We're checking to see if we can fold LI
into 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, LI
is "A", and 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.
Definition at line 2304 of file FastISel.cpp.
References assert(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::contains(), FuncInfo, llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs, SkipDebug, ByOperand, ByInstr, ByBundle >::getOperandNo(), llvm::MachineOperand::getParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), getRegForValue(), llvm::Value::hasOneUse(), llvm::MachineRegisterInfo::hasOneUse(), llvm::FunctionLoweringInfo::InsertPt, llvm::LoadInst::isVolatile(), llvm::FunctionLoweringInfo::MBB, MRI, llvm::MachineRegisterInfo::reg_begin(), llvm::FunctionLoweringInfo::RegsWithFixups, tryToFoldLoadIntoMI(), and llvm::Instruction::user_back().
|
inlinevirtual |
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.
Definition at line 300 of file FastISel.h.
Referenced by tryToFoldLoad().
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.
Definition at line 363 of file FastISel.cpp.
References FuncInfo, I, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), LocalValueMap, llvm::FunctionLoweringInfo::RegFixups, llvm::FunctionLoweringInfo::RegsWithFixups, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by lowerCallTo(), selectBinaryOp(), selectBitCast(), selectCast(), selectExtractValue(), selectFNeg(), selectFreeze(), selectGetElementPtr(), selectIntrinsicCall(), selectOperator(), and selectPatchpoint().
|
protected |
Definition at line 210 of file FastISel.h.
Referenced by canFoldAddIntoGEP(), createMachineMemOperandFor(), getRegForGEPIndex(), getRegForValue(), lowerCallTo(), lowerDbgDeclare(), lowerDbgValue(), selectBitCast(), selectCast(), selectExtractValue(), selectFNeg(), selectFreeze(), selectGetElementPtr(), selectOperator(), selectPatchpoint(), and llvm::FastISel::CallLoweringInfo::setCallee().
|
protected |
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)
Definition at line 226 of file FastISel.h.
Referenced by removeDeadCode(), setLastLocalValue(), and startNewBlock().
|
protected |
Definition at line 203 of file FastISel.h.
Referenced by canFoldAddIntoGEP(), constrainOperandRegClass(), createMachineMemOperandFor(), enterLocalValueArea(), fastEmit_ri_(), fastEmitBranch(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), fastEmitInst_rrr(), finishCondBranch(), getRegForValue(), handleDbgInfo(), leaveLocalValueArea(), lookUpRegForValue(), lowerArguments(), lowerCallTo(), lowerDbgDeclare(), lowerDbgValue(), recomputeInsertPt(), selectCall(), selectExtractValue(), selectFreeze(), selectInstruction(), selectIntrinsicCall(), selectOperator(), selectPatchpoint(), selectStackmap(), selectXRayCustomEvent(), selectXRayTypedEvent(), startNewBlock(), tryToFoldLoad(), and updateValueMap().
|
protected |
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)
Definition at line 221 of file FastISel.h.
Referenced by getLastLocalValue(), leaveLocalValueArea(), removeDeadCode(), setLastLocalValue(), and startNewBlock().
|
protected |
Definition at line 214 of file FastISel.h.
Referenced by selectInstruction().
Definition at line 202 of file FastISel.h.
Referenced by lookUpRegForValue(), lowerArguments(), startNewBlock(), and updateValueMap().
|
protected |
Definition at line 207 of file FastISel.h.
|
protected |
Definition at line 204 of file FastISel.h.
Referenced by lowerCall(), lowerCallTo(), and shouldOptForSize().
|
protected |
Definition at line 206 of file FastISel.h.
|
protected |
Definition at line 208 of file FastISel.h.
Referenced by constrainOperandRegClass(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), fastEmitInst_rrr(), finishCondBranch(), getCurDebugLoc(), handleDbgInfo(), selectCall(), selectFreeze(), selectInstruction(), selectIntrinsicCall(), selectPatchpoint(), selectStackmap(), selectXRayCustomEvent(), and selectXRayTypedEvent().
|
protected |
Definition at line 205 of file FastISel.h.
Referenced by constrainOperandRegClass(), createResultReg(), fastEmitInst_extractsubreg(), and tryToFoldLoad().
|
protected |
Definition at line 215 of file FastISel.h.
Referenced by selectInstruction().
|
protected |
Definition at line 211 of file FastISel.h.
Referenced by constrainOperandRegClass(), fastEmitBranch(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), fastEmitInst_rrr(), handleDbgInfo(), lowerDbgDeclare(), lowerDbgValue(), selectCall(), selectFreeze(), selectIntrinsicCall(), selectPatchpoint(), selectStackmap(), selectXRayCustomEvent(), and selectXRayTypedEvent().
|
protected |
Definition at line 212 of file FastISel.h.
Referenced by fastEmitInst_extractsubreg(), getRegForGEPIndex(), getRegForValue(), lowerCallTo(), selectBinaryOp(), selectBitCast(), selectCast(), selectExtractValue(), selectFNeg(), selectFreeze(), selectGetElementPtr(), selectOperator(), selectPatchpoint(), and selectStackmap().
|
protected |
Definition at line 209 of file FastISel.h.
Referenced by lowerCall(), selectOperator(), selectXRayCustomEvent(), and selectXRayTypedEvent().
|
protected |
Definition at line 213 of file FastISel.h.
Referenced by constrainOperandRegClass(), fastEmitInst_extractsubreg(), lowerCallTo(), and selectPatchpoint().