112 using namespace llvm;
114 #define DEBUG_TYPE "isel" 119 cl::desc(
"Sink local values in FastISel"));
121 STATISTIC(NumFastIselSuccessIndependent,
"Number of insts selected by " 122 "target-independent selector");
123 STATISTIC(NumFastIselSuccessTarget,
"Number of insts selected by " 124 "target-specific selector");
125 STATISTIC(NumFastIselDead,
"Number of dead insts removed on failure");
131 "local values should be cleared after finishing a BB");
175 RegDef = MO.getReg();
184 void FastISel::flushLocalValueMap() {
197 InstOrderMap OrderMap;
208 sinkLocalValueMaterialization(LocalMI, DefReg, OrderMap);
222 if (
P.second == DefReg)
234 if (!FirstTerminator &&
235 (
I.isTerminator() || (
I.isEHLabel() && &
I != &MBB->front()))) {
236 FirstTerminator = &
I;
237 FirstTerminatorOrder = Order;
239 Orders[&
I] = Order++;
247 void FastISel::sinkLocalValueMaterialization(
MachineInstr &LocalMI,
249 InstOrderMap &OrderMap) {
266 OrderMap.Orders.erase(&LocalMI);
273 if (OrderMap.Orders.empty())
280 auto I = OrderMap.Orders.find(&UseInst);
281 assert(
I != OrderMap.Orders.end() &&
282 "local value used by instruction outside local region");
283 unsigned UseOrder =
I->second;
284 if (UseOrder < FirstOrder) {
285 FirstOrder = UseOrder;
286 FirstUser = &UseInst;
294 if (UsedByPHI && OrderMap.FirstTerminatorOrder < FirstOrder) {
295 FirstOrder = OrderMap.FirstTerminatorOrder;
296 SinkPos = OrderMap.FirstTerminator->getIterator();
297 }
else if (FirstUser) {
300 assert(UsedByPHI &&
"must be users if not used by a phi");
308 if (!DbgVal.isDebugValue())
310 unsigned UseOrder = OrderMap.Orders[&DbgVal];
311 if (UseOrder < FirstOrder)
316 LLVM_DEBUG(
dbgs() <<
"sinking local value to first use " << LocalMI);
336 if (
const auto *Cast = dyn_cast<CastInst>(I))
348 if (
const auto *
GEP = dyn_cast<GetElementPtrInst>(I))
355 !(I->
getOpcode() == Instruction::BitCast ||
356 I->
getOpcode() == Instruction::PtrToInt ||
357 I->
getOpcode() == Instruction::IntToPtr) &&
386 if (isa<Instruction>(V) &&
387 (!isa<AllocaInst>(V) ||
395 Reg = materializeRegForValue(V, VT);
402 unsigned FastISel::materializeConstant(
const Value *V,
MVT VT) {
404 if (
const auto *CI = dyn_cast<ConstantInt>(V)) {
405 if (CI->getValue().getActiveBits() <= 64)
407 }
else if (isa<AllocaInst>(V))
409 else if (isa<ConstantPointerNull>(V))
414 else if (
const auto *CF = dyn_cast<ConstantFP>(V)) {
415 if (CF->isNullValue())
423 const APFloat &Flt = CF->getValueAPF();
426 APSInt SIntVal(IntBitWidth,
false);
430 unsigned IntegerReg =
437 }
else if (
const auto *
Op = dyn_cast<Operator>(V)) {
439 if (!isa<Instruction>(
Op) ||
443 }
else if (isa<UndefValue>(V)) {
446 TII.
get(TargetOpcode::IMPLICIT_DEF),
Reg);
454 unsigned FastISel::materializeRegForValue(
const Value *V,
MVT VT) {
457 if (isa<Constant>(V))
463 Reg = materializeConstant(V, VT);
486 if (!isa<Instruction>(I)) {
492 if (AssignedReg == 0)
495 else if (Reg != AssignedReg) {
497 for (
unsigned i = 0; i < NumRegs; i++) {
510 return std::pair<unsigned, bool>(0,
false);
517 if (IdxVT.
bitsLT(PtrVT)) {
521 }
else if (IdxVT.
bitsGT(PtrVT)) {
526 return std::pair<unsigned, bool>(IdxN, IdxNIsKill);
546 "Invalid iterator!");
596 if (
const auto *CI = dyn_cast<ConstantInt>(I->
getOperand(0)))
597 if (isa<Instruction>(I) && cast<Instruction>(
I)->isCommutative()) {
620 if (
const auto *CI = dyn_cast<ConstantInt>(I->
getOperand(1))) {
621 uint64_t Imm = CI->getSExtValue();
624 if (ISDOpcode ==
ISD::SDIV && isa<BinaryOperator>(I) &&
631 if (ISDOpcode ==
ISD::UREM && isa<BinaryOperator>(I) &&
654 ISDOpcode, Op0, Op0IsKill, Op1, Op1IsKill);
673 uint64_t TotalOffs = 0;
675 uint64_t MaxOffs = 2048;
679 const Value *Idx = GTI.getOperand();
680 if (
StructType *StTy = GTI.getStructTypeOrNull()) {
681 uint64_t
Field = cast<ConstantInt>(Idx)->getZExtValue();
685 if (TotalOffs >= MaxOffs) {
694 Type *Ty = GTI.getIndexedType();
697 if (
const auto *CI = dyn_cast<ConstantInt>(Idx)) {
701 uint64_t IdxN = CI->getValue().sextOrTrunc(64).getSExtValue();
703 if (TotalOffs >= MaxOffs) {
723 unsigned IdxN = Pair.first;
724 bool IdxNIsKill = Pair.second;
728 if (ElementSize != 1) {
751 const CallInst *CI,
unsigned StartIdx) {
755 if (
const auto *
C = dyn_cast<ConstantInt>(Val)) {
758 }
else if (isa<ConstantPointerNull>(Val)) {
761 }
else if (
auto *AI = dyn_cast<AllocaInst>(Val)) {
784 "Stackmap cannot return a value.");
800 "Expected a constant integer.");
805 "Expected a constant integer.");
806 const auto *NumBytes =
812 if (!addStackMapLiveVars(Ops, I, 2))
821 for (
unsigned i = 0; ScratchRegs[i]; ++i)
823 ScratchRegs[i],
true,
true,
false,
824 false,
false,
true));
830 const MCInstrDesc &MCID = Builder.getInstr()->getDesc();
831 for (
unsigned I = 0,
E = MCID.getNumOperands(); I <
E; ++
I)
836 TII.
get(TargetOpcode::STACKMAP));
837 for (
auto const &MO : Ops)
857 bool FastISel::lowerCallOperands(
const CallInst *CI,
unsigned ArgIdx,
861 Args.reserve(NumArgs);
865 for (
unsigned ArgI = ArgIdx, ArgE = ArgIdx + NumArgs; ArgI != ArgE; ++ArgI) {
873 Entry.setAttributes(&CS, ArgI);
874 Args.push_back(Entry);
890 return setCallee(CC, ResultTy, Sym, std::move(ArgsList), FixedArgs);
907 "Expected a constant integer.");
908 const auto *NumArgsVal =
910 unsigned NumArgs = NumArgsVal->getZExtValue();
916 "Not enough arguments provided to the patchpoint intrinsic");
919 unsigned NumCallArgs = IsAnyRegCC ? 0 : NumArgs;
922 if (!lowerCallOperands(I, NumMetaOpers, NumCallArgs, Callee, IsAnyRegCC, CLI))
925 assert(CLI.
Call &&
"No call instruction specified.");
930 if (IsAnyRegCC && HasDef) {
939 "Expected a constant integer.");
944 "Expected a constant integer.");
945 const auto *NumBytes =
950 if (
const auto *
C = dyn_cast<IntToPtrInst>(Callee)) {
951 uint64_t CalleeConstAddr =
952 cast<ConstantInt>(
C->
getOperand(0))->getZExtValue();
954 }
else if (
const auto *
C = dyn_cast<ConstantExpr>(Callee)) {
955 if (
C->
getOpcode() == Instruction::IntToPtr) {
956 uint64_t CalleeConstAddr =
957 cast<ConstantInt>(
C->
getOperand(0))->getZExtValue();
961 }
else if (
const auto *GV = dyn_cast<GlobalValue>(Callee)) {
963 }
else if (isa<ConstantPointerNull>(Callee))
970 unsigned NumCallRegArgs = IsAnyRegCC ? NumArgs : CLI.
OutRegs.
size();
979 for (
unsigned i = NumMetaOpers, e = NumMetaOpers + NumArgs; i != e; ++i) {
992 if (!addStackMapLiveVars(Ops, I, NumMetaOpers + NumArgs))
1001 for (
unsigned i = 0; ScratchRegs[i]; ++i)
1003 ScratchRegs[i],
true,
true,
false,
1004 false,
false,
true));
1013 TII.
get(TargetOpcode::PATCHPOINT));
1015 for (
auto &MO : Ops)
1042 TII.
get(TargetOpcode::PATCHABLE_EVENT_CALL));
1043 for (
auto &MO : Ops)
1063 TII.
get(TargetOpcode::PATCHABLE_TYPED_EVENT_CALL));
1064 for (
auto &MO : Ops)
1103 Args.reserve(NumArgs);
1107 for (
unsigned ArgI = 0; ArgI != NumArgs; ++ArgI) {
1115 Entry.setAttributes(&CS, ArgI);
1116 Args.push_back(Entry);
1121 CLI.
setCallee(RetTy, FTy, Symbol, std::move(Args), CS, NumArgs);
1139 if (!CanLowerReturn)
1142 for (
unsigned I = 0,
E = RetTys.
size();
I !=
E; ++
I) {
1146 for (
unsigned i = 0; i != NumRegs; ++i) {
1148 MyFlags.
VT = RegisterVT;
1157 CLI.
Ins.push_back(MyFlags);
1166 FinalType = cast<PointerType>(
Arg.Ty)->getElementType();
1179 if (
Arg.IsSwiftSelf)
1181 if (
Arg.IsSwiftError)
1185 if (
Arg.IsInAlloca) {
1194 if (
Arg.IsByVal ||
Arg.IsInAlloca) {
1200 unsigned FrameAlign =
Arg.Alignment;
1221 assert(CLI.
Call &&
"No call instruction specified.");
1253 Args.push_back(Entry);
1264 .setTailCall(IsTailCall);
1270 const CallInst *Call = cast<CallInst>(
I);
1276 if (IA->hasSideEffects())
1277 flushLocalValueMap();
1280 if (!IA->getConstraintString().empty())
1283 unsigned ExtraInfo = 0;
1284 if (IA->hasSideEffects())
1286 if (IA->isAlignStack())
1291 .addExternalSymbol(IA->getAsmString().c_str())
1300 if (
const auto *II = dyn_cast<IntrinsicInst>(Call))
1310 flushLocalValueMap();
1320 case Intrinsic::lifetime_start:
1321 case Intrinsic::lifetime_end:
1323 case Intrinsic::donothing:
1325 case Intrinsic::sideeffect:
1327 case Intrinsic::assume:
1329 case Intrinsic::dbg_declare: {
1338 if (!Address || isa<UndefValue>(Address)) {
1366 (!isa<AllocaInst>(Address) ||
1373 "Expected inlined-at fields to agree");
1377 TII.
get(TargetOpcode::DBG_VALUE),
true,
1386 case Intrinsic::dbg_value: {
1392 "Expected inlined-at fields to agree");
1398 }
else if (
const auto *CI = dyn_cast<ConstantInt>(V)) {
1399 if (CI->getBitWidth() > 64)
1407 .
addImm(CI->getZExtValue())
1411 }
else if (
const auto *CF = dyn_cast<ConstantFP>(V)) {
1419 bool IsIndirect =
false;
1429 case Intrinsic::objectsize: {
1431 unsigned long long Res = CI->
isZero() ? -1ULL : 0;
1439 case Intrinsic::launder_invariant_group:
1440 case Intrinsic::strip_invariant_group:
1441 case Intrinsic::expect: {
1448 case Intrinsic::experimental_stackmap:
1450 case Intrinsic::experimental_patchpoint_void:
1451 case Intrinsic::experimental_patchpoint_i64:
1454 case Intrinsic::xray_customevent:
1456 case Intrinsic::xray_typedevent:
1488 Opcode, InputReg, InputRegIsKill);
1522 unsigned ResultReg = 0;
1523 if (SrcVT == DstVT) {
1527 if (SrcClass == DstClass) {
1530 TII.
get(TargetOpcode::COPY), ResultReg).addReg(Op0);
1547 void FastISel::removeDeadLocalValueCode(
MachineInstr *SavedLastLocalValue)
1550 if (CurLastLocalValue != SavedLastLocalValue) {
1555 if (SavedLastLocalValue)
1568 if (isa<TerminatorInst>(I)) {
1569 if (!handlePHINodesInSuccessorBlocks(I->
getParent())) {
1574 removeDeadLocalValueCode(SavedLastLocalValue);
1581 for (
unsigned i = 0, e = CS.getNumOperandBundles(); i != e; ++i)
1589 if (
const auto *Call = dyn_cast<CallInst>(I)) {
1590 const Function *
F = Call->getCalledFunction();
1602 Call->hasFnAttr(
"trap-func-name"))
1609 ++NumFastIselSuccessIndependent;
1621 ++NumFastIselSuccessTarget;
1632 if (isa<TerminatorInst>(I)) {
1635 removeDeadLocalValueCode(SavedLastLocalValue);
1669 if (TrueMBB != FalseMBB) {
1691 OpReg, OpRegIsKill);
1717 IntResultReg,
true);
1746 ResultReg = I->second;
1747 else if (isa<Instruction>(Op0))
1758 for (
unsigned i = 0; i < VTIndex; i++)
1769 case Instruction::FAdd:
1771 case Instruction::Sub:
1773 case Instruction::FSub:
1778 case Instruction::Mul:
1780 case Instruction::FMul:
1782 case Instruction::SDiv:
1784 case Instruction::UDiv:
1786 case Instruction::FDiv:
1788 case Instruction::SRem:
1790 case Instruction::URem:
1792 case Instruction::FRem:
1794 case Instruction::Shl:
1796 case Instruction::LShr:
1798 case Instruction::AShr:
1800 case Instruction::And:
1802 case Instruction::Or:
1804 case Instruction::Xor:
1807 case Instruction::GetElementPtr:
1810 case Instruction::Br: {
1825 case Instruction::Unreachable:
1831 case Instruction::Alloca:
1842 case Instruction::BitCast:
1845 case Instruction::FPToSI:
1847 case Instruction::ZExt:
1849 case Instruction::SExt:
1851 case Instruction::Trunc:
1853 case Instruction::SIToFP:
1856 case Instruction::IntToPtr:
1857 case Instruction::PtrToInt: {
1871 case Instruction::ExtractValue:
1874 case Instruction::PHI:
1886 : FuncInfo(FuncInfo),
MF(FuncInfo.
MF),
MRI(FuncInfo.
MF->getRegInfo()),
1887 MFI(FuncInfo.
MF->getFrameInfo()),
MCP(*FuncInfo.
MF->getConstantPool()),
1888 TM(FuncInfo.
MF->getTarget()),
DL(
MF->getDataLayout()),
1889 TII(*
MF->getSubtarget().getInstrInfo()),
1890 TLI(*
MF->getSubtarget().getTargetLowering()),
1891 TRI(*
MF->getSubtarget().getRegisterInfo()), LibInfo(LibInfo),
1892 SkipTargetIndependentISel(SkipTargetIndependentISel) {}
1936 bool Op0IsKill, uint64_t Imm,
MVT ImmType) {
1954 unsigned ResultReg =
fastEmit_ri(VT, VT, Opcode, Op0, Op0IsKill, Imm);
1958 bool IsImmKill =
true;
1975 return fastEmit_rr(VT, VT, Opcode, Op0, Op0IsKill, MaterialReg, IsImmKill);
1992 TII.
get(TargetOpcode::COPY), NewOp).addReg(Op);
2031 bool Op0IsKill,
unsigned Op1,
2055 bool Op0IsKill,
unsigned Op1,
2056 bool Op1IsKill,
unsigned Op2,
2083 bool Op0IsKill, uint64_t Imm) {
2105 bool Op0IsKill, uint64_t Imm1,
2149 bool Op0IsKill,
unsigned Op1,
2150 bool Op1IsKill, uint64_t Imm) {
2193 "Cannot yet extract from physregs");
2213 bool FastISel::handlePHINodesInSuccessorBlocks(
const BasicBlock *LLVMBB) {
2223 if (!isa<PHINode>(SuccBB->
begin()))
2229 if (!SuccsHandled.
insert(SuccMBB).second)
2257 const Value *PHIOp = PN.getIncomingValueForBlock(LLVMBB);
2261 DbgLoc = PN.getDebugLoc();
2262 if (
const auto *Inst = dyn_cast<Instruction>(PHIOp))
2263 DbgLoc = Inst->getDebugLoc();
2280 "tryToFoldLoad expected a LoadInst with a single use");
2284 unsigned MaxUsers = 6;
2287 while (TheUser != FoldInst &&
2300 if (TheUser != FoldInst)
2336 if (!isa<AddOperator>(Add))
2343 if (isa<Instruction>(Add) &&
2347 return isa<ConstantInt>(cast<AddOperator>(
Add)->getOperand(1));
2358 if (
const auto *LI = dyn_cast<LoadInst>(I)) {
2359 Alignment = LI->getAlignment();
2360 IsVolatile = LI->isVolatile();
2362 Ptr = LI->getPointerOperand();
2363 ValTy = LI->getType();
2364 }
else if (
const auto *
SI = dyn_cast<StoreInst>(I)) {
2365 Alignment =
SI->getAlignment();
2366 IsVolatile =
SI->isVolatile();
2368 Ptr =
SI->getPointerOperand();
2369 ValTy =
SI->getValueOperand()->getType();
2375 bool IsDereferenceable =
2391 if (IsDereferenceable)
2397 Alignment, AAInfo, Ranges);
2406 switch (Predicate) {
void setHasStackMap(bool s=true)
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
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...
const MachineInstrBuilder & addMetadata(const MDNode *MD) const
void setByValAlign(unsigned A)
void push_back(const T &Elt)
const MachineInstrBuilder & add(const MachineOperand &MO) const
A parsed version of the target data layout string in and methods for querying it. ...
Function * getCalledFunction() const
Return the function called, or null if this is an indirect function invocation.
This class is the base class for the comparison instructions.
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...
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
bool hasLocalLinkage() const
bool use_nodbg_empty(unsigned RegNo) const
use_nodbg_empty - Return true if there are no non-Debug instructions using the specified register...
MachineConstantPool & MCP
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents an incoming formal argument to a Function.
instr_iterator instr_end()
bool lowerCall(const CallInst *I)
unsigned arg_size() const
static const Value * getFNegArgument(const Value *BinOp)
bool hasDebugInfo() const
Returns true if valid debug info is present.
CallingConv::ID getCallingConv() const
Get the calling convention of the call.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
Compute iterated dominance frontiers using a linear time algorithm.
unsigned OrigNumPHINodesToUpdate
virtual unsigned fastMaterializeConstant(const Constant *C)
Emit a constant in a register using target-specific logic, such as constant pool loads.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
BasicBlock * getSuccessor(unsigned idx) const
Return the specified successor.
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
bool selectXRayTypedEvent(const CallInst *II)
bool selectGetElementPtr(const User *I)
void leaveLocalValueArea(SavePoint Old)
Reset InsertPt to the given old insert position.
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
Describe properties that are true of each instruction in the target description file.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
bool selectStackmap(const CallInst *I)
This class represents a function call, abstracting a target machine's calling convention.
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 ...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
gep_type_iterator gep_type_end(const User *GEP)
virtual unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const
Insert branch code into the end of the specified MachineBasicBlock.
0 1 0 0 True if ordered and less than
MachineMemOperand * createMachineMemOperandFor(const Instruction *I) const
Create a machine mem operand from the given instruction.
LLVMContext & getContext() const
All values hold a context through their type.
virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC, ArgListTy &Args) const
1 1 1 0 True if unordered or not equal
void addSuccessorWithoutProb(MachineBasicBlock *Succ)
Add Succ as a successor of this MachineBasicBlock.
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 a...
BasicBlock * getSuccessor(unsigned i) const
void setInConsecutiveRegs()
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
STATISTIC(NumFunctions, "Total number of functions")
MachineModuleInfo & getMMI() const
SmallVector< unsigned, 4 > InRegs
unsigned getCallFrameDestroyOpcode() const
An instruction for reading from memory.
CallingConv::ID getCallingConv() const
getCallingConv/setCallingConv - Get or set the calling convention of this function call...
bool CanLowerReturn
CanLowerReturn - true iff the function's return value can be lowered to registers.
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...
iterator_range< mop_iterator > operands()
virtual unsigned fastMaterializeFloatZero(const ConstantFP *CF)
Emit the floating-point constant +0.0 in a register using target- specific logic. ...
void setPhysRegsDeadExcept(ArrayRef< unsigned > UsedRegs, const TargetRegisterInfo &TRI)
Mark every physreg used by this instruction as dead except those in the UsedRegs list.
virtual unsigned getByValTypeAlignment(Type *Ty, const DataLayout &DL) const
Return the desired alignment for ByVal or InAlloca aggregate function arguments in the caller paramet...
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
void computeUsesVAFloatArgument(const CallInst &I, MachineModuleInfo &MMI)
Determine if any floating-point values are being passed to this variadic function, and set the MachineModuleInfo's usesVAFloatArgument flag if so.
virtual bool fastLowerCall(CallLoweringInfo &CLI)
This method is called by target-independent code to do target- specific call lowering.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
iterator begin()
Instruction iterator methods.
bool selectInstruction(const Instruction *I)
Do "fast" instruction selection for the given LLVM IR instruction and append the generated machine in...
MVT getRegisterType(MVT VT) const
Return the type of registers that this ValueType will eventually require.
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.
opStatus convertToInteger(MutableArrayRef< integerPart > Input, unsigned int Width, bool IsSigned, roundingMode RM, bool *IsExact) const
1 0 0 1 True if unordered or equal
DenseMap< const Value *, unsigned > LocalValueMap
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 registe...
void setLastLocalValue(MachineInstr *I)
Update the position of the last instruction emitted for materializing constants for use in the curren...
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
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 regi...
CmpInst::Predicate optimizeCmpPredicate(const CmpInst *CI) const
bool isVolatile() const
Return true if this is a load from a volatile memory location.
A description of a memory reference used in the backend.
void setHasPatchPoint(bool s=true)
TargetLoweringBase::ArgListTy ArgListTy
Shift and rotation operations.
const TargetRegisterClass * getRegClass(const MCInstrDesc &MCID, unsigned OpNum, const TargetRegisterInfo *TRI, const MachineFunction &MF) const
Given a machine instruction descriptor, returns the register class constraint for OpNum...
Class to represent struct types.
A Use represents the edge between a Value definition and its users.
bool canFoldAddIntoGEP(const User *GEP, const Value *Add)
Check if Add is an add that can be safely folded into GEP.
DenseMap< const Value *, unsigned > ValueMap
ValueMap - Since we emit code for the function a basic block at a time, we must remember which virtua...
MachineBasicBlock iterator that automatically skips over MIs that are inside bundles (i...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
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...
MachineInstr * EmitStartPt
The top most instruction in the current block that is allowed for emitting local variables.
0 1 0 1 True if ordered and less than or equal
This file contains the simple types necessary to represent the attributes associated with functions a...
InstrTy * getInstruction() const
The memory access is dereferenceable (i.e., doesn't trap).
static MachineOperand CreateRegMask(const uint32_t *Mask)
CreateRegMask - Creates a register mask operand referencing Mask.
virtual const TargetRegisterClass * getSubClassWithSubReg(const TargetRegisterClass *RC, unsigned Idx) const
Returns the largest legal sub-class of RC that supports the sub-register index Idx.
void setByValSize(unsigned S)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
MachineBasicBlock::iterator LastFlushPoint
Last local value flush point.
INLINEASM - Represents an inline asm block.
bool selectIntrinsicCall(const IntrinsicInst *II)
bool selectCast(const User *I, unsigned Opcode)
unsigned getSizeInBits() const
MachineInstr * getVRegDef(unsigned Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
Context object for machine code objects.
int getArgumentFrameIndex(const Argument *A)
getArgumentFrameIndex - Get frame index for the byval argument.
Class to represent function types.
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
SmallVector< ISD::InputArg, 4 > Ins
Type * getType() const
All values are typed, get the type of this value.
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.
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
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.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
bool selectExtractValue(const User *U)
unsigned getRegForValue(const Value *V)
Create a virtual register and arrange for it to be assigned the value for the given LLVM value...
Simple integer binary arithmetic operators.
DenseSet< unsigned > RegsWithFixups
unsigned fastEmitInst_(unsigned MachineInstOpcode, const TargetRegisterClass *RC)
Emit a MachineInstr with no operands and a result register in the given register class.
const MachineInstrBuilder & addFPImm(const ConstantFP *Val) const
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
bool hasTrivialKill(const Value *V)
Test whether the given value has exactly one use.
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
void setOrigAlign(unsigned A)
amdgpu Simplify well known AMD library false Value * Callee
MachineInstr * getLastLocalValue()
Return the position of the last instruction emitted for materializing constants for use in the curren...
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
const TargetRegisterClass * constrainRegClass(unsigned Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
Value * getOperand(unsigned i) const
Class to represent pointers.
unsigned getKillRegState(bool B)
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
unsigned lookUpRegForValue(const Value *V)
Look up the value to see if its value is already cached in a register.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
void finishBasicBlock()
Flush the local value map and sink local values if possible.
iterator find(const_arg_type_t< KeyT > Val)
Value * getOperand(unsigned i_nocapture) const
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
MCContext & getContext() const
void setAttributes(ImmutableCallSite *CS, unsigned ArgIdx)
Set CallLoweringInfo attribute flags based on a call instruction and called function attributes...
bool isVoidTy() const
Return true if this is 'void'.
The memory access is volatile.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
void getAAMetadata(AAMDNodes &N, bool Merge=false) const
Fills the AAMDNodes structure with AA metadata from this instruction.
initializer< Ty > init(const Ty &Val)
virtual const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const
Return a mask of call-preserved registers for the given calling convention on the current function...
Type * getReturnType() const
Returns the type of the ret val.
Subclasses of this class are all able to terminate a basic block.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
std::vector< std::pair< MachineInstr *, unsigned > > PHINodesToUpdate
PHINodesToUpdate - A list of phi instructions whose operand list will be updated after processing the...
CallLoweringInfo & setCallee(Type *ResultTy, FunctionType *FuncTy, const Value *Target, ArgListTy &&ArgsList, ImmutableCallSite &Call)
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
LLVM Basic Block Representation.
const MachineInstrBuilder & addCImm(const ConstantInt *Val) const
The instances of the Type class are immutable: once they are created, they are never changed...
Simple binary floating point operators.
Conditional or Unconditional Branch instruction.
Value * getAddress() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
void removeDeadCode(MachineBasicBlock::iterator I, MachineBasicBlock::iterator E)
Remove all dead instructions between the I and E.
SmallVector< ISD::ArgFlagsTy, 16 > OutFlags
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< iterator, bool > insert(const ValueT &V)
ConstantFP - Floating Point Values [float, double].
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
const MCPhysReg * ImplicitDefs
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...
bool SkipTargetIndependentISel
bool isValidLocationForIntrinsic(const DILocation *DL) const
Check that a location is valid for this variable.
unsigned getCallFrameSetupOpcode() const
These methods return the opcode of the frame setup/destroy instructions if they exist (-1 otherwise)...
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
This file declares a class to represent arbitrary precision floating point values and provide a varie...
static Type * getVoidTy(LLVMContext &C)
DILocalVariable * getVariable() const
bool tryToFoldLoad(const LoadInst *LI, const Instruction *FoldInst)
We're checking to see if we can fold LI into FoldInst.
bool lowerArguments()
Do "fast" instruction selection for function arguments and append the machine instructions to the cur...
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
std::pair< unsigned, bool > getRegForGEPIndex(const Value *Idx)
This is a wrapper around getRegForValue that also takes care of truncating or sign-extending the give...
static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, unsigned char TargetFlags=0)
TRAP - Trapping instruction.
bool isValid() const
Check for null.
const Triple & getTargetTriple() const
DIExpression * getExpression() const
0 1 1 1 True if ordered (no nans)
self_iterator getIterator()
The memory access is non-temporal.
Class to represent integer types.
bool selectXRayCustomEvent(const CallInst *II)
const TargetRegisterInfo & TRI
1 1 1 1 Always true (always folded)
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
static unsigned findSinkableLocalRegDef(MachineInstr &MI)
Return the defined register if this instruction defines exactly one virtual register and uses no othe...
virtual bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg) const
For some targets, an LLVM struct type must be broken down into multiple simple types, but the calling convention specifies that the entire struct must be passed in a block of consecutive registers.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
bool selectFNeg(const User *I)
Emit an FNeg operation.
This class contains a discriminated union of information about pointers in memory operands...
1 1 0 1 True if unordered, less than, or equal
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
SmallVector< Value *, 16 > OutVals
static AttributeList getReturnAttrs(FastISel::CallLoweringInfo &CLI)
Returns an AttributeList representing the attributes applied to the return value of the given call...
const TargetInstrInfo & TII
MachineBasicBlock * MBB
MBB - The current block.
bool isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM)
Test if the given instruction is in a position to be optimized with a tail-call.
Triple - Helper class for working with autoconf configuration names.
MachineInstr * LastLocalValue
The position of the last instruction for materializing constants for use in the current block...
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
BranchProbability getEdgeProbability(const BasicBlock *Src, unsigned IndexInSuccessors) const
Get an edge's probability, relative to other out-edges of the Src.
virtual const MCPhysReg * getScratchRegisters(CallingConv::ID CC) const
Returns a 0 terminated array of registers that can be safely used as scratch registers.
void recomputeInsertPt()
Reset InsertPt to prepare for inserting instructions into the current block.
The memory access writes data.
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
void GetReturnInfo(CallingConv::ID CC, Type *ReturnType, AttributeList attr, SmallVectorImpl< ISD::OutputArg > &Outs, const TargetLowering &TLI, const DataLayout &DL)
Given an LLVM IR type and return type attributes, compute the return value EVTs and flags...
0 0 1 0 True if ordered and greater than
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
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...
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
This is the shared class of boolean and integer constants.
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...
DenseMap< unsigned, unsigned > RegFixups
RegFixups - Registers which need to be replaced after isel is done.
MachineOperand class - Representation of each machine instruction operand.
1 1 0 0 True if unordered or less than
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool selectCall(const User *I)
Instruction * user_back()
Specialize the methods defined in Value, as we know that an instruction can only be used by other ins...
Provides information about what library functions are available for the current target.
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
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 ...
const TargetLibraryInfo * LibInfo
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
bool isOSLinux() const
Tests whether the OS is Linux.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
reg_iterator reg_begin(unsigned RegNo) const
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...
bool hasOptimizedCodeGen(LibFunc F) const
Tests if the function is both available and a candidate for optimized code generation.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
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 ...
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
MachineInstr * remove(MachineInstr *I)
Remove the unbundled instruction from the instruction list without deleting it.
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
void startNewBlock()
Set the current block to which generated machine instructions will be appended.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool selectBitCast(const User *I)
Target - Wrapper for Target specific information.
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
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...
SmallVector< unsigned, 16 > OutRegs
bool selectBinaryOp(const User *I, unsigned ISDOpcode)
Select and emit code for a binary operator instruction, which has an opcode which directly correspond...
void setDebugLoc(DebugLoc dl)
Replace current source information with new such.
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringRef > StandardNames)
Initialize the set of available library functions based on the specified target triple.
BranchProbabilityInfo * BPI
This file defines the FastISel class.
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
bool getLibFunc(StringRef funcName, LibFunc &F) const
Searches for a particular function name.
bool use_empty(unsigned RegNo) const
use_empty - Return true if there are no instructions using the specified register.
Flags
Flags values. These may be or'd together.
amdgpu Simplify well known AMD library false Value Value * Arg
const MachineBasicBlock * getParent() const
The memory access reads data.
uint64_t getTypeSizeInBits(Type *Ty) const
Size examples:
SavePoint enterLocalValueArea()
Prepare InsertPt to begin inserting instructions into the local value area and return the old insert ...
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
Representation of each machine instruction.
Predicate getPredicate() const
Return the predicate for this instruction.
virtual bool fastLowerIntrinsicCall(const IntrinsicInst *II)
This method is called by target-independent code to do target- specific intrinsic lowering...
unsigned getOperandNo() const
getOperandNo - Return the operand # of this MachineOperand in its MachineInstr.
bool selectPatchpoint(const CallInst *I)
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Bitwise operators - logical and, logical or, logical xor.
MachineRegisterInfo & MRI
bool hasOneUse(unsigned RegNo) const
hasOneUse - Return true if there is exactly one instruction using the specified register.
uint64_t getElementOffset(unsigned Idx) const
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
unsigned getNumArgOperands() const
Return the number of call arguments.
unsigned greater or equal
This represents the llvm.dbg.value instruction.
bool lowerCallTo(const CallInst *CI, MCSymbol *Symbol, unsigned NumArgs)
static bool isFNeg(const Value *V, bool IgnoreZeroSign=false)
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
StringRef getName() const
Return a constant reference to the value's name.
Establish a view to a call site for examination.
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 clas...
static MachineOperand CreateImm(int64_t Val)
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
The memory access always returns the same value (or traps).
virtual unsigned fastMaterializeAlloca(const AllocaInst *C)
Emit an alloca address in a register using target-specific logic.
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
static bool isRegUsedByPhiNodes(unsigned DefReg, FunctionLoweringInfo &FuncInfo)
0 1 1 0 True if ordered and operands are unequal
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
MachineBasicBlock::iterator InsertPt
MBB - The current insert position inside the current block.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
iterator_range< const_phi_iterator > phis() const
Returns a range that iterates over the phis in the basic block.
iterator getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
bool isUnconditional() const
DenseMap< const AllocaInst *, int > StaticAllocaMap
StaticAllocaMap - Keep track of frame indices for fixed sized allocas in the entry block...
1 0 1 0 True if unordered or greater than
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
LLVM_NODISCARD bool empty() const
Type * getType() const
Return the type of the instruction that generated this call site.
const TargetLowering & TLI
unsigned createResultReg(const TargetRegisterClass *RC)
CallLoweringInfo & setIsPatchPoint(bool Value=true)
unsigned fastEmit_ri_(MVT VT, unsigned Opcode, unsigned Op0, bool Op0IsKill, uint64_t Imm, MVT ImmType)
This method is a wrapper of fastEmit_ri.
iterator_range< use_instr_iterator > use_instructions(unsigned Reg) const
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 ty...
MachineBasicBlock::iterator InsertPt
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
user_iterator user_begin()
unsigned getNumSuccessors() const
Return the number of successors that this terminator has.
FastISel(FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo, bool SkipTargetIndependentISel=false)
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
virtual bool CanLowerReturn(CallingConv::ID, MachineFunction &, bool, const SmallVectorImpl< ISD::OutputArg > &, LLVMContext &) const
This hook should be implemented to check whether the return values described by the Outs array can fi...
virtual bool fastLowerArguments()
This method is called by target-independent code to do target- specific argument lowering.
0 0 0 1 True if ordered and equal
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
FunctionType * getFunctionType() const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static const Function * getParent(const Value *V)
const Value * getCalledValue() const
Get a pointer to the function that is invoked by this instruction.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
DenseMap< const BasicBlock *, MachineBasicBlock * > MBBMap
MBBMap - A mapping from LLVM basic blocks to their machine code entry.
bool hasOneUse() const
Return true if there is exactly one user of this value.
void fastEmitBranch(MachineBasicBlock *MSucc, const DebugLoc &DbgLoc)
Emit an unconditional branch to the given block, unless it is the immediate (fall-through) successor...
StringRef - Represent a constant reference to a string, i.e.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
virtual bool fastSelectInstruction(const Instruction *I)=0
This method is called by target-independent code when the normal FastISel process fails to select an ...
static cl::opt< bool > SinkLocalValues("fast-isel-sink-local-values", cl::init(true), cl::Hidden, cl::desc("Sink local values in FastISel"))
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 clas...
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty...
const TerminatorInst * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
FunctionLoweringInfo & FuncInfo
const Value * stripInBoundsConstantOffsets() const
Strip off pointer casts and all-constant inbounds GEPs.
TRUNCATE - Completely drop the high bits.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
iterator_range< use_instr_nodbg_iterator > use_nodbg_instructions(unsigned Reg) const
0 0 1 1 True if ordered and greater than or equal
unsigned ComputeLinearIndex(Type *Ty, const unsigned *Indices, const unsigned *IndicesEnd, unsigned CurIndex=0)
Compute the linearized index of a member in a nested aggregate/struct/array.
reg_begin/reg_end - Provide iteration support to walk over all definitions and uses of a register wit...
This represents the llvm.dbg.declare instruction.
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
static MachineOperand CreateFI(int Idx)
bool isSafeToMove(AliasAnalysis *AA, bool &SawStore) const
Return true if it is safe to move this instruction.
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Type * getElementType() const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
static AttributeList get(LLVMContext &C, ArrayRef< std::pair< unsigned, Attribute >> Attrs)
Create an AttributeList with the specified parameters in it.
0 0 0 0 Always false (always folded)
A wrapper class for inspecting calls to intrinsic functions.
This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.
const BasicBlock * getParent() const
unsigned InitializeRegForValue(const Value *V)
gep_type_iterator gep_type_begin(const User *GEP)