LLVM
8.0.1
|
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 |
struct | SavePoint |
Public Types | |
using | ArgListEntry = TargetLoweringBase::ArgListEntry |
using | ArgListTy = TargetLoweringBase::ArgListTy |
Public Member Functions | |
virtual | ~FastISel () |
MachineInstr * | getLastLocalValue () |
Return the position of the last instruction emitted for materializing constants for use in the current block. More... | |
void | setLastLocalValue (MachineInstr *I) |
Update the position of the last instruction emitted for materializing constants for use in the current block. More... | |
void | startNewBlock () |
Set the current block to which generated machine instructions will be appended. More... | |
void | finishBasicBlock () |
Flush the local value map and sink local values if possible. More... | |
DebugLoc | getCurDebugLoc () const |
Return current debug location information. More... | |
bool | lowerArguments () |
Do "fast" instruction selection for function arguments and append the machine instructions to the current block. More... | |
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. More... | |
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. More... | |
unsigned | getRegForValue (const Value *V) |
Create a virtual register and arrange for it to be assigned the value for the given LLVM value. More... | |
unsigned | lookUpRegForValue (const Value *V) |
Look up the value to see if its value is already cached in a register. More... | |
std::pair< unsigned, bool > | getRegForGEPIndex (const Value *Idx) |
This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value. More... | |
bool | tryToFoldLoad (const LoadInst *LI, const Instruction *FoldInst) |
We're checking to see if we can fold LI into FoldInst . More... | |
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. More... | |
void | recomputeInsertPt () |
Reset InsertPt to prepare for inserting instructions into the current block. More... | |
void | removeDeadCode (MachineBasicBlock::iterator I, MachineBasicBlock::iterator E) |
Remove all dead instructions between the I and E. More... | |
SavePoint | enterLocalValueArea () |
Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position. More... | |
void | leaveLocalValueArea (SavePoint Old) |
Reset InsertPt to the given old insert position. More... | |
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. More... | |
virtual bool | fastLowerArguments () |
This method is called by target-independent code to do target- specific argument lowering. More... | |
virtual bool | fastLowerCall (CallLoweringInfo &CLI) |
This method is called by target-independent code to do target- specific call lowering. More... | |
virtual bool | fastLowerIntrinsicCall (const IntrinsicInst *II) |
This method is called by target-independent code to do target- specific intrinsic lowering. More... | |
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. More... | |
virtual unsigned | fastEmit_r (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill) |
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operand be emitted. More... | |
virtual unsigned | fastEmit_rr (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill) |
This method is called by target-independent code to request that an instruction with the given type, opcode, and register operands be emitted. More... | |
virtual unsigned | fastEmit_ri (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, 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. More... | |
unsigned | fastEmit_ri_ (MVT VT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm, MVT ImmType) |
This method is a wrapper of fastEmit_ri. More... | |
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. More... | |
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. More... | |
unsigned | fastEmitInst_ (unsigned MachineInstOpcode, const TargetRegisterClass *RC) |
Emit a MachineInstr with no operands and a result register in the given register class. More... | |
unsigned | fastEmitInst_r (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill) |
Emit a MachineInstr with one register operand and a result register in the given register class. More... | |
unsigned | fastEmitInst_rr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill) |
Emit a MachineInstr with two register operands and a result register in the given register class. More... | |
unsigned | fastEmitInst_rrr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, unsigned Op2, bool Op2IsKill) |
Emit a MachineInstr with three register operands and a result register in the given register class. More... | |
unsigned | fastEmitInst_ri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, uint64_t Imm) |
Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class. More... | |
unsigned | fastEmitInst_rii (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, uint64_t Imm1, uint64_t Imm2) |
Emit a MachineInstr with one register operand and two immediate operands. More... | |
unsigned | 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. More... | |
unsigned | fastEmitInst_rri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm) |
Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class. More... | |
unsigned | 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. More... | |
unsigned | fastEmitInst_extractsubreg (MVT RetVT, unsigned Op0, bool Op0IsKill, uint32_t Idx) |
Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type. More... | |
unsigned | fastEmitZExtFromI1 (MVT VT, unsigned Op0, bool Op0IsKill) |
Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero. More... | |
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. More... | |
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. More... | |
void | updateValueMap (const Value *I, unsigned 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. More... | |
unsigned | createResultReg (const TargetRegisterClass *RC) |
unsigned | constrainOperandRegClass (const MCInstrDesc &II, unsigned Op, unsigned OpNum) |
Try to constrain Op so that it is usable by argument OpNum of the provided MCInstrDesc. More... | |
virtual unsigned | fastMaterializeConstant (const Constant *C) |
Emit a constant in a register using target-specific logic, such as constant pool loads. More... | |
virtual unsigned | fastMaterializeAlloca (const AllocaInst *C) |
Emit an alloca address in a register using target-specific logic. More... | |
virtual unsigned | fastMaterializeFloatZero (const ConstantFP *CF) |
Emit the floating-point constant +0.0 in a register using target- specific logic. More... | |
bool | canFoldAddIntoGEP (const User *GEP, const Value *Add) |
Check if Add is an add that can be safely folded into GEP . More... | |
bool | hasTrivialKill (const Value *V) |
Test whether the given value has exactly one use. More... | |
MachineMemOperand * | createMachineMemOperandFor (const Instruction *I) const |
Create a machine mem operand from the given instruction. More... | |
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 | isCommutativeIntrinsic (IntrinsicInst const *II) |
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. More... | |
bool | selectFNeg (const User *I) |
Emit an FNeg operation. More... | |
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 | selectCast (const User *I, unsigned Opcode) |
bool | selectExtractValue (const User *U) |
bool | selectInsertValue (const User *I) |
bool | selectXRayCustomEvent (const CallInst *II) |
bool | selectXRayTypedEvent (const CallInst *II) |
Protected Attributes | |
DenseMap< const Value *, unsigned > | LocalValueMap |
FunctionLoweringInfo & | FuncInfo |
MachineFunction * | MF |
MachineRegisterInfo & | MRI |
MachineFrameInfo & | MFI |
MachineConstantPool & | MCP |
DebugLoc | DbgLoc |
const TargetMachine & | TM |
const DataLayout & | DL |
const TargetInstrInfo & | TII |
const TargetLowering & | TLI |
const TargetRegisterInfo & | TRI |
const TargetLibraryInfo * | LibInfo |
bool | SkipTargetIndependentISel |
MachineInstr * | LastLocalValue |
The position of the last instruction for materializing constants for use in the current block. More... | |
MachineInstr * | EmitStartPt |
The top most instruction in the current block that is allowed for emitting local variables. More... | |
MachineBasicBlock::iterator | LastFlushPoint |
Last local value flush point. More... | |
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 67 of file FastISel.h.
Definition at line 69 of file FastISel.h.
Definition at line 70 of file FastISel.h.
|
virtualdefault |
Referenced by FastISel().
|
explicitprotected |
Definition at line 1915 of file FastISel.cpp.
References ~FastISel().
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 2366 of file FastISel.cpp.
References llvm::MCID::Add, DL, FuncInfo, getParent(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::FunctionLoweringInfo::MBB, and llvm::FunctionLoweringInfo::MBBMap.
Referenced by fastMaterializeFloatZero().
|
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 2014 of file FastISel.cpp.
References llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::TargetInstrInfo::getRegClass(), llvm::FunctionLoweringInfo::InsertPt, llvm::TargetRegisterInfo::isVirtualRegister(), llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, 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 2383 of file FastISel.cpp.
References DL, FuncInfo, llvm::Instruction::getAAMetadata(), llvm::DataLayout::getABITypeAlignment(), llvm::MachineFunction::getMachineMemOperand(), llvm::Instruction::getMetadata(), llvm::DataLayout::getTypeStoreSize(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile, llvm::LLVMContext::MD_dereferenceable, llvm::LLVMContext::MD_invariant_load, llvm::LLVMContext::MD_nontemporal, llvm::LLVMContext::MD_range, llvm::FunctionLoweringInfo::MF, llvm::MachineMemOperand::MODereferenceable, llvm::MachineMemOperand::MOInvariant, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MONonTemporal, llvm::MachineMemOperand::MOStore, llvm::MachineMemOperand::MOVolatile, SI, and Size.
Referenced by fastMaterializeFloatZero().
|
protected |
Definition at line 2010 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(), and fastEmitInst_rrr().
FastISel::SavePoint FastISel::enterLocalValueArea | ( | ) |
Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position.
Definition at line 567 of file FastISel.cpp.
This method is called by target-independent code to request that an instruction with the given type and opcode be emitted.
Definition at line 1936 of file FastISel.cpp.
|
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 1953 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 1949 of file FastISel.cpp.
Referenced by fastEmit_ri_().
|
protectedvirtual |
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 1938 of file FastISel.cpp.
|
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 1958 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 1967 of file FastISel.cpp.
References llvm::ISD::Constant, fastEmit_i(), fastEmit_ri(), fastEmit_rr(), llvm::FunctionLoweringInfo::Fn, FuncInfo, llvm::IntegerType::get(), llvm::ConstantInt::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.
|
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 1943 of file FastISel.cpp.
Referenced by fastEmit_ri_().
|
protected |
Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.
Definition at line 1674 of file FastISel.cpp.
References llvm::MachineBasicBlock::getBasicBlock(), llvm::HexagonInstrInfo::insertBranch(), and TII.
|
protected |
Emit a MachineInstr with no operands and a result register in the given register class.
Definition at line 2031 of file FastISel.cpp.
References llvm::BuildMI(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
|
protected |
Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type.
Definition at line 2221 of file FastISel.cpp.
References assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetLoweringBase::getRegClassFor(), llvm::TargetRegisterInfo::getSubClassWithSubReg(), llvm::FunctionLoweringInfo::InsertPt, llvm::TargetRegisterInfo::isVirtualRegister(), llvm::FunctionLoweringInfo::MBB, 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 2160 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addFPImm(), llvm::BuildMI(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
|
protected |
Emit a MachineInstr with a single immediate operand, and a result register in the given register class.
Definition at line 2205 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
|
protected |
Emit a MachineInstr with one register operand and a result register in the given register class.
Definition at line 2040 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
Referenced by getComparePred().
|
protected |
Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class.
Definition at line 2113 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
Referenced by getComparePred().
|
protected |
Emit a MachineInstr with one register operand and two immediate operands.
Definition at line 2135 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
|
protected |
Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 2061 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
Referenced by CC_MipsO32_FP64(), and getComparePred().
|
protected |
Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class.
Definition at line 2179 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
|
protected |
Emit a MachineInstr with three register operands and a result register in the given register class.
Definition at line 2085 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), constrainOperandRegClass(), createResultReg(), DbgLoc, FuncInfo, llvm::MCInstrInfo::get(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.
Definition at line 2235 of file FastISel.cpp.
References llvm::ISD::AND, llvm::MachineBasicBlock::begin(), llvm::BasicBlock::begin(), DbgLoc, DL, fastEmit_ri(), FuncInfo, llvm::Instruction::getNumSuccessors(), getRegForValue(), llvm::Instruction::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::TargetLoweringBase::getValueType(), llvm::MVT::i1, llvm::MVT::i16, llvm::MVT::i8, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::TargetLoweringBase::isTypeLegal(), llvm::FunctionLoweringInfo::MBBMap, llvm::FunctionLoweringInfo::OrigNumPHINodesToUpdate, llvm::MVT::Other, llvm::FunctionLoweringInfo::PHINodesToUpdate, llvm::BasicBlock::phis(), Reg, and TLI.
|
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 1928 of file FastISel.cpp.
|
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 1930 of file FastISel.cpp.
|
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 1932 of file FastISel.cpp.
|
inlineprotectedvirtual |
Emit an alloca address in a register using target-specific logic.
Definition at line 485 of file FastISel.h.
|
inlineprotectedvirtual |
Emit a constant in a register using target-specific logic, such as constant pool loads.
Definition at line 482 of file FastISel.h.
|
inlineprotectedvirtual |
Emit the floating-point constant +0.0 in a register using target- specific logic.
Definition at line 489 of file FastISel.h.
References llvm::MCID::Add, canFoldAddIntoGEP(), createMachineMemOperandFor(), GEP, hasTrivialKill(), lowerCallTo(), optimizeCmpPredicate(), and llvm::FastISel::CallLoweringInfo::Symbol.
|
protectedpure virtual |
void FastISel::finishBasicBlock | ( | ) |
Flush the local value map and sink local values if possible.
Flush the local CSE map and sink anything we can.
Definition at line 145 of file FastISel.cpp.
Referenced by setLastLocalValue().
|
protected |
Emit an unconditional branch to FalseMBB
, obtains the branch weight and adds TrueMBB and FalseMBB to the successor list.
Definition at line 1694 of file FastISel.cpp.
References llvm::MachineBasicBlock::getBasicBlock().
|
inline |
Return current debug location information.
Definition at line 255 of file FastISel.h.
References DbgLoc, getRegForGEPIndex(), getRegForValue(), I, lookUpRegForValue(), lowerArguments(), selectInstruction(), selectOperator(), and tryToFoldLoad().
|
inline |
Return the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 238 of file FastISel.h.
References LastLocalValue.
This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value.
Definition at line 508 of file FastISel.cpp.
References llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), llvm::EVT::getEVT(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::ISD::SIGN_EXTEND, and llvm::ISD::TRUNCATE.
Referenced by getCurDebugLoc().
Create a virtual register and arrange for it to be assigned the value for the given LLVM value.
Definition at line 363 of file FastISel.cpp.
References llvm::BuildMI(), llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::APFloat::convertToInteger(), llvm::ConstantInt::get(), llvm::Value::getContext(), llvm::Constant::getNullValue(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::Value::getType(), llvm::MVT::i1, llvm::MVT::i16, llvm::MVT::i8, llvm::EVT::isSimple(), MRI, Reg, llvm::APFloatBase::rmTowardZero, llvm::ISD::SINT_TO_FP, and TII.
Referenced by fastEmit_ri_(), fastEmitZExtFromI1(), getCurDebugLoc(), and tryToFoldLoad().
Test whether the given value has exactly one use.
Definition at line 331 of file FastISel.cpp.
References llvm::dyn_cast(), GEP, llvm::Instruction::getOpcode(), llvm::Instruction::getParent(), getParent(), llvm::Value::hasOneUse(), I, MRI, Reg, and llvm::Value::user_begin().
Referenced by fastMaterializeFloatZero().
|
inlineprotected |
Definition at line 515 of file FastISel.h.
References llvm::FastISel::CallLoweringInfo::Callee, llvm::IntrinsicInst::getIntrinsicID(), initialize(), lowerCall(), llvm::max(), llvm::Intrinsic::sadd_with_overflow, selectBinaryOp(), selectBitCast(), selectCall(), selectCast(), selectExtractValue(), selectFNeg(), selectGetElementPtr(), selectInsertValue(), selectIntrinsicCall(), selectPatchpoint(), selectStackmap(), selectXRayCustomEvent(), selectXRayTypedEvent(), llvm::Intrinsic::smul_with_overflow, llvm::Intrinsic::uadd_with_overflow, and llvm::Intrinsic::umul_with_overflow.
void FastISel::leaveLocalValueArea | ( | SavePoint | Old | ) |
Reset InsertPt to the given old insert position.
Definition at line 576 of file FastISel.cpp.
References llvm::FastISel::SavePoint::DL, and llvm::FastISel::SavePoint::InsertPt.
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 476 of file FastISel.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), and I.
Referenced by getCurDebugLoc().
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 147 of file FastISel.cpp.
References assert(), E, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), I, and VI.
Referenced by getCurDebugLoc().
Definition at line 1241 of file FastISel.cpp.
References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::CallBase::getCalledValue(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getFunctionType(), llvm::Value::getType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::Type::isEmptyTy(), llvm::isInTailCallPosition(), llvm::CallInst::isTailCall(), llvm::TargetLoweringBase::ArgListEntry::setAttributes(), llvm::FastISel::CallLoweringInfo::setCallee(), llvm::SystemZISD::TM, llvm::TargetLoweringBase::ArgListEntry::Ty, and llvm::TargetLoweringBase::ArgListEntry::Val.
Referenced by isCommutativeIntrinsic().
Definition at line 1106 of file FastISel.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCallingConv(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getFunctionType(), llvm::User::getOperand(), llvm::Value::getType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::Type::isEmptyTy(), llvm::FastISel::CallLoweringInfo::setCallee(), and llvm::TargetLoweringBase::ArgListEntry::Val.
Referenced by fastMaterializeFloatZero().
|
protected |
Definition at line 1097 of file FastISel.cpp.
References llvm::Mangler::getNameWithPrefix(), and llvm::MCContext::getOrCreateSymbol().
|
protected |
Definition at line 1137 of file FastISel.cpp.
References Arg, llvm::ISD::InputArg::ArgVT, assert(), llvm::FastISel::CallLoweringInfo::Call, llvm::FastISel::CallLoweringInfo::CallConv, llvm::FastISel::CallLoweringInfo::clearIns(), llvm::FastISel::CallLoweringInfo::clearOuts(), llvm::ComputeValueVTs(), llvm::FastISel::CallLoweringInfo::CS, E, llvm::ISD::InputArg::Flags, llvm::FastISel::CallLoweringInfo::getArgs(), llvm::Type::getContext(), llvm::PointerType::getElementType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), getReturnAttrs(), llvm::GetReturnInfo(), I, llvm::FastISel::CallLoweringInfo::InRegs, llvm::FastISel::CallLoweringInfo::Ins, llvm::FastISel::CallLoweringInfo::IsInReg, llvm::FastISel::CallLoweringInfo::IsReturnValueUsed, llvm::FastISel::CallLoweringInfo::IsVarArg, 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::ISD::ArgFlagsTy::setByVal(), llvm::ISD::ArgFlagsTy::setByValAlign(), llvm::ISD::ArgFlagsTy::setByValSize(), llvm::ISD::ArgFlagsTy::setInAlloca(), llvm::ISD::ArgFlagsTy::setInConsecutiveRegs(), llvm::ISD::ArgFlagsTy::setInReg(), llvm::ISD::ArgFlagsTy::setNest(), llvm::ISD::ArgFlagsTy::setOrigAlign(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::ISD::ArgFlagsTy::setSExt(), llvm::ISD::ArgFlagsTy::setSRet(), llvm::ISD::ArgFlagsTy::setSwiftError(), llvm::ISD::ArgFlagsTy::setSwiftSelf(), llvm::ISD::ArgFlagsTy::setZExt(), llvm::SmallVectorBase::size(), TRI, llvm::ISD::InputArg::Used, and llvm::ISD::InputArg::VT.
|
protected |
Definition at line 2432 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.
Referenced by fastMaterializeFloatZero().
void FastISel::recomputeInsertPt | ( | ) |
Reset InsertPt to prepare for inserting instructions into the current block.
Definition at line 531 of file FastISel.cpp.
References llvm::ISD::EH_LABEL.
Referenced by tryToFoldLoadIntoMI().
void FastISel::removeDeadCode | ( | MachineBasicBlock::iterator | I, |
MachineBasicBlock::iterator | E | ||
) |
Remove all dead instructions between the I and E.
Definition at line 545 of file FastISel.cpp.
References assert(), llvm::RegState::Dead, E, llvm::MachineInstr::eraseFromParent(), I, and llvm::MachineInstrBundleIterator< Ty, IsReverse >::isValid().
Referenced by tryToFoldLoadIntoMI().
Select and emit code for a binary operator instruction, which has an opcode which directly corresponds to the given ISD opcode.
Definition at line 585 of file FastISel.cpp.
References llvm::ISD::AND, llvm::Value::getContext(), llvm::EVT::getEVT(), llvm::User::getOperand(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), I, llvm::MVT::i1, llvm::isPowerOf2_64(), llvm::EVT::isSimple(), llvm::Log2_64(), llvm::ISD::OR, llvm::MVT::Other, llvm::ISD::SDIV, llvm::ISD::SRA, llvm::ISD::UREM, and llvm::ISD::XOR.
Referenced by isCommutativeIntrinsic().
Definition at line 1527 of file FastISel.cpp.
References llvm::ISD::BITCAST, llvm::BuildMI(), llvm::User::getOperand(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::MVT::Other, Reg, and TII.
Referenced by isCommutativeIntrinsic(), and isSExtLoad().
Definition at line 1280 of file FastISel.cpp.
References llvm::BuildMI(), llvm::computeUsesVAFloatArgument(), llvm::InlineAsm::Extra_HasSideEffects, llvm::InlineAsm::Extra_IsAlignStack, llvm::CallBase::getCalledValue(), I, llvm::ISD::INLINEASM, and TII.
Referenced by isCommutativeIntrinsic().
Definition at line 1494 of file FastISel.cpp.
References llvm::User::getOperand(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::EVT::isSimple(), and llvm::MVT::Other.
Referenced by isCommutativeIntrinsic().
Definition at line 1759 of file FastISel.cpp.
References llvm::ComputeLinearIndex(), llvm::ComputeValueVTs(), llvm::dyn_cast(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::ExtractValueInst::getIndices(), llvm::User::getOperand(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), I, llvm::MVT::i1, if(), and llvm::EVT::isSimple().
Referenced by isCommutativeIntrinsic().
Emit an FNeg operation.
Definition at line 1713 of file FastISel.cpp.
References llvm::ISD::BITCAST, llvm::ISD::FNEG, llvm::Value::getContext(), llvm::EVT::getIntegerVT(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::Value::getType(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), X, and llvm::ISD::XOR.
Referenced by isCommutativeIntrinsic().
Definition at line 676 of file FastISel.cpp.
References llvm::ISD::ADD, C, llvm::MachineOperand::CreateFI(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), E, llvm::tgtok::Field, llvm::gep_type_begin(), llvm::gep_type_end(), llvm::CallBase::getArgOperand(), llvm::CallBase::getNumArgOperands(), llvm::User::getOperand(), llvm::ISD::MUL, N, llvm::SmallVectorTemplateBase< T >::push_back(), Reg, and SI.
Referenced by isCommutativeIntrinsic().
Referenced by isCommutativeIntrinsic().
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 1595 of file FastISel.cpp.
References F(), llvm::Instruction::getDebugLoc(), llvm::Function::getIntrinsicID(), llvm::Value::getName(), llvm::Instruction::getOpcode(), llvm::Instruction::getParent(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), llvm::Instruction::isTerminator(), llvm::LLVMContext::OB_funclet, and llvm::Intrinsic::trap.
Referenced by getCurDebugLoc().
|
protected |
Definition at line 1326 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addCImm(), llvm::MachineInstrBuilder::addFPImm(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMetadata(), llvm::Address, Arg, assert(), llvm::Intrinsic::assume, llvm::BuildMI(), llvm::MachineOperand::CreateReg(), llvm::Intrinsic::dbg_declare, llvm::Intrinsic::dbg_label, llvm::Intrinsic::dbg_value, llvm::dbgs(), llvm::Intrinsic::donothing, llvm::dyn_cast(), llvm::Intrinsic::expect, llvm::Intrinsic::experimental_patchpoint_i64, llvm::Intrinsic::experimental_patchpoint_void, llvm::Intrinsic::experimental_stackmap, llvm::ConstantInt::get(), llvm::DbgDeclareInst::getAddress(), llvm::CallBase::getArgOperand(), llvm::DbgVariableIntrinsic::getExpression(), llvm::IntrinsicInst::getIntrinsicID(), llvm::DbgLabelInst::getLabel(), llvm::Value::getType(), llvm::DbgValueInst::getValue(), llvm::DbgVariableIntrinsic::getVariable(), llvm::Intrinsic::is_constant, llvm::DILocalVariable::isValidLocationForIntrinsic(), llvm::ConstantInt::isZero(), llvm::Intrinsic::launder_invariant_group, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, LLVM_DEBUG, llvm::Intrinsic::objectsize, Reg, llvm::Intrinsic::sideeffect, llvm::Intrinsic::strip_invariant_group, llvm::Value::stripInBoundsConstantOffsets(), TII, llvm::Value::use_empty(), llvm::Intrinsic::xray_customevent, and llvm::Intrinsic::xray_typedevent.
Referenced by isCommutativeIntrinsic().
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 1799 of file FastISel.cpp.
References llvm::MCID::Add, llvm::ISD::ADD, llvm::ISD::AND, llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), llvm::MCID::Call, llvm::ISD::FADD, llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FP_TO_SINT, llvm::ISD::FREM, llvm::ISD::FSUB, llvm::Instruction::getDebugLoc(), llvm::User::getOperand(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), I, llvm::BranchInst::isUnconditional(), llvm_unreachable, llvm::ISD::MUL, llvm::ISD::OR, llvm::MVT::Other, Reg, llvm::ISD::SDIV, selectBinaryOp(), llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::ISD::SUB, llvm::SystemZISD::TM, llvm::ISD::TRAP, llvm::ISD::TRUNCATE, llvm::ISD::UDIV, llvm::ISD::UREM, llvm::ISD::XOR, and llvm::ISD::ZERO_EXTEND.
Referenced by getCurDebugLoc().
Definition at line 904 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), addStackMapLiveVars(), llvm::CallingConv::AnyReg, assert(), llvm::BuildMI(), C, llvm::FastISel::CallLoweringInfo::Call, llvm::PatchPointOpers::CCPos, llvm::MachineOperand::CreateGA(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::MachineOperand::CreateRegMask(), llvm::MachineInstr::eraseFromParent(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCallingConv(), llvm::CallBase::getNumArgOperands(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::MVT::i64, llvm::PatchPointOpers::IDPos, llvm::FastISel::CallLoweringInfo::InRegs, llvm::Type::isVoidTy(), llvm_unreachable, llvm::PatchPointOpers::NArgPos, llvm::PatchPointOpers::NBytesPos, llvm::FastISel::CallLoweringInfo::NumResultRegs, llvm::FastISel::CallLoweringInfo::OutRegs, llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::FastISel::CallLoweringInfo::ResultReg, llvm::FastISel::CallLoweringInfo::setIsPatchPoint(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::SmallVectorBase::size(), llvm::Value::stripPointerCasts(), llvm::PatchPointOpers::TargetPos, TII, and TRI.
Referenced by isCommutativeIntrinsic().
Definition at line 791 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), addStackMapLiveVars(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::BuildMI(), Callee, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), E, llvm::CallBase::getCalledFunction(), llvm::CallBase::getCallingConv(), llvm::Type::getContext(), llvm::MachineFunction::getFrameInfo(), llvm::User::getOperand(), llvm::Function::getReturnType(), llvm::Value::getType(), llvm::Type::getVoidTy(), I, llvm::PatchPointOpers::IDPos, llvm::Type::isEmptyTy(), llvm::Type::isVoidTy(), llvm::PatchPointOpers::NBytesPos, llvm::FastISel::CallLoweringInfo::setCallee(), llvm::MachineFrameInfo::setHasStackMap(), TII, and llvm::TargetLoweringBase::ArgListEntry::Val.
Referenced by isCommutativeIntrinsic().
Definition at line 1042 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), llvm::Triple::getArch(), llvm::CallBase::getArgOperand(), llvm::Triple::isOSLinux(), llvm::SmallVectorTemplateBase< T >::push_back(), TII, llvm::SystemZISD::TM, and llvm::Triple::x86_64.
Referenced by isCommutativeIntrinsic().
Definition at line 1061 of file FastISel.cpp.
References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), llvm::Triple::getArch(), llvm::CallBase::getArgOperand(), llvm::Triple::isOSLinux(), llvm::SmallVectorTemplateBase< T >::push_back(), TII, llvm::SystemZISD::TM, and llvm::Triple::x86_64.
Referenced by isCommutativeIntrinsic().
|
inline |
Update the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 242 of file FastISel.h.
References finishBasicBlock(), I, and startNewBlock().
Referenced by createSwiftErrorEntriesInEntryBlock().
void FastISel::startNewBlock | ( | ) |
Set the current block to which generated machine instructions will be appended.
Definition at line 131 of file FastISel.cpp.
References assert().
Referenced by setLastLocalValue().
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 2310 of file FastISel.cpp.
References assert(), FuncInfo, llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs, SkipDebug, ByOperand, ByInstr, ByBundle >::getOperandNo(), llvm::Instruction::getParent(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), getRegForValue(), llvm::Value::hasOneUse(), llvm::MachineRegisterInfo::hasOneUse(), llvm::FunctionLoweringInfo::InsertPt, llvm::LoadInst::isVolatile(), llvm::FunctionLoweringInfo::MBB, MRI, llvm::MachineRegisterInfo::reg_begin(), tryToFoldLoadIntoMI(), and llvm::Instruction::user_back().
Referenced by getCurDebugLoc().
|
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 305 of file FastISel.h.
References E, recomputeInsertPt(), and removeDeadCode().
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 487 of file FastISel.cpp.
|
protected |
Definition at line 209 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(), fastEmitZExtFromI1(), and getCurDebugLoc().
|
protected |
Definition at line 211 of file FastISel.h.
Referenced by canFoldAddIntoGEP(), createMachineMemOperandFor(), fastEmitZExtFromI1(), 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 227 of file FastISel.h.
|
protected |
Definition at line 204 of file FastISel.h.
Referenced by canFoldAddIntoGEP(), constrainOperandRegClass(), createMachineMemOperandFor(), fastEmit_ri_(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), fastEmitInst_rrr(), fastEmitZExtFromI1(), and tryToFoldLoad().
|
protected |
Last local value flush point.
On a subsequent flush, no local value will sink past this point.
Definition at line 231 of file FastISel.h.
|
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 222 of file FastISel.h.
Referenced by getLastLocalValue().
|
protected |
Definition at line 215 of file FastISel.h.
Definition at line 203 of file FastISel.h.
|
protected |
Definition at line 208 of file FastISel.h.
|
protected |
Definition at line 205 of file FastISel.h.
|
protected |
Definition at line 207 of file FastISel.h.
|
protected |
Definition at line 206 of file FastISel.h.
Referenced by constrainOperandRegClass(), createResultReg(), fastEmitInst_extractsubreg(), and tryToFoldLoad().
|
protected |
Definition at line 216 of file FastISel.h.
|
protected |
Definition at line 212 of file FastISel.h.
Referenced by constrainOperandRegClass(), fastEmitInst_(), fastEmitInst_extractsubreg(), fastEmitInst_f(), fastEmitInst_i(), fastEmitInst_r(), fastEmitInst_ri(), fastEmitInst_rii(), fastEmitInst_rr(), fastEmitInst_rri(), and fastEmitInst_rrr().
|
protected |
Definition at line 213 of file FastISel.h.
Referenced by fastEmitInst_extractsubreg(), and fastEmitZExtFromI1().
|
protected |
Definition at line 210 of file FastISel.h.
|
protected |
Definition at line 214 of file FastISel.h.
Referenced by constrainOperandRegClass(), and fastEmitInst_extractsubreg().