LLVM: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
14#define LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
15
34#include
35#include
36#include
37#include
38#include
39#include
40
41namespace llvm {
42
91
92
93
94
95
97
99
101
102
103
105
106
107 class DanglingDebugInfo {
108 unsigned SDNodeOrder = 0;
109
110 public:
114 DanglingDebugInfo() = default;
116 unsigned SDNO)
117 : SDNodeOrder(SDNO), Variable(Var), Expression(Expr),
118 dl(std::move(DL)) {}
119
120 DILocalVariable *getVariable() const { return Variable; }
123 unsigned getSDNodeOrder() const { return SDNodeOrder; }
124
125
126
127
131 const DanglingDebugInfo &DDI;
134 OS << "DDI(var=" << *P.DDI.getVariable();
135 if (P.V)
136 OS << ", val=" << *P.V;
137 else
138 OS << ", val=nullptr";
139
140 OS << ", expr=" << *P.DDI.getExpression()
141 << ", order=" << P.DDI.getSDNodeOrder()
142 << ", loc=" << P.DDI.getDebugLoc() << ")";
143 return OS;
144 }
145 };
146 };
147
148
149
150
151 DanglingDebugInfo::Print printDDI(const Value *V,
152 const DanglingDebugInfo &DDI) {
153 return DanglingDebugInfo::Print(V, DDI);
154 }
155
156
157 typedef std::vector DanglingDebugInfoVector;
158
159
160
161 MapVector<const Value*, DanglingDebugInfoVector> DanglingDebugInfoMap;
162
163
164
165 bool AssignmentTrackingEnabled = false;
166
167public:
168
169
170
172
173
174
176
177private:
178
179
180
181
183
184
185
186
187
188
189
190
191
194
195
197
198
199
200
202
203
204
205 unsigned SDNodeOrder;
206
207
211
212
216
217
219 peelDominantCaseCluster(const SwitchInst &SI,
222
223private:
225
226public:
227
228
230
236
238 public:
241
245 SDB->addSuccessorWithProb(Src, Dst, Prob);
246 }
247
248 private:
250 };
251
252
253
255
256
257
259
260
261
263
264
266
267
269
270
272
273
275
276
277
279
281
287
290
291
292
293
294
295
297
298
299
300
301
303
304
305
306
308
309
310
311
312
313
315
316
317
318
319
321
322
323
324
326
328 return SDLoc(CurInst, SDNodeOrder);
329 }
330
332 return CurInst ? CurInst->getDebugLoc() : DebugLoc();
333 }
334
337
340
341 void visit(unsigned Opcode, const User &I);
342
343
344
346
347
350 bool IsVariadic, DebugLoc DL, unsigned Order);
351
352
353
354
357
358
359
361
362
363
364
366
367
368
371 bool IsVariadic);
372
373
375 DebugLoc DbgLoc, unsigned Order);
376
379
380
382
384
387
390 assert(.getNode() && "Already set a value for this node!");
391 N = NewN;
392 }
393
395 SDValue &N = UnusedArgNodeMap[V];
396 assert(.getNode() && "Already set a value for this node!");
397 N = NewN;
398 }
399
404
415 bool InvertCond);
421 bool IsMustTailCall, const BasicBlock *EHPadBB = nullptr,
423
424
425
427
428
429
432
433
436
439 unsigned NumArgs, SDValue Callee,
441 bool IsPatchPoint);
442
443 std::pair<SDValue, SDValue>
445 const BasicBlock *EHPadBB = nullptr);
446
447
448
450
451
452
454
455
458
459
461
462
464
465
467
468
469
471
472
474
475
477
478
479
481
482
484
485
487
488
489
491
493 };
494
495
497
498
499
501 const BasicBlock *EHPadBB = nullptr);
502
505
508
511 bool VarArgDisallowed,
512 bool ForceVoidReturnTy);
513
516
517
519 return DAG.getTargetLoweringInfo().getFrameIndexTy(DAG.getDataLayout());
520 }
521
522private:
523
534
537 void addSuccessorWithProb(
540
541public:
555
556private:
557
559 void visitCallBrLandingPad(const CallInst &I);
561
563 void visitCallBrIntrinsic(const CallBrInst &I);
564
565 void visitUnary(const User &I, unsigned Opcode);
566 void visitFNeg(const User &I) { visitUnary(I, ISD::FNEG); }
567
568 void visitBinary(const User &I, unsigned Opcode);
569 void visitShift(const User &I, unsigned Opcode);
570 void visitAdd(const User &I) { visitBinary(I, ISD::ADD); }
571 void visitFAdd(const User &I) { visitBinary(I, ISD::FADD); }
572 void visitSub(const User &I) { visitBinary(I, ISD::SUB); }
573 void visitFSub(const User &I) { visitBinary(I, ISD::FSUB); }
574 void visitMul(const User &I) { visitBinary(I, ISD::MUL); }
575 void visitFMul(const User &I) { visitBinary(I, ISD::FMUL); }
576 void visitURem(const User &I) { visitBinary(I, ISD::UREM); }
577 void visitSRem(const User &I) { visitBinary(I, ISD::SREM); }
578 void visitFRem(const User &I) { visitBinary(I, ISD::FREM); }
579 void visitUDiv(const User &I) { visitBinary(I, ISD::UDIV); }
580 void visitSDiv(const User &I);
581 void visitFDiv(const User &I) { visitBinary(I, ISD::FDIV); }
582 void visitAnd (const User &I) { visitBinary(I, ISD::AND); }
583 void visitOr (const User &I) { visitBinary(I, ISD::OR); }
584 void visitXor (const User &I) { visitBinary(I, ISD::XOR); }
585 void visitShl (const User &I) { visitShift(I, ISD::SHL); }
586 void visitLShr(const User &I) { visitShift(I, ISD::SRL); }
587 void visitAShr(const User &I) { visitShift(I, ISD::SRA); }
588 void visitICmp(const ICmpInst &I);
589 void visitFCmp(const FCmpInst &I);
590
591 void visitTrunc(const User &I);
592 void visitZExt(const User &I);
593 void visitSExt(const User &I);
594 void visitFPTrunc(const User &I);
595 void visitFPExt(const User &I);
596 void visitFPToUI(const User &I);
597 void visitFPToSI(const User &I);
598 void visitUIToFP(const User &I);
599 void visitSIToFP(const User &I);
600 void visitPtrToAddr(const User &I);
601 void visitPtrToInt(const User &I);
602 void visitIntToPtr(const User &I);
603 void visitBitCast(const User &I);
604 void visitAddrSpaceCast(const User &I);
605
606 void visitExtractElement(const User &I);
607 void visitInsertElement(const User &I);
608 void visitShuffleVector(const User &I);
609
610 void visitExtractValue(const ExtractValueInst &I);
611 void visitInsertValue(const InsertValueInst &I);
612 void visitLandingPad(const LandingPadInst &LP);
613
614 void visitGetElementPtr(const User &I);
615 void visitSelect(const User &I);
616
617 void visitAlloca(const AllocaInst &I);
618 void visitLoad(const LoadInst &I);
619 void visitStore(const StoreInst &I);
620 void visitMaskedLoad(const CallInst &I, bool IsExpanding = false);
621 void visitMaskedStore(const CallInst &I, bool IsCompressing = false);
622 void visitMaskedGather(const CallInst &I);
623 void visitMaskedScatter(const CallInst &I);
624 void visitAtomicCmpXchg(const AtomicCmpXchgInst &I);
625 void visitAtomicRMW(const AtomicRMWInst &I);
626 void visitFence(const FenceInst &I);
627 void visitPHI(const PHINode &I);
628 void visitCall(const CallInst &I);
629 bool visitMemCmpBCmpCall(const CallInst &I);
630 bool visitMemPCpyCall(const CallInst &I);
631 bool visitMemChrCall(const CallInst &I);
632 bool visitStrCpyCall(const CallInst &I, bool isStpcpy);
633 bool visitStrCmpCall(const CallInst &I);
634 bool visitStrLenCall(const CallInst &I);
635 bool visitStrNLenCall(const CallInst &I);
636 bool visitUnaryFloatCall(const CallInst &I, unsigned Opcode);
637 bool visitBinaryFloatCall(const CallInst &I, unsigned Opcode);
638 void visitAtomicLoad(const LoadInst &I);
639 void visitAtomicStore(const StoreInst &I);
640 void visitLoadFromSwiftError(const LoadInst &I);
641 void visitStoreToSwiftError(const StoreInst &I);
642 void visitFreeze(const FreezeInst &I);
643
644 void visitInlineAsm(const CallBase &Call,
645 const BasicBlock *EHPadBB = nullptr);
646
648 DILocalVariable *Variable, DIExpression *Expr,
650 void visitIntrinsicCall(const CallInst &I, unsigned Intrinsic);
651 void visitTargetIntrinsic(const CallInst &I, unsigned Intrinsic);
652 void visitConstrainedFPIntrinsic(const ConstrainedFPIntrinsic &FPI);
653 void visitConvergenceControl(const CallInst &I, unsigned Intrinsic);
654 void visitVectorHistogram(const CallInst &I, unsigned IntrinsicID);
655 void visitVectorExtractLastActive(const CallInst &I, unsigned Intrinsic);
656 void visitVPLoad(const VPIntrinsic &VPIntrin, EVT VT,
657 const SmallVectorImpl &OpValues);
658 void visitVPLoadFF(const VPIntrinsic &VPIntrin, EVT VT, EVT EVLVT,
659 const SmallVectorImpl &OpValues);
660 void visitVPStore(const VPIntrinsic &VPIntrin,
661 const SmallVectorImpl &OpValues);
662 void visitVPGather(const VPIntrinsic &VPIntrin, EVT VT,
663 const SmallVectorImpl &OpValues);
664 void visitVPScatter(const VPIntrinsic &VPIntrin,
665 const SmallVectorImpl &OpValues);
666 void visitVPStridedLoad(const VPIntrinsic &VPIntrin, EVT VT,
667 const SmallVectorImpl &OpValues);
668 void visitVPStridedStore(const VPIntrinsic &VPIntrin,
669 const SmallVectorImpl &OpValues);
670 void visitVPCmp(const VPCmpIntrinsic &VPIntrin);
671 void visitVectorPredicationIntrinsic(const VPIntrinsic &VPIntrin);
672
673 void visitVAStart(const CallInst &I);
674 void visitVAArg(const VAArgInst &I);
675 void visitVAEnd(const CallInst &I);
676 void visitVACopy(const CallInst &I);
677 void visitStackmap(const CallInst &I);
678 void visitPatchpoint(const CallBase &CB, const BasicBlock *EHPadBB = nullptr);
679
680
681 void visitGCRelocate(const GCRelocateInst &Relocate);
682 void visitGCResult(const GCResultInst &I);
683
684 void visitVectorReduce(const CallInst &I, unsigned Intrinsic);
685 void visitVectorReverse(const CallInst &I);
686 void visitVectorSplice(const CallInst &I);
687 void visitVectorInterleave(const CallInst &I, unsigned Factor);
688 void visitVectorDeinterleave(const CallInst &I, unsigned Factor);
689 void visitStepVector(const CallInst &I);
690
691 void visitUserOp1(const Instruction &I) {
692 llvm_unreachable("UserOp1 should not exist at instruction selection time!");
693 }
694 void visitUserOp2(const Instruction &I) {
695 llvm_unreachable("UserOp2 should not exist at instruction selection time!");
696 }
697
698 void processIntegerCallValue(const Instruction &I,
699 SDValue Value, bool IsSigned);
700
701 void HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
702
703 void emitInlineAsmError(const CallBase &Call, const Twine &Message);
704
705
706
707
708 enum class FuncArgumentDbgValueKind {
709 Value,
710 Declare,
711 };
712
713
714
715
716 bool EmitFuncArgumentDbgValue(const Value *V, DILocalVariable *Variable,
717 DIExpression *Expr, DILocation *DL,
718 FuncArgumentDbgValueKind Kind,
720
721
722 MachineBasicBlock *NextBlock(MachineBasicBlock *MBB);
723
724
725
726 void updateDAGForMaybeTailCall(SDValue MaybeTC);
727
728
729 SDDbgValue *getDbgValue(SDValue N, DILocalVariable *Variable,
730 DIExpression *Expr, const DebugLoc &dl,
731 unsigned DbgSDNodeOrder);
732
733 SDValue lowerStartEH(SDValue Chain, const BasicBlock *EHPadBB,
734 MCSymbol *&BeginLabel);
736 const BasicBlock *EHPadBB, MCSymbol *BeginLabel);
737
738 std::pair<bool, bool> getTargetIntrinsicCallProperties(const CallBase &I);
740 const CallBase &I, bool HasChain, bool OnlyLoad,
741 TargetLowering::IntrinsicInfo *TgtMemIntrinsicInfo = nullptr);
742 SDVTList getTargetIntrinsicVTList(const CallBase &I, bool HasChain);
743 SDValue getTargetNonMemIntrinsicNode(const Type &IntrinsicVT, bool HasChain,
745 const SDVTList &VTs);
746 SDValue handleTargetIntrinsicRet(const CallBase &I, bool HasChain,
747 bool OnlyLoad, SDValue Result);
748};
749
750
751
752
753
754
755
756
757
758
760
761
763
764
765
766
767
768
769
770
771
773
774
775
776
778
779
781
782
783
785
788 std::optionalCallingConv::ID CC = std::nullopt);
791 std::optionalCallingConv::ID CC);
792
794
795
802
803
804
805
806
809 const Value *V = nullptr) const;
810
811
812
813
814
815
819
820
821
822
824 unsigned MatchingIdx, const SDLoc &dl,
826
827
831
832
834};
835
836}
837
838#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the DenseMap class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first DebugLoc that has line number information, given a range of instructions.
This file implements a map that provides insertion order iteration.
uint64_t IntrinsicInst * II
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
This file describes how to lower LLVM code to machine code.
an instruction to allocate memory on the stack
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A cache of @llvm.assume calls within a function.
An instruction that atomically checks whether a specified value is in a memory location,...
an instruction that atomically reads a memory location, combines it with another value,...
This class holds the attributes for a particular argument, parameter, function, or return value.
LLVM Basic Block Representation.
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
Conditional or Unconditional Branch instruction.
static BranchProbability getUnknown()
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
CallBr instruction, tracking function calls that may not return control but instead transfer it to a ...
This class represents a function call, abstracting a target machine's calling convention.
This is an important base class in LLVM.
This is the common base class for constrained floating point intrinsics.
A parsed version of the target data layout string in and methods for querying it.
Class representing an expression and its matching format.
An instruction for ordering other memory operations.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Garbage collection metadata for a single function.
Represents calls to the gc.relocate intrinsic.
Represents calls to the gc.result intrinsic.
Represents a gc.statepoint intrinsic call.
Indirect Branch Instruction.
This is an important class for using LLVM in a threaded context.
The landingpad instruction holds all of the information necessary to generate correct exception handl...
An instruction for reading from memory.
Wrapper class representing virtual and physical registers.
Resume the propagation of an exception.
Return a value (possibly void), from a function.
Holds the information from a dbg_value node through SDISel.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDAGSwitchLowering(SelectionDAGBuilder *sdb, FunctionLoweringInfo &funcinfo)
Definition SelectionDAGBuilder.h:239
void addSuccessorWithProb(MachineBasicBlock *Src, MachineBasicBlock *Dst, BranchProbability Prob=BranchProbability::getUnknown()) override
Definition SelectionDAGBuilder.h:242
SDValue getValue(const Value *V)
getValue - Return an SDValue for the given Value.
DenseMap< const Constant *, Register > ConstantsOut
Definition SelectionDAGBuilder.h:262
void addDanglingDebugInfo(SmallVectorImpl< Value * > &Values, DILocalVariable *Var, DIExpression *Expr, bool IsVariadic, DebugLoc DL, unsigned Order)
Register a dbg_value which relies on a Value which we have not yet seen.
void visitDbgInfo(const Instruction &I)
void clearDanglingDebugInfo()
Clear the dangling debug information map.
StackProtectorDescriptor SPDescriptor
A StackProtectorDescriptor structure used to communicate stack protector information in between Selec...
Definition SelectionDAGBuilder.h:258
BatchAAResults * BatchAA
Definition SelectionDAGBuilder.h:232
void LowerCallTo(const CallBase &CB, SDValue Callee, bool IsTailCall, bool IsMustTailCall, const BasicBlock *EHPadBB=nullptr, const TargetLowering::PtrAuthInfo *PAI=nullptr)
void clear()
Clear out the current SelectionDAG and the associated state and prepare this SelectionDAGBuilder obje...
MVT getFrameIndexTy()
Returns the type of FrameIndex and TargetFrameIndex nodes.
Definition SelectionDAGBuilder.h:518
void visitBitTestHeader(SwitchCG::BitTestBlock &B, MachineBasicBlock *SwitchBB)
visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests"
void LowerStatepoint(const GCStatepointInst &I, const BasicBlock *EHPadBB=nullptr)
std::unique_ptr< SDAGSwitchLowering > SL
Definition SelectionDAGBuilder.h:254
SDValue lowerRangeToAssertZExt(SelectionDAG &DAG, const Instruction &I, SDValue Op)
bool HasTailCall
This is set to true if a call in the current block has been translated as a tail call.
Definition SelectionDAGBuilder.h:278
bool ShouldEmitAsBranches(const std::vector< SwitchCG::CaseBlock > &Cases)
If the set of cases should be emitted as a series of branches, return true.
void EmitBranchForMergedCondition(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, BranchProbability TProb, BranchProbability FProb, bool InvertCond)
EmitBranchForMergedCondition - Helper method for FindMergedConditions.
void LowerDeoptimizeCall(const CallInst *CI)
void LowerCallSiteWithDeoptBundle(const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB)
SwiftErrorValueTracking & SwiftError
Information about the swifterror values used throughout the function.
Definition SelectionDAGBuilder.h:268
SDValue getNonRegisterValue(const Value *V)
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo....
const TargetTransformInfo * TTI
Definition SelectionDAGBuilder.h:235
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > LPadToCallSiteMap
Map a landing pad to the call site indexes.
Definition SelectionDAGBuilder.h:274
void LowerCallSiteWithDeoptBundleImpl(const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB, bool VarArgDisallowed, bool ForceVoidReturnTy)
SDValue lowerNoFPClassToAssertNoFPClass(SelectionDAG &DAG, const Instruction &I, SDValue Op)
void handleDebugDeclare(Value *Address, DILocalVariable *Variable, DIExpression *Expression, DebugLoc DL)
void setUnusedArgValue(const Value *V, SDValue NewN)
Definition SelectionDAGBuilder.h:394
bool shouldKeepJumpConditionsTogether(const FunctionLoweringInfo &FuncInfo, const BranchInst &I, Instruction::BinaryOps Opc, const Value *Lhs, const Value *Rhs, TargetLoweringBase::CondMergingParams Params) const
StatepointLoweringState StatepointLowering
State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).
Definition SelectionDAGBuilder.h:175
void visitBitTestCase(SwitchCG::BitTestBlock &BB, MachineBasicBlock *NextMBB, BranchProbability BranchProbToNext, Register Reg, SwitchCG::BitTestCase &B, MachineBasicBlock *SwitchBB)
visitBitTestCase - this function produces one "bit test"
bool canTailCall(const CallBase &CB) const
SelectionDAGBuilder(SelectionDAG &dag, FunctionLoweringInfo &funcinfo, SwiftErrorValueTracking &swifterror, CodeGenOptLevel ol)
Definition SelectionDAGBuilder.h:282
void populateCallLoweringInfo(TargetLowering::CallLoweringInfo &CLI, const CallBase *Call, unsigned ArgIdx, unsigned NumArgs, SDValue Callee, Type *ReturnTy, AttributeSet RetAttrs, bool IsPatchPoint)
Populate a CallLowerinInfo (into CLI) based on the properties of the call being lowered.
void CopyValueToVirtualRegister(const Value *V, Register Reg, ISD::NodeType ExtendType=ISD::ANY_EXTEND)
void salvageUnresolvedDbgValue(const Value *V, DanglingDebugInfo &DDI)
For the given dangling debuginfo record, perform last-ditch efforts to resolve the debuginfo to somet...
SmallVector< SDValue, 8 > PendingLoads
Loads are not emitted to the program immediately.
Definition SelectionDAGBuilder.h:171
GCFunctionInfo * GFI
Garbage collection metadata for the function.
Definition SelectionDAGBuilder.h:271
void init(GCFunctionInfo *gfi, BatchAAResults *BatchAA, AssumptionCache *AC, const TargetLibraryInfo *li, const TargetTransformInfo &TTI)
SDValue getRoot()
Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict) items.
void ExportFromCurrentBlock(const Value *V)
ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block,...
DebugLoc getCurDebugLoc() const
Definition SelectionDAGBuilder.h:331
void resolveOrClearDbgInfo()
Evict any dangling debug information, attempting to salvage it first.
std::pair< SDValue, SDValue > lowerInvokable(TargetLowering::CallLoweringInfo &CLI, const BasicBlock *EHPadBB=nullptr)
SDValue getMemoryRoot()
Return the current virtual root of the Selection DAG, flushing any PendingLoad items.
void resolveDanglingDebugInfo(const Value *V, SDValue Val)
If we saw an earlier dbg_value referring to V, generate the debug data structures now that we've seen...
SDLoc getCurSDLoc() const
Definition SelectionDAGBuilder.h:327
void visit(const Instruction &I)
void dropDanglingDebugInfo(const DILocalVariable *Variable, const DIExpression *Expr)
If we have dangling debug info that describes Variable, or an overlapping part of variable considerin...
SDValue getCopyFromRegs(const Value *V, Type *Ty)
If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty.
void CopyToExportRegsIfNeeded(const Value *V)
CopyToExportRegsIfNeeded - If the given value has virtual registers created for it,...
void handleKillDebugValue(DILocalVariable *Var, DIExpression *Expr, DebugLoc DbgLoc, unsigned Order)
Create a record for a kill location debug intrinsic.
LLVMContext * Context
Definition SelectionDAGBuilder.h:280
void visitJumpTable(SwitchCG::JumpTable &JT)
visitJumpTable - Emit JumpTable node in the current MBB
SDValue getFPOperationRoot(fp::ExceptionBehavior EB)
Return the current virtual root of the Selection DAG, flushing PendingConstrainedFP or PendingConstra...
void visitJumpTableHeader(SwitchCG::JumpTable &JT, SwitchCG::JumpTableHeader &JTH, MachineBasicBlock *SwitchBB)
visitJumpTableHeader - This function emits necessary code to produce index in the JumpTable from swit...
void LowerCallSiteWithPtrAuthBundle(const CallBase &CB, const BasicBlock *EHPadBB)
AssumptionCache * AC
Definition SelectionDAGBuilder.h:233
static const unsigned LowestSDNodeOrder
Lowest valid SDNodeOrder.
Definition SelectionDAGBuilder.h:229
void LowerDeoptimizingReturn()
FunctionLoweringInfo & FuncInfo
Information about the function as a whole.
Definition SelectionDAGBuilder.h:265
void setValue(const Value *V, SDValue NewN)
Definition SelectionDAGBuilder.h:388
SelectionDAG & DAG
Definition SelectionDAGBuilder.h:231
void FindMergedConditions(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, Instruction::BinaryOps Opc, BranchProbability TProb, BranchProbability FProb, bool InvertCond)
const TargetLibraryInfo * LibInfo
Definition SelectionDAGBuilder.h:234
bool isExportableFromCurrentBlock(const Value *V, const BasicBlock *FromBB)
void visitSPDescriptorParent(StackProtectorDescriptor &SPD, MachineBasicBlock *ParentBB)
Codegen a new tail for a stack protector check ParentMBB which has had its tail spliced into a stack ...
bool handleDebugValue(ArrayRef< const Value * > Values, DILocalVariable *Var, DIExpression *Expr, DebugLoc DbgLoc, unsigned Order, bool IsVariadic)
For a given list of Values, attempt to create and record a SDDbgValue in the SelectionDAG.
SDValue getControlRoot()
Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports (...
void UpdateSplitBlock(MachineBasicBlock *First, MachineBasicBlock *Last)
When an MBB was split during scheduling, update the references that need to refer to the last resulti...
SDValue getValueImpl(const Value *V)
getValueImpl - Helper function for getValue and getNonRegisterValue.
void visitSwitchCase(SwitchCG::CaseBlock &CB, MachineBasicBlock *SwitchBB)
visitSwitchCase - Emits the necessary code to represent a single node in the binary search tree resul...
SDValue LowerAsSTATEPOINT(StatepointLoweringInfo &SI)
Lower SLI into a STATEPOINT instruction.
void visitSPDescriptorFailure(StackProtectorDescriptor &SPD)
Codegen the failure basic block for a stack protector check.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Encapsulates all of the information needed to generate a stack protector check, and signals to isel w...
This class tracks both per-statepoint and per-selectiondag information.
An instruction for storing to memory.
SwitchLowering(FunctionLoweringInfo &funcinfo)
Provides information about what library functions are available for the current target.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Primary interface to the complete machine description for the target machine.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
The instances of the Type class are immutable: once they are created, they are never changed.
This function has undefined behavior.
A Use represents the edge between a Value definition and its users.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
@ ADD
Simple integer binary arithmetic operators.
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ FADD
Simple binary floating point operators.
@ SHL
Shift and rotation operations.
@ AND
Bitwise operators - logical and, logical or, logical xor.
std::vector< CaseCluster > CaseClusterVector
SmallVector< SwitchWorkListItem, 4 > SwitchWorkList
ExceptionBehavior
Exception behavior used for floating point operations.
This is an optimization pass for GlobalISel generic memory operations.
CodeGenOptLevel
Code generation optimization level.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
Implement std::hash so that hash_code can be used in STL containers.
SmallVector< std::pair< Register, TypeSize >, 4 > getRegsAndSizes() const
Return a list of registers and their sizes.
SmallVector< unsigned, 4 > RegCount
This list holds the number of registers for each value.
Definition SelectionDAGBuilder.h:780
bool isABIMangled() const
Definition SelectionDAGBuilder.h:793
SmallVector< EVT, 4 > ValueVTs
The value types of the values, which may not be legal, and may need be promoted or synthesized from o...
Definition SelectionDAGBuilder.h:762
void append(const RegsForValue &RHS)
Add the specified values to this one.
Definition SelectionDAGBuilder.h:796
SmallVector< Register, 4 > Regs
This list holds the registers assigned to the values.
Definition SelectionDAGBuilder.h:777
void AddInlineAsmOperands(InlineAsm::Kind Code, bool HasMatching, unsigned MatchingIdx, const SDLoc &dl, SelectionDAG &DAG, std::vector< SDValue > &Ops) const
Add this value to the specified inlineasm node operand list.
SDValue getCopyFromRegs(SelectionDAG &DAG, FunctionLoweringInfo &FuncInfo, const SDLoc &dl, SDValue &Chain, SDValue *Glue, const Value *V=nullptr) const
Emit a series of CopyFromReg nodes that copies from this value and returns the result as a ValueVTs v...
SmallVector< MVT, 4 > RegVTs
The value types of the registers.
Definition SelectionDAGBuilder.h:772
void getCopyToRegs(SDValue Val, SelectionDAG &DAG, const SDLoc &dl, SDValue &Chain, SDValue *Glue, const Value *V=nullptr, ISD::NodeType PreferredExtendType=ISD::ANY_EXTEND) const
Emit a series of CopyToReg nodes that copies the specified value into the registers specified by this...
std::optional< CallingConv::ID > CallConv
Records if this value needs to be treated in an ABI dependant manner, different to normal type legali...
Definition SelectionDAGBuilder.h:784
bool occupiesMultipleRegs() const
Check if the total RegCount is greater than one.
Definition SelectionDAGBuilder.h:828
Helper for printing DanglingDebugInfo.
Definition SelectionDAGBuilder.h:128
Print(const Value *V, const DanglingDebugInfo &DDI)
Definition SelectionDAGBuilder.h:129
const DanglingDebugInfo & DDI
Definition SelectionDAGBuilder.h:131
const Value * V
Definition SelectionDAGBuilder.h:130
friend raw_ostream & operator<<(raw_ostream &OS, const DanglingDebugInfo::Print &P)
Definition SelectionDAGBuilder.h:132
unsigned NumPatchBytes
The number of patchable bytes the call needs to get lowered into.
Definition SelectionDAGBuilder.h:486
ArrayRef< const Use > GCTransitionArgs
The list of gc transition arguments present in the gc.statepoint being lowered.
Definition SelectionDAGBuilder.h:470
ArrayRef< const Use > GCLives
The full list of gc-live arguments to the gc.statepoint being lowered.
Definition SelectionDAGBuilder.h:463
uint64_t StatepointFlags
Flags associated with the meta arguments being lowered.
Definition SelectionDAGBuilder.h:483
const BasicBlock * EHPadBB
The exception handling unwind destination, in case this represents an invoke of gc....
Definition SelectionDAGBuilder.h:490
ArrayRef< const Use > DeoptState
The deoptimization state associated with this gc.statepoint call, if any.
Definition SelectionDAGBuilder.h:480
TargetLowering::CallLoweringInfo CLI
Information regarding the underlying call instruction.
Definition SelectionDAGBuilder.h:476
SmallVector< const Value *, 16 > Ptrs
Definition SelectionDAGBuilder.h:457
SmallVector< const GCRelocateInst *, 16 > GCRelocates
The set of gc.relocate calls associated with this gc.statepoint.
Definition SelectionDAGBuilder.h:460
StatepointLoweringInfo(SelectionDAG &DAG)
Definition SelectionDAGBuilder.h:492
uint64_t ID
The ID that the resulting STATEPOINT instruction has to report.
Definition SelectionDAGBuilder.h:473
const Instruction * StatepointInstr
The gc.statepoint instruction.
Definition SelectionDAGBuilder.h:466
SmallVector< const Value *, 16 > Bases
Bases[i] is the base pointer for Ptrs[i].
Definition SelectionDAGBuilder.h:456
This structure is used to communicate between SelectionDAGBuilder and SDISel for the code generation ...
This structure contains all information that is necessary for lowering calls.
This structure contains the information necessary for lowering pointer-authenticating indirect calls.