LLVM API Documentation
#include <FastISel.h>
Definition at line 42 of file FastISel.h.
| FastISel::~FastISel | ( | ) | [virtual] |
Definition at line 759 of file FastISel.cpp.
| FastISel::FastISel | ( | MachineFunction & | mf, | |
| MachineModuleInfo * | mmi, | |||
| DwarfWriter * | dw, | |||
| DenseMap< const Value *, unsigned > & | vm, | |||
| DenseMap< const BasicBlock *, MachineBasicBlock * > & | bm, | |||
| DenseMap< const AllocaInst *, int > & | am, | |||
| SmallSet< Instruction *, 8 > & | cil | |||
| ) | [protected] |
Definition at line 730 of file FastISel.cpp.
| void llvm::FastISel::startNewBlock | ( | MachineBasicBlock * | mbb | ) | [inline] |
startNewBlock - Set the current block to which generated machine instructions will be appended, and clear the local CSE map.
Definition at line 68 of file FastISel.h.
References LocalValueMap, and setCurrentBlock().
| void llvm::FastISel::setCurrentBlock | ( | MachineBasicBlock * | mbb | ) | [inline] |
setCurrentBlock - Set the current block to which generated machine instructions will be appended.
Definition at line 76 of file FastISel.h.
References MBB.
Referenced by startNewBlock().
| void llvm::FastISel::setCurDebugLoc | ( | DebugLoc | dl | ) | [inline] |
setCurDebugLoc - Set the current debug location information, which is used when creating a machine instruction.
Definition at line 83 of file FastISel.h.
References DL.
| DebugLoc llvm::FastISel::getCurDebugLoc | ( | ) | const [inline] |
getCurDebugLoc() - Return current debug location information.
Definition at line 86 of file FastISel.h.
References DL.
| bool FastISel::SelectInstruction | ( | 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 598 of file FastISel.cpp.
References llvm::Instruction::getOpcode(), and SelectOperator().
SelectInstruction - 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 620 of file FastISel.cpp.
References llvm::ISD::ADD, llvm::APIntOps::And(), llvm::ISD::AND, BitCast, llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), Call, llvm::ISD::FADD, FastEmitBranch(), llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FP_TO_SINT, llvm::ISD::FREM, llvm::ISD::FSUB, llvm::User::getOperand(), getRegForValue(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::TargetLowering::getValueType(), llvm::BranchInst::isUnconditional(), LShr, MBBMap, llvm::ISD::MUL, llvm::ISD::OR, llvm::APIntOps::Or(), PHI, PtrToInt, llvm::ISD::SDIV, llvm::Attribute::SExt, llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, StaticAllocaMap, llvm::ISD::SUB, TLI, llvm::ISD::TRUNCATE, llvm::ISD::UDIV, UpdateValueMap(), llvm::ISD::UREM, llvm::APIntOps::Xor(), llvm::ISD::XOR, llvm::ISD::ZERO_EXTEND, and ZExt.
Referenced by getRegForValue(), and SelectInstruction().
| virtual bool llvm::FastISel::TargetSelectInstruction | ( | Instruction * | I | ) | [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.
getRegForValue - Create a virtual register and arrange for it to be assigned the value for the given LLVM value.
Definition at line 59 of file FastISel.cpp.
References llvm::BuildMI(), llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::APFloat::convertToInteger(), createResultReg(), DL, FastEmit_f(), FastEmit_i(), FastEmit_r(), llvm::TargetInstrInfo::get(), llvm::ConstantInt::get(), llvm::Value::getContext(), llvm::TargetData::getIntPtrType(), llvm::Constant::getNullValue(), llvm::TargetLowering::getPointerTy(), llvm::TargetLowering::getRegClassFor(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::Value::getType(), llvm::TargetLowering::getTypeToTransformTo(), llvm::TargetLowering::getValueType(), llvm::MVT::i1, llvm::TargetInstrInfo::IMPLICIT_DEF, llvm::EVT::isSimple(), llvm::TargetLowering::isTypeLegal(), LocalValueMap, MBB, Reg, llvm::APFloat::rmTowardZero, SelectOperator(), llvm::ISD::SINT_TO_FP, TargetMaterializeAlloca(), TargetMaterializeConstant(), TD, TII, TLI, and VT.
Referenced by getRegForGEPIndex(), and SelectOperator().
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 138 of file FastISel.cpp.
References LocalValueMap.
getRegForGEPIndex - This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the given getelementptr index value.
Definition at line 171 of file FastISel.cpp.
References llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), FastEmit_r(), llvm::EVT::getEVT(), llvm::TargetLowering::getPointerTy(), getRegForValue(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::ISD::SIGN_EXTEND, TLI, and llvm::ISD::TRUNCATE.
| unsigned FastISel::FastEmit_ | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode | |||
| ) | [protected, virtual] |
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 761 of file FastISel.cpp.
| unsigned FastISel::FastEmit_r | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| unsigned | Op0 | |||
| ) | [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 766 of file FastISel.cpp.
Referenced by FastEmit_rf_(), getRegForGEPIndex(), and getRegForValue().
| unsigned FastISel::FastEmit_rr | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| unsigned | Op1 | |||
| ) | [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 771 of file FastISel.cpp.
Referenced by FastEmit_rf_(), and FastEmit_ri_().
| unsigned FastISel::FastEmit_ri | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| 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 786 of file FastISel.cpp.
Referenced by FastEmit_ri_(), and FastEmitZExtFromI1().
| unsigned FastISel::FastEmit_rf | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| 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 792 of file FastISel.cpp.
Referenced by FastEmit_rf_().
| unsigned FastISel::FastEmit_rri | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| unsigned | Op1, | |||
| 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 798 of file FastISel.cpp.
| unsigned FastISel::FastEmit_ri_ | ( | MVT | VT, | |
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| 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.
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 809 of file FastISel.cpp.
References llvm::ISD::Constant, FastEmit_i(), FastEmit_ri(), and FastEmit_rr().
| unsigned FastISel::FastEmit_rf_ | ( | MVT | VT, | |
| ISD::NodeType | Opcode, | |||
| unsigned | Op0, | |||
| ConstantFP * | FPImm, | |||
| MVT | ImmType | |||
| ) | [protected] |
FastEmit_rf_ - This method is a wrapper of FastEmit_rf. It first tries to emit an instruction with an immediate operand using FastEmit_rf. If that fails, it materializes the immediate into a register and try FastEmit_rr instead.
FastEmit_rf_ - This method is a wrapper of FastEmit_ri. It first tries to emit an instruction with a floating-point immediate operand using FastEmit_rf. If that fails, it materializes the immediate into a register and try FastEmit_rr instead.
Definition at line 826 of file FastISel.cpp.
References llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::APFloat::convertToInteger(), FastEmit_f(), FastEmit_i(), FastEmit_r(), FastEmit_rf(), FastEmit_rr(), llvm::TargetLowering::getPointerTy(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::ConstantFP::getValueAPF(), llvm::APInt::getZExtValue(), llvm::APFloat::rmTowardZero, llvm::ISD::SINT_TO_FP, and TLI.
| unsigned FastISel::FastEmit_i | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | 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 777 of file FastISel.cpp.
Referenced by FastEmit_rf_(), FastEmit_ri_(), and getRegForValue().
| unsigned FastISel::FastEmit_f | ( | MVT | VT, | |
| MVT | RetVT, | |||
| ISD::NodeType | Opcode, | |||
| 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 781 of file FastISel.cpp.
Referenced by FastEmit_rf_(), and getRegForValue().
| 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 871 of file FastISel.cpp.
References llvm::BuildMI(), createResultReg(), DL, llvm::TargetInstrInfo::get(), MBB, and TII.
| unsigned FastISel::FastEmitInst_r | ( | unsigned | MachineInstOpcode, | |
| const TargetRegisterClass * | RC, | |||
| unsigned | Op0 | |||
| ) | [protected] |
FastEmitInst_r - Emit a MachineInstr with one register operand and a result register in the given register class.
Definition at line 880 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
| unsigned FastISel::FastEmitInst_rr | ( | unsigned | MachineInstOpcode, | |
| const TargetRegisterClass * | RC, | |||
| unsigned | Op0, | |||
| unsigned | Op1 | |||
| ) | [protected] |
FastEmitInst_rr - Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 899 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
| unsigned FastISel::FastEmitInst_ri | ( | unsigned | MachineInstOpcode, | |
| const TargetRegisterClass * | RC, | |||
| unsigned | Op0, | |||
| uint64_t | Imm | |||
| ) | [protected] |
FastEmitInst_ri - Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 917 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
| unsigned FastISel::FastEmitInst_rf | ( | unsigned | MachineInstOpcode, | |
| const TargetRegisterClass * | RC, | |||
| unsigned | Op0, | |||
| ConstantFP * | FPImm | |||
| ) | [protected] |
FastEmitInst_rf - Emit a MachineInstr with two register operands and a result register in the given register class.
Definition at line 935 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addFPImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
| unsigned FastISel::FastEmitInst_rri | ( | unsigned | MachineInstOpcode, | |
| const TargetRegisterClass * | RC, | |||
| unsigned | Op0, | |||
| unsigned | Op1, | |||
| 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 953 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
| 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 971 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getNumDefs(), llvm::TargetInstrDesc::ImplicitDefs, MBB, and TII.
FastEmitInst_extractsubreg - Emit a MachineInstr for an extract_subreg from a specified index of a superregister to a specified type.
Definition at line 989 of file FastISel.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetInstrInfo::copyRegToReg(), createResultReg(), DL, llvm::MachineBasicBlock::end(), llvm::TargetInstrInfo::EXTRACT_SUBREG, llvm::TargetInstrInfo::get(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetLowering::getRegClassFor(), MBB, MRI, TII, and TLI.
FastEmitZExtFromI1 - Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.
FastEmitZExtFromI1 - Emit MachineInstrs to compute the value of Op with all but the least significant bit set to zero.
Definition at line 1010 of file FastISel.cpp.
References llvm::ISD::AND, and FastEmit_ri().
| void FastISel::FastEmitBranch | ( | MachineBasicBlock * | MSucc | ) | [protected] |
FastEmitBranch - Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.
FastEmitBranch - Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor, and update the CFG.
Definition at line 606 of file FastISel.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::TargetInstrInfo::InsertBranch(), llvm::MachineBasicBlock::isLayoutSuccessor(), MBB, llvm::next(), and TII.
Referenced by SelectOperator().
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 154 of file FastISel.cpp.
References llvm::TargetInstrInfo::copyRegToReg(), llvm::MachineBasicBlock::end(), llvm::MachineRegisterInfo::getRegClass(), LocalValueMap, MBB, MRI, and TII.
Referenced by SelectOperator().
| unsigned FastISel::createResultReg | ( | const TargetRegisterClass * | RC | ) | [protected] |
Definition at line 867 of file FastISel.cpp.
References llvm::MachineRegisterInfo::createVirtualRegister(), and MRI.
Referenced by FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rr(), FastEmitInst_rri(), and getRegForValue().
| virtual unsigned llvm::FastISel::TargetMaterializeConstant | ( | Constant * | C | ) | [inline, protected, virtual] |
TargetMaterializeConstant - Emit a constant in a register using target-specific logic, such as constant pool loads.
Definition at line 290 of file FastISel.h.
Referenced by getRegForValue().
| virtual unsigned llvm::FastISel::TargetMaterializeAlloca | ( | AllocaInst * | C | ) | [inline, protected, virtual] |
TargetMaterializeAlloca - Emit an alloca address in a register using target-specific logic.
Definition at line 296 of file FastISel.h.
Referenced by getRegForValue().
MachineBasicBlock* llvm::FastISel::MBB [protected] |
Definition at line 44 of file FastISel.h.
Referenced by FastEmitBranch(), FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rr(), FastEmitInst_rri(), getRegForValue(), setCurrentBlock(), and UpdateValueMap().
DenseMap<const Value *, unsigned> llvm::FastISel::LocalValueMap [protected] |
Definition at line 45 of file FastISel.h.
Referenced by getRegForValue(), lookUpRegForValue(), startNewBlock(), and UpdateValueMap().
DenseMap<const Value *, unsigned>& llvm::FastISel::ValueMap [protected] |
Definition at line 46 of file FastISel.h.
DenseMap<const BasicBlock *, MachineBasicBlock *>& llvm::FastISel::MBBMap [protected] |
DenseMap<const AllocaInst *, int>& llvm::FastISel::StaticAllocaMap [protected] |
SmallSet<Instruction*, 8>& llvm::FastISel::CatchInfoLost [protected] |
Definition at line 50 of file FastISel.h.
MachineFunction& llvm::FastISel::MF [protected] |
Definition at line 52 of file FastISel.h.
MachineModuleInfo* llvm::FastISel::MMI [protected] |
Definition at line 53 of file FastISel.h.
DwarfWriter* llvm::FastISel::DW [protected] |
Definition at line 54 of file FastISel.h.
MachineRegisterInfo& llvm::FastISel::MRI [protected] |
Definition at line 55 of file FastISel.h.
Referenced by createResultReg(), FastEmitInst_extractsubreg(), and UpdateValueMap().
MachineFrameInfo& llvm::FastISel::MFI [protected] |
Definition at line 56 of file FastISel.h.
MachineConstantPool& llvm::FastISel::MCP [protected] |
Definition at line 57 of file FastISel.h.
DebugLoc llvm::FastISel::DL [protected] |
Definition at line 58 of file FastISel.h.
Referenced by FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rr(), FastEmitInst_rri(), getCurDebugLoc(), getRegForValue(), and setCurDebugLoc().
const TargetMachine& llvm::FastISel::TM [protected] |
Definition at line 59 of file FastISel.h.
const TargetData& llvm::FastISel::TD [protected] |
const TargetInstrInfo& llvm::FastISel::TII [protected] |
Definition at line 61 of file FastISel.h.
Referenced by FastEmitBranch(), FastEmitInst_(), FastEmitInst_extractsubreg(), FastEmitInst_i(), FastEmitInst_r(), FastEmitInst_rf(), FastEmitInst_ri(), FastEmitInst_rr(), FastEmitInst_rri(), getRegForValue(), and UpdateValueMap().
const TargetLowering& llvm::FastISel::TLI [protected] |
Definition at line 62 of file FastISel.h.
Referenced by FastEmit_rf_(), FastEmitInst_extractsubreg(), getRegForGEPIndex(), getRegForValue(), and SelectOperator().