LLVM API Documentation
#include <FastISel.h>

Classes | |
| struct | SavePoint |
Public Member Functions | |
| MachineInstr * | getLastLocalValue () |
| void | setLastLocalValue (MachineInstr *I) |
| void | startNewBlock () |
| DebugLoc | getCurDebugLoc () const |
| getCurDebugLoc() - Return current debug location information. | |
| bool | LowerArguments () |
| bool | SelectInstruction (const Instruction *I) |
| bool | SelectOperator (const User *I, unsigned Opcode) |
| unsigned | getRegForValue (const Value *V) |
| unsigned | lookUpRegForValue (const Value *V) |
| std::pair< unsigned, bool > | getRegForGEPIndex (const Value *V) |
| bool | 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, ... | |
| 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. If possible, try to fold the load as an operand to the instruction, returning true if possible. This method should be implemented by targets. | |
| void | recomputeInsertPt () |
| void | removeDeadCode (MachineBasicBlock::iterator I, MachineBasicBlock::iterator E) |
| removeDeadCode - Remove all dead instructions between the I and E. | |
| SavePoint | enterLocalValueArea () |
| void | leaveLocalValueArea (SavePoint Old) |
| leaveLocalValueArea - Reset InsertPt to the given old insert position. | |
| virtual | ~FastISel () |
Protected Member Functions | |
| FastISel (FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo) | |
| virtual bool | TargetSelectInstruction (const Instruction *I)=0 |
| virtual bool | FastLowerArguments () |
| virtual unsigned | FastEmit_ (MVT VT, MVT RetVT, unsigned Opcode) |
| virtual unsigned | FastEmit_r (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill) |
| virtual unsigned | FastEmit_rr (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill) |
| virtual unsigned | FastEmit_ri (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm) |
| virtual unsigned | FastEmit_rf (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, const ConstantFP *FPImm) |
| virtual unsigned | FastEmit_rri (MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm) |
| unsigned | FastEmit_ri_ (MVT VT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm, MVT ImmType) |
| virtual unsigned | FastEmit_i (MVT VT, MVT RetVT, unsigned Opcode, uint64_t Imm) |
| virtual unsigned | FastEmit_f (MVT VT, MVT RetVT, unsigned Opcode, const ConstantFP *FPImm) |
| unsigned | FastEmitInst_ (unsigned MachineInstOpcode, const TargetRegisterClass *RC) |
| unsigned | FastEmitInst_r (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill) |
| unsigned | FastEmitInst_rr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill) |
| unsigned | FastEmitInst_rrr (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, unsigned Op2, bool Op2IsKill) |
| unsigned | FastEmitInst_ri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, uint64_t Imm) |
| unsigned | FastEmitInst_rii (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, uint64_t Imm1, uint64_t Imm2) |
| unsigned | FastEmitInst_rf (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, const ConstantFP *FPImm) |
| unsigned | FastEmitInst_rri (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm) |
| unsigned | FastEmitInst_rrii (unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm1, uint64_t Imm2) |
| unsigned | FastEmitInst_i (unsigned MachineInstrOpcode, const TargetRegisterClass *RC, uint64_t Imm) |
| unsigned | FastEmitInst_ii (unsigned MachineInstrOpcode, const TargetRegisterClass *RC, uint64_t Imm1, uint64_t Imm2) |
| FastEmitInst_ii - Emit a MachineInstr with a two immediate operands. | |
| unsigned | FastEmitInst_extractsubreg (MVT RetVT, unsigned Op0, bool Op0IsKill, uint32_t Idx) |
| unsigned | FastEmitZExtFromI1 (MVT VT, unsigned Op0, bool Op0IsKill) |
| void | FastEmitBranch (MachineBasicBlock *MBB, DebugLoc DL) |
| void | UpdateValueMap (const Value *I, unsigned Reg, unsigned NumRegs=1) |
| unsigned | createResultReg (const TargetRegisterClass *RC) |
| virtual unsigned | TargetMaterializeConstant (const Constant *C) |
| virtual unsigned | TargetMaterializeAlloca (const AllocaInst *C) |
| virtual unsigned | TargetMaterializeFloatZero (const ConstantFP *CF) |
Protected Attributes | |
| DenseMap< const Value *, unsigned > | LocalValueMap |
| FunctionLoweringInfo & | FuncInfo |
| MachineRegisterInfo & | MRI |
| MachineFrameInfo & | MFI |
| MachineConstantPool & | MCP |
| DebugLoc | DL |
| const TargetMachine & | TM |
| const DataLayout & | TD |
| const TargetInstrInfo & | TII |
| const TargetLowering & | TLI |
| const TargetRegisterInfo & | TRI |
| const TargetLibraryInfo * | LibInfo |
| MachineInstr * | LastLocalValue |
| MachineInstr * | EmitStartPt |
FastISel - 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 48 of file FastISel.h.
| FastISel::~FastISel | ( | ) | [virtual] |
Definition at line 1097 of file FastISel.cpp.
| FastISel::FastISel | ( | FunctionLoweringInfo & | funcInfo, |
| const TargetLibraryInfo * | libInfo | ||
| ) | [explicit, protected] |
Definition at line 1083 of file FastISel.cpp.
| unsigned FastISel::createResultReg | ( | const TargetRegisterClass * | RC | ) | [protected] |
Definition at line 1194 of file FastISel.cpp.
References llvm::MachineRegisterInfo::createVirtualRegister(), and MRI.
Referenced by FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_ii(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rii(), FastEmitInst_rr(), FastEmitInst_rri(), FastEmitInst_rrii(), and FastEmitInst_rrr().
| FastISel::SavePoint FastISel::enterLocalValueArea | ( | ) |
enterLocalValueArea - Prepare InsertPt to begin inserting instructions into the local value area and return the old insert position.
Definition at line 340 of file FastISel.cpp.
References DL, FuncInfo, llvm::FunctionLoweringInfo::InsertPt, and recomputeInsertPt().
Referenced by getRegForValue().
FastEmit_r - This method is called by target-independent code to request that an instruction with the given type and opcode be emitted.
Definition at line 1103 of file FastISel.cpp.
| unsigned FastISel::FastEmit_f | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| const ConstantFP * | FPImm | ||
| ) | [protected, virtual] |
FastEmit_f - 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 1125 of file FastISel.cpp.
| unsigned FastISel::FastEmit_i | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| uint64_t | Imm | ||
| ) | [protected, virtual] |
FastEmit_i - 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 1121 of file FastISel.cpp.
Referenced by FastEmit_ri_().
| unsigned FastISel::FastEmit_r | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill | ||
| ) | [protected, virtual] |
FastEmit_r - 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 1108 of file FastISel.cpp.
Referenced by getRegForGEPIndex().
| unsigned FastISel::FastEmit_rf | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| const ConstantFP * | FPImm | ||
| ) | [protected, virtual] |
FastEmit_rf - This method is called by target-independent code to request that an instruction with the given type, opcode, and register and floating-point immediate operands be emitted.
Definition at line 1137 of file FastISel.cpp.
| unsigned FastISel::FastEmit_ri | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| uint64_t | Imm | ||
| ) | [protected, virtual] |
FastEmit_ri - 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 1130 of file FastISel.cpp.
Referenced by FastEmit_ri_(), and FastEmitZExtFromI1().
| unsigned FastISel::FastEmit_ri_ | ( | MVT | VT, |
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| uint64_t | Imm, | ||
| MVT | ImmType | ||
| ) | [protected] |
FastEmit_ri_ - 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 1156 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.
| unsigned FastISel::FastEmit_rr | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill | ||
| ) | [protected, virtual] |
FastEmit_rr - 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 1114 of file FastISel.cpp.
Referenced by FastEmit_ri_().
| unsigned FastISel::FastEmit_rri | ( | MVT | VT, |
| MVT | RetVT, | ||
| unsigned | Opcode, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill, | ||
| uint64_t | Imm | ||
| ) | [protected, virtual] |
FastEmit_rri - 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 1144 of file FastISel.cpp.
| void FastISel::FastEmitBranch | ( | MachineBasicBlock * | MSucc, |
| DebugLoc | DL | ||
| ) | [protected] |
FastEmitBranch - Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.
Definition at line 865 of file FastISel.cpp.
References llvm::MachineBasicBlock::addSuccessor(), FuncInfo, llvm::MachineBasicBlock::getBasicBlock(), llvm::TargetInstrInfo::InsertBranch(), llvm::MachineBasicBlock::isLayoutSuccessor(), llvm::FunctionLoweringInfo::MBB, llvm::BasicBlock::size(), and TII.
Referenced by SelectOperator().
| unsigned FastISel::FastEmitInst_ | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC | ||
| ) | [protected] |
FastEmitInst_ - Emit a MachineInstr with no operands and a result register in the given register class.
Definition at line 1198 of file FastISel.cpp.
References llvm::BuildMI(), createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_extractsubreg | ( | MVT | RetVT, |
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| uint32_t | Idx | ||
| ) | [protected] |
FastEmitInst_extractsubreg - Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type.
Definition at line 1417 of file FastISel.cpp.
References llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::TargetOpcode::COPY, createResultReg(), DL, 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.
| unsigned FastISel::FastEmitInst_i | ( | unsigned | MachineInstrOpcode, |
| const TargetRegisterClass * | RC, | ||
| uint64_t | Imm | ||
| ) | [protected] |
FastEmitInst_i - Emit a MachineInstr with a single immediate operand, and a result register in the given register class.
Definition at line 1384 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_ii | ( | unsigned | MachineInstrOpcode, |
| const TargetRegisterClass * | RC, | ||
| uint64_t | Imm1, | ||
| uint64_t | Imm2 | ||
| ) | [protected] |
FastEmitInst_ii - Emit a MachineInstr with a two immediate operands.
Definition at line 1400 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_r | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill | ||
| ) | [protected] |
FastEmitInst_r - Emit a MachineInstr with one register operand and a result register in the given register class.
Definition at line 1207 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rf | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| const ConstantFP * | FPImm | ||
| ) | [protected] |
FastEmitInst_rf - Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 1315 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addFPImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_ri | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| uint64_t | Imm | ||
| ) | [protected] |
FastEmitInst_ri - Emit a MachineInstr with a register operand, an immediate, and a result register in the given register class.
Definition at line 1271 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rii | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| uint64_t | Imm1, | ||
| uint64_t | Imm2 | ||
| ) | [protected] |
FastEmitInst_rii - Emit a MachineInstr with one register operand and two immediate operands.
Definition at line 1292 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rr | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill | ||
| ) | [protected] |
FastEmitInst_rr - Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 1226 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rri | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill, | ||
| uint64_t | Imm | ||
| ) | [protected] |
FastEmitInst_rri - Emit a MachineInstr with two register operands, an immediate, and a result register in the given register class.
Definition at line 1336 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rrii | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill, | ||
| uint64_t | Imm1, | ||
| uint64_t | Imm2 | ||
| ) | [protected] |
FastEmitInst_rrii - Emit a MachineInstr with two register operands, two immediates operands, and a result register in the given register class.
Definition at line 1360 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
| unsigned FastISel::FastEmitInst_rrr | ( | unsigned | MachineInstOpcode, |
| const TargetRegisterClass * | RC, | ||
| unsigned | Op0, | ||
| bool | Op0IsKill, | ||
| unsigned | Op1, | ||
| bool | Op1IsKill, | ||
| unsigned | Op2, | ||
| bool | Op2IsKill | ||
| ) | [protected] |
FastEmitInst_rrr - Emit a MachineInstr with three register operands and a result register in the given register class.
Definition at line 1247 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetOpcode::COPY, createResultReg(), DL, FuncInfo, llvm::MCInstrInfo::get(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInstrDesc::ImplicitDefs, llvm::FunctionLoweringInfo::InsertPt, llvm::RegState::Kill, llvm::FunctionLoweringInfo::MBB, and TII.
FastEmitZExtFromI1 - Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.
Definition at line 1433 of file FastISel.cpp.
References llvm::ISD::AND, and FastEmit_ri().
| bool FastISel::FastLowerArguments | ( | ) | [protected, virtual] |
FastLowerArguments - This method is called by target-independent code to do target specific argument lowering. It returns true if it was successful.
Definition at line 1099 of file FastISel.cpp.
Referenced by LowerArguments().
| DebugLoc llvm::FastISel::getCurDebugLoc | ( | ) | const [inline] |
getCurDebugLoc() - Return current debug location information.
Definition at line 92 of file FastISel.h.
References DL.
| MachineInstr* llvm::FastISel::getLastLocalValue | ( | ) | [inline] |
getLastLocalValue - Return the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 77 of file FastISel.h.
References LastLocalValue.
Referenced by recomputeInsertPt().
getRegForGEPIndex - This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value.
Definition at line 290 of file FastISel.cpp.
References llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), FastEmit_r(), llvm::EVT::getEVT(), llvm::TargetLoweringBase::getPointerTy(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::ISD::SIGN_EXTEND, TLI, and llvm::ISD::TRUNCATE.
getRegForValue - Create a virtual register and arrange for it to be assigned the value for the given LLVM value.
Definition at line 143 of file FastISel.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), enterLocalValueArea(), FuncInfo, llvm::Value::getContext(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::TargetLoweringBase::getTypeToTransformTo(), llvm::TargetLoweringBase::getValueType(), llvm::MVT::i1, llvm::MVT::i16, llvm::MVT::i8, llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::isTypeLegal(), leaveLocalValueArea(), lookUpRegForValue(), llvm::FunctionLoweringInfo::StaticAllocaMap, and TLI.
Referenced by FastEmit_ri_(), getRegForGEPIndex(), SelectOperator(), and tryToFoldLoad().
| void FastISel::leaveLocalValueArea | ( | SavePoint | Old | ) |
leaveLocalValueArea - Reset InsertPt to the given old insert position.
Definition at line 349 of file FastISel.cpp.
References llvm::MachineBasicBlock::begin(), DL, llvm::FastISel::SavePoint::DL, FuncInfo, llvm::FunctionLoweringInfo::InsertPt, llvm::FastISel::SavePoint::InsertPt, LastLocalValue, llvm::FunctionLoweringInfo::MBB, and llvm::prior().
Referenced by getRegForValue().
lookUpRegForValue - 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 254 of file FastISel.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), FuncInfo, LocalValueMap, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by getRegForValue().
| bool FastISel::LowerArguments | ( | ) |
LowerArguments - Do "fast" instruction selection for function arguments and append machine instructions to the current block. Return true if it is successful.
Definition at line 90 of file FastISel.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), llvm::FunctionLoweringInfo::CanLowerReturn, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), FastLowerArguments(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::FunctionLoweringInfo::Fn, FuncInfo, llvm::ARM_PROC::I, LocalValueMap, and llvm::FunctionLoweringInfo::ValueMap.
| void FastISel::recomputeInsertPt | ( | ) |
recomputeInsertPt - Reset InsertPt to prepare for inserting instructions into the current block.
Definition at line 314 of file FastISel.cpp.
References llvm::ISD::EH_LABEL, llvm::MachineBasicBlock::end(), FuncInfo, llvm::MachineBasicBlock::getFirstNonPHI(), getLastLocalValue(), llvm::FunctionLoweringInfo::InsertPt, and llvm::FunctionLoweringInfo::MBB.
Referenced by enterLocalValueArea(), removeDeadCode(), and SelectInstruction().
| void FastISel::removeDeadCode | ( | MachineBasicBlock::iterator | I, |
| MachineBasicBlock::iterator | E | ||
| ) |
removeDeadCode - Remove all dead instructions between the I and E.
Definition at line 328 of file FastISel.cpp.
References llvm::RegState::Dead, llvm::MachineInstr::eraseFromParent(), llvm::ARM_PROC::I, and recomputeInsertPt().
Referenced by SelectInstruction().
| bool FastISel::SelectInstruction | ( | const Instruction * | I | ) |
SelectInstruction - Do "fast" instruction selection for the given LLVM IR instruction, and append generated machine instructions to the current block. Return true if selection was successful.
Definition at line 809 of file FastISel.cpp.
References DL, FuncInfo, llvm::CallInst::getCalledFunction(), llvm::Instruction::getDebugLoc(), llvm::TargetLibraryInfo::getLibFunc(), llvm::Value::getName(), llvm::Instruction::getOpcode(), llvm::Instruction::getParent(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), llvm::TargetLibraryInfo::hasOptimizedCodeGen(), llvm::FunctionLoweringInfo::InsertPt, LibInfo, recomputeInsertPt(), removeDeadCode(), SelectOperator(), and TargetSelectInstruction().
SelectOperator - 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 968 of file FastISel.cpp.
References llvm::ISD::ADD, llvm::Alloca, llvm::ISD::AND, llvm::APIntOps::And(), llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), llvm::Call, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::ISD::FADD, FastEmitBranch(), llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FP_TO_SINT, llvm::FPToSI, llvm::ISD::FREM, llvm::ISD::FSUB, FuncInfo, llvm::Instruction::getDebugLoc(), llvm::User::getOperand(), getRegForValue(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::TargetLoweringBase::getValueType(), llvm::ARM_PROC::I, llvm::IntToPtr, llvm::BinaryOperator::isFNeg(), llvm::BranchInst::isUnconditional(), llvm_unreachable, llvm::LShr, llvm::FunctionLoweringInfo::MBBMap, llvm::ISD::MUL, llvm::ISD::OR, llvm::APIntOps::Or(), llvm::PHI, llvm::ISD::SDIV, llvm::SExt, llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::SIToFP, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::FunctionLoweringInfo::StaticAllocaMap, llvm::ISD::SUB, TLI, llvm::Trunc, llvm::ISD::TRUNCATE, llvm::ISD::UDIV, UpdateValueMap(), llvm::ISD::UREM, llvm::ISD::XOR, llvm::APIntOps::Xor(), and llvm::ISD::ZERO_EXTEND.
Referenced by SelectInstruction().
| void llvm::FastISel::setLastLocalValue | ( | MachineInstr * | I | ) | [inline] |
setLastLocalValue - Update the position of the last instruction emitted for materializing constants for use in the current block.
Definition at line 81 of file FastISel.h.
References EmitStartPt, llvm::ARM_PROC::I, and LastLocalValue.
| void FastISel::startNewBlock | ( | ) |
startNewBlock - Set the current block to which generated machine instructions will be appended, and clear the local CSE map.
Definition at line 75 of file FastISel.cpp.
References llvm::MachineBasicBlock::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::ISD::EH_LABEL, EmitStartPt, llvm::MachineBasicBlock::end(), FuncInfo, llvm::ARM_PROC::I, LastLocalValue, LocalValueMap, and llvm::FunctionLoweringInfo::MBB.
| virtual unsigned llvm::FastISel::TargetMaterializeAlloca | ( | const AllocaInst * | C | ) | [inline, protected, virtual] |
TargetMaterializeAlloca - Emit an alloca address in a register using target-specific logic.
Definition at line 383 of file FastISel.h.
| virtual unsigned llvm::FastISel::TargetMaterializeConstant | ( | const Constant * | C | ) | [inline, protected, virtual] |
TargetMaterializeConstant - Emit a constant in a register using target-specific logic, such as constant pool loads.
Definition at line 377 of file FastISel.h.
| virtual unsigned llvm::FastISel::TargetMaterializeFloatZero | ( | const ConstantFP * | CF | ) | [inline, protected, virtual] |
Definition at line 387 of file FastISel.h.
| virtual bool llvm::FastISel::TargetSelectInstruction | ( | const Instruction * | I | ) | [protected, pure virtual] |
TargetSelectInstruction - 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().
| 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 1509 of file FastISel.cpp.
References FuncInfo, llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs, SkipDebug >::getOperandNo(), llvm::Instruction::getParent(), llvm::MachineInstr::getParent(), getRegForValue(), llvm::Value::hasOneUse(), llvm::MachineRegisterInfo::hasOneUse(), llvm::FunctionLoweringInfo::InsertPt, llvm::LoadInst::isVolatile(), LI, llvm::FunctionLoweringInfo::MBB, MRI, llvm::MachineRegisterInfo::reg_begin(), tryToFoldLoadIntoMI(), and llvm::Instruction::use_back().
| virtual bool llvm::FastISel::tryToFoldLoadIntoMI | ( | MachineInstr * | , |
| unsigned | , | ||
| const LoadInst * | |||
| ) | [inline, virtual] |
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 146 of file FastISel.h.
Referenced by tryToFoldLoad().
UpdateValueMap - 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 271 of file FastISel.cpp.
References FuncInfo, llvm::ARM_PROC::I, LocalValueMap, llvm::FunctionLoweringInfo::RegFixups, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by SelectOperator().
DebugLoc llvm::FastISel::DL [protected] |
Definition at line 55 of file FastISel.h.
Referenced by enterLocalValueArea(), FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_ii(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rii(), FastEmitInst_rr(), FastEmitInst_rri(), FastEmitInst_rrii(), FastEmitInst_rrr(), getCurDebugLoc(), leaveLocalValueArea(), and SelectInstruction().
MachineInstr* llvm::FastISel::EmitStartPt [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 72 of file FastISel.h.
Referenced by setLastLocalValue(), and startNewBlock().
FunctionLoweringInfo& llvm::FastISel::FuncInfo [protected] |
Definition at line 51 of file FastISel.h.
Referenced by enterLocalValueArea(), FastEmit_ri_(), FastEmitBranch(), FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_ii(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rii(), FastEmitInst_rr(), FastEmitInst_rri(), FastEmitInst_rrii(), FastEmitInst_rrr(), getRegForValue(), leaveLocalValueArea(), lookUpRegForValue(), LowerArguments(), recomputeInsertPt(), SelectInstruction(), SelectOperator(), startNewBlock(), tryToFoldLoad(), and UpdateValueMap().
MachineInstr* llvm::FastISel::LastLocalValue [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 67 of file FastISel.h.
Referenced by getLastLocalValue(), leaveLocalValueArea(), setLastLocalValue(), and startNewBlock().
const TargetLibraryInfo* llvm::FastISel::LibInfo [protected] |
Definition at line 61 of file FastISel.h.
Referenced by SelectInstruction().
DenseMap<const Value *, unsigned> llvm::FastISel::LocalValueMap [protected] |
Definition at line 50 of file FastISel.h.
Referenced by lookUpRegForValue(), LowerArguments(), startNewBlock(), and UpdateValueMap().
MachineConstantPool& llvm::FastISel::MCP [protected] |
Definition at line 54 of file FastISel.h.
MachineFrameInfo& llvm::FastISel::MFI [protected] |
Definition at line 53 of file FastISel.h.
MachineRegisterInfo& llvm::FastISel::MRI [protected] |
Definition at line 52 of file FastISel.h.
Referenced by createResultReg(), FastEmitInst_extractsubreg(), and tryToFoldLoad().
const DataLayout& llvm::FastISel::TD [protected] |
Definition at line 57 of file FastISel.h.
const TargetInstrInfo& llvm::FastISel::TII [protected] |
Definition at line 58 of file FastISel.h.
Referenced by FastEmitBranch(), FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_ii(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rii(), FastEmitInst_rr(), FastEmitInst_rri(), FastEmitInst_rrii(), and FastEmitInst_rrr().
const TargetLowering& llvm::FastISel::TLI [protected] |
Definition at line 59 of file FastISel.h.
Referenced by FastEmitInst_extractsubreg(), getRegForGEPIndex(), getRegForValue(), and SelectOperator().
const TargetMachine& llvm::FastISel::TM [protected] |
Definition at line 56 of file FastISel.h.
const TargetRegisterInfo& llvm::FastISel::TRI [protected] |
Definition at line 60 of file FastISel.h.
Referenced by FastEmitInst_extractsubreg().