15 #ifndef LLVM_CODEGEN_FASTISEL_H
16 #define LLVM_CODEGEN_FASTISEL_H
27 class FunctionLoweringInfo;
30 class MachineConstantPool;
31 class MachineFunction;
33 class MachineFrameInfo;
34 class MachineRegisterInfo;
36 class TargetInstrInfo;
37 class TargetLibraryInfo;
40 class TargetRegisterClass;
41 class TargetRegisterInfo;
191 unsigned Op0,
bool Op0IsKill);
198 unsigned Op0,
bool Op0IsKill,
199 unsigned Op1,
bool Op1IsKill);
207 unsigned Op0,
bool Op0IsKill,
216 unsigned Op0,
bool Op0IsKill,
225 unsigned Op0,
bool Op0IsKill,
226 unsigned Op1,
bool Op1IsKill,
236 unsigned Op0,
bool Op0IsKill,
237 uint64_t Imm,
MVT ImmType);
263 unsigned Op0,
bool Op0IsKill);
269 unsigned Op0,
bool Op0IsKill,
270 unsigned Op1,
bool Op1IsKill);
276 unsigned Op0,
bool Op0IsKill,
277 unsigned Op1,
bool Op1IsKill,
278 unsigned Op2,
bool Op2IsKill);
284 unsigned Op0,
bool Op0IsKill,
290 unsigned Op0,
bool Op0IsKill,
291 uint64_t Imm1, uint64_t Imm2);
297 unsigned Op0,
bool Op0IsKill,
304 unsigned Op0,
bool Op0IsKill,
305 unsigned Op1,
bool Op1IsKill,
312 unsigned Op0,
bool Op0IsKill,
313 unsigned Op1,
bool Op1IsKill,
314 uint64_t Imm1, uint64_t Imm2);
325 uint64_t Imm1, uint64_t Imm2);
330 unsigned Op0,
bool Op0IsKill,
336 unsigned Op0,
bool Op0IsKill);
371 bool SelectBinaryOp(
const User *
I,
unsigned ISDOpcode);
373 bool SelectFNeg(
const User *
I);
375 bool SelectGetElementPtr(
const User *
I);
377 bool SelectCall(
const User *
I);
379 bool SelectBitCast(
const User *
I);
381 bool SelectCast(
const User *
I,
unsigned Opcode);
383 bool SelectExtractValue(
const User *
I);
385 bool SelectInsertValue(
const User *
I);
394 bool HandlePHINodesInSuccessorBlocks(
const BasicBlock *LLVMBB);
399 unsigned materializeRegForValue(
const Value *V,
MVT VT);
404 void flushLocalValueMap();
407 bool hasTrivialKill(
const Value *V)
const;
virtual unsigned FastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t Imm)
The machine constant pool.
MachineConstantPool & MCP
unsigned FastEmitInst_rri(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm)
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)
Emit a MachineInstr with a two immediate operands.
void leaveLocalValueArea(SavePoint Old)
Reset InsertPt to the given old insert position.
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 ...
virtual unsigned TargetMaterializeAlloca(const AllocaInst *C)
Emit an alloca address in a register using target-specific logic.
virtual bool TargetSelectInstruction(const Instruction *I)=0
unsigned FastEmitInst_ri(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, uint64_t Imm)
DebugLoc getCurDebugLoc() const
Return current debug location information.
LoopInfoBase< BlockT, LoopT > * LI
unsigned FastEmitInst_rrr(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, unsigned Op2, bool Op2IsKill)
virtual unsigned FastEmit_rf(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, const ConstantFP *FPImm)
DenseMap< const Value *, unsigned > LocalValueMap
void setLastLocalValue(MachineInstr *I)
bool canFoldAddIntoGEP(const User *GEP, const Value *Add)
Check if Add is an add that can be safely folded into GEP.
MachineInstr * EmitStartPt
Abstract Stack Frame Information.
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.
unsigned getRegForValue(const Value *V)
unsigned FastEmitInst_rf(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, const ConstantFP *FPImm)
unsigned FastEmitInst_(unsigned MachineInstOpcode, const TargetRegisterClass *RC)
MachineInstr * getLastLocalValue()
unsigned lookUpRegForValue(const Value *V)
virtual unsigned TargetMaterializeConstant(const Constant *C)
bundle_iterator< MachineInstr, instr_iterator > iterator
bool SelectInstruction(const Instruction *I)
unsigned FastEmitInst_r(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill)
LLVM Basic Block Representation.
bool SelectOperator(const User *I, unsigned Opcode)
virtual unsigned FastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill)
LLVM Constant Representation.
void removeDeadCode(MachineBasicBlock::iterator I, MachineBasicBlock::iterator E)
Remove all dead instructions between the I and E.
unsigned FastEmitZExtFromI1(MVT VT, unsigned Op0, bool Op0IsKill)
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 multi...
void FastEmitBranch(MachineBasicBlock *MBB, DebugLoc DL)
unsigned FastEmitInst_rr(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill)
const TargetRegisterInfo & TRI
virtual unsigned FastEmit_(MVT VT, MVT RetVT, unsigned Opcode)
const TargetInstrInfo & TII
MachineInstr * LastLocalValue
const TargetLibraryInfo * LibInfo
unsigned FastEmit_ri_(MVT VT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm, MVT ImmType)
This method is a wrapper of FastEmit_ri.
virtual bool FastLowerArguments()
virtual unsigned FastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill)
SavePoint enterLocalValueArea()
virtual unsigned FastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm)
MachineRegisterInfo & MRI
FastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
const TargetLowering & TLI
unsigned createResultReg(const TargetRegisterClass *RC)
unsigned FastEmitInst_rrii(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm1, uint64_t Imm2)
void UpdateValueMap(const Value *I, unsigned Reg, unsigned NumRegs=1)
MachineBasicBlock::iterator InsertPt
virtual unsigned FastEmit_f(MVT VT, MVT RetVT, unsigned Opcode, const ConstantFP *FPImm)
LLVM Value Representation.
unsigned FastEmitInst_extractsubreg(MVT RetVT, unsigned Op0, bool Op0IsKill, uint32_t Idx)
virtual unsigned FastEmit_rri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t Imm)
FunctionLoweringInfo & FuncInfo
virtual unsigned TargetMaterializeFloatZero(const ConstantFP *CF)
std::pair< unsigned, bool > getRegForGEPIndex(const Value *V)