LLVM 24.0.0git
SelectionDAGBuilder.h
Go to the documentation of this file.
1//===- SelectionDAGBuilder.h - Selection-DAG building -----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This implements routines for translating from LLVM IR into SelectionDAG IR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
14#define LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
15
16#include "StatepointLowering.h"
17#include "llvm/ADT/ArrayRef.h"
18#include "llvm/ADT/DenseMap.h"
19#include "llvm/ADT/MapVector.h"
29#include "llvm/IR/DebugLoc.h"
30#include "llvm/IR/Instruction.h"
34#include <algorithm>
35#include <cassert>
36#include <cstdint>
37#include <optional>
38#include <utility>
39#include <vector>
40
41namespace llvm {
42
43class AllocaInst;
45class AtomicRMWInst;
46class AssumptionCache;
47class BasicBlock;
48class CallInst;
49class CallBrInst;
50class CatchPadInst;
51class CatchReturnInst;
52class CatchSwitchInst;
53class CondBrInst;
54class CleanupPadInst;
56class Constant;
58class DataLayout;
59class DIExpression;
60class DILocalVariable;
61class DILocation;
62class FenceInst;
64class GCFunctionInfo;
65class GCRelocateInst;
66class GCResultInst;
68class IndirectBrInst;
69class InvokeInst;
70class LandingPadInst;
71class LLVMContext;
72class LoadInst;
74class PHINode;
75class ResumeInst;
76class ReturnInst;
77class SDDbgValue;
78class SelectionDAG;
79class StoreInst;
81class SwitchInst;
83class TargetMachine;
84class Type;
85class VAArgInst;
86class UnreachableInst;
87class Use;
88class User;
89class Value;
90
91//===----------------------------------------------------------------------===//
92/// SelectionDAGBuilder - This is the common target-independent lowering
93/// implementation that is parameterized by a TargetLowering object.
94///
96 /// The current instruction being visited.
97 const Instruction *CurInst = nullptr;
98
100
101 /// Maps argument value for unused arguments. This is used
102 /// to preserve debug information for incoming arguments.
103 DenseMap<const Value*, SDValue> UnusedArgNodeMap;
104
105 /// Helper type for DanglingDebugInfoMap.
106 class DanglingDebugInfo {
107 unsigned SDNodeOrder = 0;
108
109 public:
110 DILocalVariable *Variable;
112 DebugLoc dl;
113 DanglingDebugInfo() = default;
114 DanglingDebugInfo(DILocalVariable *Var, DIExpression *Expr, DebugLoc DL,
115 unsigned SDNO)
116 : SDNodeOrder(SDNO), Variable(Var), Expression(Expr),
117 dl(std::move(DL)) {}
118
119 DILocalVariable *getVariable() const { return Variable; }
120 DIExpression *getExpression() const { return Expression; }
121 DebugLoc getDebugLoc() const { return dl; }
122 unsigned getSDNodeOrder() const { return SDNodeOrder; }
123
124 /// Helper for printing DanglingDebugInfo. This hoop-jumping is to
125 /// store a Value pointer, so that we can print a whole DDI as one object.
126 /// Call SelectionDAGBuilder::printDDI instead of using directly.
127 struct Print {
128 Print(const Value *V, const DanglingDebugInfo &DDI) : V(V), DDI(DDI) {}
129 const Value *V;
130 const DanglingDebugInfo &DDI;
133 OS << "DDI(var=" << *P.DDI.getVariable();
134 if (P.V)
135 OS << ", val=" << *P.V;
136 else
137 OS << ", val=nullptr";
138
139 OS << ", expr=" << *P.DDI.getExpression()
140 << ", order=" << P.DDI.getSDNodeOrder()
141 << ", loc=" << P.DDI.getDebugLoc() << ")";
142 return OS;
143 }
144 };
145 };
146
147 /// Returns an object that defines `raw_ostream &operator<<` for printing.
148 /// Usage example:
149 //// errs() << printDDI(MyDanglingInfo) << " is dangling\n";
150 DanglingDebugInfo::Print printDDI(const Value *V,
151 const DanglingDebugInfo &DDI) {
152 return DanglingDebugInfo::Print(V, DDI);
153 }
154
155 /// Helper type for DanglingDebugInfoMap.
156 typedef std::vector<DanglingDebugInfo> DanglingDebugInfoVector;
157
158 /// Keeps track of dbg_values for which we have not yet seen the referent.
159 /// We defer handling these until we do see it.
160 MapVector<const Value*, DanglingDebugInfoVector> DanglingDebugInfoMap;
161
162 /// Cache whether a debug value can name the address of a global directly,
163 /// rather than holding out for a register with it.
164 bool CanDescribeGlobalAddressInLocationList = false;
165
166public:
167 /// Loads are not emitted to the program immediately. We bunch them up and
168 /// then emit token factor nodes when possible. This allows us to get simple
169 /// disambiguation between loads without worrying about alias analysis.
171
172 /// State used while lowering a statepoint sequence (gc_statepoint,
173 /// gc_relocate, and gc_result). See StatepointLowering.hpp/cpp for details.
175
176private:
177 /// CopyToReg nodes that copy values to virtual registers for export to other
178 /// blocks need to be emitted before any terminator instruction, but they have
179 /// no other ordering requirements. We bunch them up and the emit a single
180 /// tokenfactor for them just before terminator instructions.
181 SmallVector<SDValue, 8> PendingExports;
182
183 /// Similar to loads, nodes corresponding to constrained FP intrinsics are
184 /// bunched up and emitted when necessary. These can be moved across each
185 /// other and any (normal) memory operation (load or store), but not across
186 /// calls or instructions having unspecified side effects. As a special
187 /// case, constrained FP intrinsics using fpexcept.strict may not be deleted
188 /// even if otherwise unused, so they need to be chained before any
189 /// terminator instruction (like PendingExports). We track the latter
190 /// set of nodes in a separate list.
191 SmallVector<SDValue, 8> PendingConstrainedFP;
192 SmallVector<SDValue, 8> PendingConstrainedFPStrict;
193
194 /// Update root to include all chains from the Pending list.
195 SDValue updateRoot(SmallVectorImpl<SDValue> &Pending);
196
197 /// Given a node representing a floating-point operation and its specified
198 /// exception behavior, this either updates the root or stores the node in
199 /// a list to be added to chains latter.
200 void pushFPOpOutChain(SDValue Result, fp::ExceptionBehavior EB);
201
202 /// A unique monotonically increasing number used to order the SDNodes we
203 /// create.
204 unsigned SDNodeOrder;
205
206 /// Emit comparison and split W into two subtrees.
207 void splitWorkItem(SwitchCG::SwitchWorkList &WorkList,
208 const SwitchCG::SwitchWorkListItem &W, Value *Cond,
209 MachineBasicBlock *SwitchMBB);
210
211 /// Lower W.
212 void lowerWorkItem(SwitchCG::SwitchWorkListItem W, Value *Cond,
213 MachineBasicBlock *SwitchMBB,
214 MachineBasicBlock *DefaultMBB);
215
216 /// Peel the top probability case if it exceeds the threshold
218 peelDominantCaseCluster(const SwitchInst &SI,
220 BranchProbability &PeeledCaseProb);
221
222private:
223 const TargetMachine &TM;
224
225public:
226 /// Lowest valid SDNodeOrder. The special case 0 is reserved for scheduling
227 /// nodes without a corresponding SDNode.
228 static const unsigned LowestSDNodeOrder = 1;
229
232 AssumptionCache *AC = nullptr;
233 const TargetLibraryInfo *LibInfo = nullptr;
234 const TargetTransformInfo *TTI = nullptr;
235
237 public:
240
244 SDB->addSuccessorWithProb(Src, Dst, Prob);
245 }
246
247 private:
248 SelectionDAGBuilder *SDB = nullptr;
249 };
250
251 // Data related to deferred switch lowerings. Used to construct additional
252 // Basic Blocks in SelectionDAGISel::FinishBasicBlock.
253 std::unique_ptr<SDAGSwitchLowering> SL;
254
255 /// A StackProtectorDescriptor structure used to communicate stack protector
256 /// information in between SelectBasicBlock and FinishBasicBlock.
258
259 // Emit PHI-node-operand constants only once even if used by multiple
260 // PHI nodes.
262
263 /// Information about the function as a whole.
265
266 /// Information about the swifterror values used throughout the function.
268
269 /// Garbage collection metadata for the function.
270 GCFunctionInfo *GFI = nullptr;
271
272 /// Map a landing pad to the call site indexes.
274
275 /// This is set to true if a call in the current block has been translated as
276 /// a tail call. In this case, no subsequent DAG nodes should be created.
277 bool HasTailCall = false;
278
280
283 : SDNodeOrder(LowestSDNodeOrder), TM(dag.getTarget()), DAG(dag),
284 SL(std::make_unique<SDAGSwitchLowering>(this, funcinfo)),
285 FuncInfo(funcinfo), SwiftError(swifterror) {}
286
288 const TargetLibraryInfo *li, const TargetTransformInfo &TTI);
289
290 /// Clear out the current SelectionDAG and the associated state and prepare
291 /// this SelectionDAGBuilder object to be used for a new block. This doesn't
292 /// clear out information about additional blocks that are needed to complete
293 /// switch lowering or PHI node updating; that information is cleared out as
294 /// it is consumed.
295 void clear();
296
297 /// Clear the dangling debug information map. This function is separated from
298 /// the clear so that debug information that is dangling in a basic block can
299 /// be properly resolved in a different basic block. This allows the
300 /// SelectionDAG to resolve dangling debug information attached to PHI nodes.
302
303 /// Return the current virtual root of the Selection DAG, flushing any
304 /// PendingLoad items. This must be done before emitting a store or any other
305 /// memory node that may need to be ordered after any prior load instructions.
307
308 /// Return the current virtual root of the Selection DAG, flushing
309 /// PendingConstrainedFP or PendingConstrainedFPStrict items if the new
310 /// exception behavior (specified by \p EB) differs from that of the pending
311 /// instructions. This must be done before emitting constrained FP operation
312 /// call.
314
315 /// Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict)
316 /// items. This must be done before emitting any call other any other node
317 /// that may need to be ordered after FP instructions due to other side
318 /// effects.
320
321 /// Similar to getRoot, but instead of flushing all the PendingLoad items,
322 /// flush all the PendingExports (and PendingConstrainedFPStrict) items.
323 /// It is necessary to do this before emitting a terminator instruction.
325
327 return SDLoc(CurInst, SDNodeOrder);
328 }
329
331 return CurInst ? CurInst->getDebugLoc() : DebugLoc();
332 }
333
335 ISD::NodeType ExtendType = ISD::ANY_EXTEND);
336
337 void visit(const Instruction &I);
338 void visitDbgInfo(const Instruction &I);
339
340 void visit(unsigned Opcode, const User &I);
341
342 /// If there was virtual register allocated for the value V emit CopyFromReg
343 /// of the specified type Ty. Return empty SDValue() otherwise.
344 SDValue getCopyFromRegs(const Value *V, Type *Ty);
345
346 /// Register a dbg_value which relies on a Value which we have not yet seen.
348 DILocalVariable *Var, DIExpression *Expr,
349 bool IsVariadic, DebugLoc DL, unsigned Order);
350
351 /// If we have dangling debug info that describes \p Variable, or an
352 /// overlapping part of variable considering the \p Expr, then this method
353 /// will drop that debug info as it isn't valid any longer.
354 void dropDanglingDebugInfo(const DILocalVariable *Variable,
355 const DIExpression *Expr);
356
357 /// If we saw an earlier dbg_value referring to V, generate the debug data
358 /// structures now that we've seen its definition.
359 void resolveDanglingDebugInfo(const Value *V, SDValue Val);
360
361 /// For the given dangling debuginfo record, perform last-ditch efforts to
362 /// resolve the debuginfo to something that is represented in this DAG. If
363 /// this cannot be done, produce an Undef debug value record.
364 void salvageUnresolvedDbgValue(const Value *V, DanglingDebugInfo &DDI);
365
366 /// For a given list of Values, attempt to create and record a SDDbgValue in
367 /// the SelectionDAG.
369 DIExpression *Expr, DebugLoc DbgLoc, unsigned Order,
370 bool IsVariadic);
371
372 /// Create a record for a kill location debug intrinsic.
374 DebugLoc DbgLoc, unsigned Order);
375
378
379 /// Evict any dangling debug information, attempting to salvage it first.
381
382 SDValue getValue(const Value *V);
383
385 SDValue getValueImpl(const Value *V);
386
387 void setValue(const Value *V, SDValue NewN) {
388 SDValue &N = NodeMap[V];
389 assert(!N.getNode() && "Already set a value for this node!");
390 N = NewN;
391 }
392
393 void setUnusedArgValue(const Value *V, SDValue NewN) {
394 SDValue &N = UnusedArgNodeMap[V];
395 assert(!N.getNode() && "Already set a value for this node!");
396 N = NewN;
397 }
398
399 void setValueToPoison(const Value *V, const SDLoc &dl);
400
403 Instruction::BinaryOps Opc, const Value *Lhs, const Value *Rhs,
405
408 MachineBasicBlock *SwitchBB,
410 BranchProbability FProb, bool InvertCond);
413 MachineBasicBlock *CurBB,
414 MachineBasicBlock *SwitchBB,
416 bool InvertCond);
417 bool ShouldEmitAsBranches(const std::vector<SwitchCG::CaseBlock> &Cases);
418 bool isExportableFromCurrentBlock(const Value *V, const BasicBlock *FromBB);
419 void CopyToExportRegsIfNeeded(const Value *V);
420 void ExportFromCurrentBlock(const Value *V);
421 void LowerCallTo(const CallBase &CB, SDValue Callee, bool IsTailCall,
422 bool IsMustTailCall, const BasicBlock *EHPadBB = nullptr,
423 const TargetLowering::PtrAuthInfo *PAI = nullptr);
424
425 // Check some of the target-independent constraints for tail calls. This does
426 // not iterate over the call arguments.
427 bool canTailCall(const CallBase &CB) const;
428
429 // Lower range metadata from 0 to N to assert zext to an integer of nearest
430 // floor power of two.
432 SDValue Op);
433
434 // Lower nofpclass attributes to AssertNoFPClass
436 const Instruction &I, SDValue Op);
437
439 const CallBase *Call, unsigned ArgIdx,
440 unsigned NumArgs, SDValue Callee,
441 Type *ReturnTy, AttributeSet RetAttrs,
442 bool IsPatchPoint);
443
444 std::pair<SDValue, SDValue>
446 const BasicBlock *EHPadBB = nullptr);
447
448 /// When an MBB was split during scheduling, update the
449 /// references that need to refer to the last resulting block.
451
452 /// Describes a gc.statepoint or a gc.statepoint like thing for the purposes
453 /// of lowering into a STATEPOINT node.
455 /// Bases[i] is the base pointer for Ptrs[i]. Together they denote the set
456 /// of gc pointers this STATEPOINT has to relocate.
459
460 /// The set of gc.relocate calls associated with this gc.statepoint.
462
463 /// The full list of gc-live arguments to the gc.statepoint being lowered.
465
466 /// The gc.statepoint instruction.
467 const Instruction *StatepointInstr = nullptr;
468
469 /// The list of gc transition arguments present in the gc.statepoint being
470 /// lowered.
472
473 /// The ID that the resulting STATEPOINT instruction has to report.
475
476 /// Information regarding the underlying call instruction.
478
479 /// The deoptimization state associated with this gc.statepoint call, if
480 /// any.
482
483 /// Flags associated with the meta arguments being lowered.
485
486 /// The number of patchable bytes the call needs to get lowered into.
487 unsigned NumPatchBytes = -1;
488
489 /// The exception handling unwind destination, in case this represents an
490 /// invoke of gc.statepoint.
491 const BasicBlock *EHPadBB = nullptr;
492
494 };
495
496 /// Lower \p SLI into a STATEPOINT instruction.
497 SDValue LowerAsSTATEPOINT(StatepointLoweringInfo &SI);
498
499 // This function is responsible for the whole statepoint lowering process.
500 // It uniformly handles invoke and call statepoints.
502 const BasicBlock *EHPadBB = nullptr);
503
505 const BasicBlock *EHPadBB);
506
507 void LowerDeoptimizeCall(const CallInst *CI);
509
511 const BasicBlock *EHPadBB,
512 bool VarArgDisallowed,
513 bool ForceVoidReturnTy);
514
516 const BasicBlock *EHPadBB);
517
518 /// Returns the type of FrameIndex and TargetFrameIndex nodes.
520 return DAG.getTargetLoweringInfo().getFrameIndexTy(DAG.getDataLayout());
521 }
522
523private:
524 // Terminator instructions.
525 void visitRet(const ReturnInst &I);
526 void visitUncondBr(const UncondBrInst &I);
527 void visitCondBr(const CondBrInst &I);
528 void visitSwitch(const SwitchInst &I);
529 void visitIndirectBr(const IndirectBrInst &I);
530 void visitUnreachable(const UnreachableInst &I);
531 void visitCleanupRet(const CleanupReturnInst &I);
532 void visitCatchSwitch(const CatchSwitchInst &I);
533 void visitCatchRet(const CatchReturnInst &I);
534 void visitCatchPad(const CatchPadInst &I);
535 void visitCleanupPad(const CleanupPadInst &CPI);
536
537 BranchProbability getEdgeProbability(const MachineBasicBlock *Src,
538 const MachineBasicBlock *Dst) const;
539 void addSuccessorWithProb(
542
543public:
546 MachineBasicBlock *ParentBB);
549 MachineBasicBlock *SwitchBB);
551 BranchProbability BranchProbToNext, Register Reg,
556 MachineBasicBlock *SwitchBB);
557
558private:
559 // These all get lowered before this pass.
560 void visitInvoke(const InvokeInst &I);
561 void visitCallBrLandingPad(const CallInst &I);
562 void visitResume(const ResumeInst &I);
563
564 void visitCallBr(const CallBrInst &I);
565 void visitCallBrIntrinsic(const CallBrInst &I);
566
567 void visitUnary(const User &I, unsigned Opcode);
568 void visitFNeg(const User &I) { visitUnary(I, ISD::FNEG); }
569
570 void visitBinary(const User &I, unsigned Opcode);
571 void visitShift(const User &I, unsigned Opcode);
572 void visitAdd(const User &I) { visitBinary(I, ISD::ADD); }
573 void visitFAdd(const User &I) { visitBinary(I, ISD::FADD); }
574 void visitSub(const User &I) { visitBinary(I, ISD::SUB); }
575 void visitFSub(const User &I) { visitBinary(I, ISD::FSUB); }
576 void visitMul(const User &I) { visitBinary(I, ISD::MUL); }
577 void visitFMul(const User &I) { visitBinary(I, ISD::FMUL); }
578 void visitURem(const User &I) { visitBinary(I, ISD::UREM); }
579 void visitSRem(const User &I) { visitBinary(I, ISD::SREM); }
580 void visitFRem(const User &I) { visitBinary(I, ISD::FREM); }
581 void visitUDiv(const User &I) { visitBinary(I, ISD::UDIV); }
582 void visitSDiv(const User &I);
583 void visitFDiv(const User &I) { visitBinary(I, ISD::FDIV); }
584 void visitAnd (const User &I) { visitBinary(I, ISD::AND); }
585 void visitOr (const User &I) { visitBinary(I, ISD::OR); }
586 void visitXor (const User &I) { visitBinary(I, ISD::XOR); }
587 void visitShl (const User &I) { visitShift(I, ISD::SHL); }
588 void visitLShr(const User &I) { visitShift(I, ISD::SRL); }
589 void visitAShr(const User &I) { visitShift(I, ISD::SRA); }
590 void visitICmp(const ICmpInst &I);
591 void visitFCmp(const FCmpInst &I);
592 // Visit the conversion instructions
593 void visitTrunc(const User &I);
594 void visitZExt(const User &I);
595 void visitSExt(const User &I);
596 void visitFPTrunc(const User &I);
597 void visitFPExt(const User &I);
598 void visitFPToUI(const User &I);
599 void visitFPToSI(const User &I);
600 void visitUIToFP(const User &I);
601 void visitSIToFP(const User &I);
602 void visitPtrToAddr(const User &I);
603 void visitPtrToInt(const User &I);
604 void visitIntToPtr(const User &I);
605 void visitBitCast(const User &I);
606 void visitAddrSpaceCast(const User &I);
607
608 void visitExtractElement(const User &I);
609 void visitInsertElement(const User &I);
610 void visitShuffleVector(const User &I);
611
612 void visitExtractValue(const ExtractValueInst &I);
613 void visitInsertValue(const InsertValueInst &I);
614 void visitLandingPad(const LandingPadInst &LP);
615
616 void visitGetElementPtr(const User &I);
617 void visitSelect(const User &I);
618
619 void visitBitInsert(const User &I);
620 void visitBitExtract(const User &I);
621
622 void visitAlloca(const AllocaInst &I);
623 void visitLoad(const LoadInst &I);
624 void visitStore(const StoreInst &I);
625 void visitMaskedLoad(const CallInst &I, bool IsExpanding = false);
626 void visitMaskedStore(const CallInst &I, bool IsCompressing = false);
627 void visitMaskedGather(const CallInst &I);
628 void visitMaskedScatter(const CallInst &I);
629 void visitSpeculativeLoad(const CallInst &I);
630 void visitAtomicCmpXchg(const AtomicCmpXchgInst &I);
631 void visitAtomicRMW(const AtomicRMWInst &I);
632 void visitFence(const FenceInst &I);
633 void visitPHI(const PHINode &I);
634 void visitCall(const CallInst &I);
635 bool visitMemCmpBCmpCall(const CallInst &I);
636 bool visitMemCCpyCall(const CallInst &I);
637 bool visitMemPCpyCall(const CallInst &I);
638 bool visitMemChrCall(const CallInst &I);
639 bool visitStrCpyCall(const CallInst &I, bool isStpcpy);
640 bool visitStrCmpCall(const CallInst &I);
641 bool visitStrLenCall(const CallInst &I);
642 bool visitStrNLenCall(const CallInst &I);
643 bool visitStrstrCall(const CallInst &I);
644 bool visitUnaryFloatCall(const CallInst &I, unsigned Opcode);
645 bool visitBinaryFloatCall(const CallInst &I, unsigned Opcode);
646 void visitAtomicLoad(const LoadInst &I);
647 void visitAtomicStore(const StoreInst &I);
648 void visitLoadFromSwiftError(const LoadInst &I);
649 void visitStoreToSwiftError(const StoreInst &I);
650 void visitFreeze(const FreezeInst &I);
651
652 void visitInlineAsm(const CallBase &Call,
653 const BasicBlock *EHPadBB = nullptr);
654
655 bool visitEntryValueDbgValue(ArrayRef<const Value *> Values,
656 DILocalVariable *Variable, DIExpression *Expr,
657 DebugLoc DbgLoc);
658 void visitIntrinsicCall(const CallInst &I, unsigned Intrinsic);
659 void visitTargetIntrinsic(const CallInst &I, unsigned Intrinsic);
660 void visitConstrainedFPIntrinsic(const ConstrainedFPIntrinsic &FPI);
661 void visitConvergenceControl(const CallInst &I, unsigned Intrinsic);
662 void visitVectorHistogram(const CallInst &I, unsigned IntrinsicID);
663 void visitVectorExtractLastActive(const CallInst &I, unsigned Intrinsic);
664 void visitVPLoad(const VPIntrinsic &VPIntrin, EVT VT,
665 const SmallVectorImpl<SDValue> &OpValues);
666 void visitVPLoadFF(const VPIntrinsic &VPIntrin, EVT VT, EVT EVLVT,
667 const SmallVectorImpl<SDValue> &OpValues);
668 void visitVPStore(const VPIntrinsic &VPIntrin,
669 const SmallVectorImpl<SDValue> &OpValues);
670 void visitVPGather(const VPIntrinsic &VPIntrin, EVT VT,
671 const SmallVectorImpl<SDValue> &OpValues);
672 void visitVPScatter(const VPIntrinsic &VPIntrin,
673 const SmallVectorImpl<SDValue> &OpValues);
674 void visitVPStridedLoad(const VPIntrinsic &VPIntrin, EVT VT,
675 const SmallVectorImpl<SDValue> &OpValues);
676 void visitVPStridedStore(const VPIntrinsic &VPIntrin,
677 const SmallVectorImpl<SDValue> &OpValues);
678 void visitVectorPredicationIntrinsic(const VPIntrinsic &VPIntrin);
679
680 void visitVAStart(const CallInst &I);
681 void visitVAArg(const VAArgInst &I);
682 void visitVAEnd(const CallInst &I);
683 void visitVACopy(const CallInst &I);
684 void visitStackmap(const CallInst &I);
685 void visitPatchpoint(const CallBase &CB, const BasicBlock *EHPadBB = nullptr);
686
687 // These two are implemented in StatepointLowering.cpp
688 void visitGCRelocate(const GCRelocateInst &Relocate);
689 void visitGCResult(const GCResultInst &I);
690
691 void visitVectorReduce(const CallInst &I, unsigned Intrinsic);
692 void visitVectorReverse(const CallInst &I);
693 void visitVectorSplice(const CallInst &I);
694 void visitVectorInterleave(const CallInst &I, unsigned Factor);
695 void visitVectorDeinterleave(const CallInst &I, unsigned Factor);
696 void visitStepVector(const CallInst &I);
697
698 void visitUserOp1(const Instruction &I) {
699 llvm_unreachable("UserOp1 should not exist at instruction selection time!");
700 }
701 void visitUserOp2(const Instruction &I) {
702 llvm_unreachable("UserOp2 should not exist at instruction selection time!");
703 }
704
705 void processIntegerCallValue(const Instruction &I,
706 SDValue Value, bool IsSigned);
707
708 void HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
709
710 void emitInlineAsmError(const CallBase &Call, const Twine &Message);
711
712 /// An enum that states to emit func argument dbg value the kind of intrinsic
713 /// it originally had. This controls the internal behavior of
714 /// EmitFuncArgumentDbgValue.
715 enum class FuncArgumentDbgValueKind {
716 Value, // This was originally a llvm.dbg.value.
717 Declare, // This was originally a llvm.dbg.declare.
718 };
719
720 /// If V is an function argument then create corresponding DBG_VALUE machine
721 /// instruction for it now. At the end of instruction selection, they will be
722 /// inserted to the entry BB.
723 bool EmitFuncArgumentDbgValue(const Value *V, DILocalVariable *Variable,
724 DIExpression *Expr, DILocation *DL,
725 FuncArgumentDbgValueKind Kind,
726 const SDValue &N);
727
728 /// Return the next block after MBB, or nullptr if there is none.
729 MachineBasicBlock *NextBlock(MachineBasicBlock *MBB);
730
731 /// Update the DAG and DAG builder with the relevant information after
732 /// a new root node has been created which could be a tail call.
733 void updateDAGForMaybeTailCall(SDValue MaybeTC);
734
735 /// Return the appropriate SDDbgValue based on N.
736 SDDbgValue *getDbgValue(SDValue N, DILocalVariable *Variable,
737 DIExpression *Expr, const DebugLoc &dl,
738 unsigned DbgSDNodeOrder);
739
740public:
741 SDValue lowerStartEH(SDValue Chain, const BasicBlock *EHPadBB,
742 MCSymbol *&BeginLabel);
743
744private:
745 SDValue lowerEndEH(SDValue Chain, const InvokeInst *II,
746 const BasicBlock *EHPadBB, MCSymbol *BeginLabel);
747
748 std::pair<bool, bool> getTargetIntrinsicCallProperties(const CallBase &I);
749 SmallVector<SDValue, 8> getTargetIntrinsicOperands(
750 const CallBase &I, bool HasChain, bool OnlyLoad,
751 TargetLowering::IntrinsicInfo *TgtMemIntrinsicInfo = nullptr);
752 SDVTList getTargetIntrinsicVTList(const CallBase &I, bool HasChain);
753 SDValue getTargetNonMemIntrinsicNode(const Type &IntrinsicVT, bool HasChain,
755 const SDVTList &VTs);
756 SDValue handleTargetIntrinsicRet(const CallBase &I, bool HasChain,
757 bool OnlyLoad, SDValue Result);
758};
759
760/// This struct represents the registers (physical or virtual)
761/// that a particular set of values is assigned, and the type information about
762/// the value. The most common situation is to represent one value at a time,
763/// but struct or array values are handled element-wise as multiple values. The
764/// splitting of aggregates is performed recursively, so that we never have
765/// aggregate-typed registers. The values at this point do not necessarily have
766/// legal types, so each value may require one or more registers of some legal
767/// type.
768///
770 /// The value types of the values, which may not be legal, and
771 /// may need be promoted or synthesized from one or more registers.
773
774 /// The value types of the registers. This is the same size as ValueVTs and it
775 /// records, for each value, what the type of the assigned register or
776 /// registers are. (Individual values are never synthesized from more than one
777 /// type of register.)
778 ///
779 /// With virtual registers, the contents of RegVTs is redundant with TLI's
780 /// getRegisterType member function, however when with physical registers
781 /// it is necessary to have a separate record of the types.
783
784 /// This list holds the registers assigned to the values.
785 /// Each legal or promoted value requires one register, and each
786 /// expanded value requires multiple registers.
788
789 /// This list holds the number of registers for each value.
791
792 /// Records if this value needs to be treated in an ABI dependant manner,
793 /// different to normal type legalization.
794 std::optional<CallingConv::ID> CallConv;
795
796 RegsForValue() = default;
797 RegsForValue(const SmallVector<Register, 4> &regs, MVT regvt, EVT valuevt,
798 std::optional<CallingConv::ID> CC = std::nullopt);
800 const DataLayout &DL, Register Reg, Type *Ty,
801 std::optional<CallingConv::ID> CC);
802
803 bool isABIMangled() const { return CallConv.has_value(); }
804
805 /// Emit a series of CopyFromReg nodes that copies from this value and returns
806 /// the result as a ValueVTs value. This uses Chain/Flag as the input and
807 /// updates them for the output Chain/Flag. If the Flag pointer is NULL, no
808 /// flag is used.
810 const SDLoc &dl, SDValue &Chain, SDValue *Glue,
811 const Value *V = nullptr) const;
812
813 /// Emit a series of CopyToReg nodes that copies the specified value into the
814 /// registers specified by this object. This uses Chain/Flag as the input and
815 /// updates them for the output Chain/Flag. If the Flag pointer is nullptr, no
816 /// flag is used. If V is not nullptr, then it is used in printing better
817 /// diagnostic messages on error.
818 void getCopyToRegs(SDValue Val, SelectionDAG &DAG, const SDLoc &dl,
819 SDValue &Chain, SDValue *Glue, const Value *V = nullptr,
820 ISD::NodeType PreferredExtendType = ISD::ANY_EXTEND) const;
821
822 /// Add this value to the specified inlineasm node operand list. This adds the
823 /// code marker, matching input operand index (if applicable), and includes
824 /// the number of values added into it.
825 void AddInlineAsmOperands(InlineAsm::Kind Code, bool HasMatching,
826 unsigned MatchingIdx, const SDLoc &dl,
827 SelectionDAG &DAG, std::vector<SDValue> &Ops) const;
828
829 /// Check if the total RegCount is greater than one.
830 bool occupiesMultipleRegs() const {
831 return std::accumulate(RegCount.begin(), RegCount.end(), 0) > 1;
832 }
833
834 /// Return a list of registers and their sizes.
836};
837
838} // end namespace llvm
839
840#endif // LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
return SDValue()
const TargetLowering & TLI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t uint64_t
MachineBasicBlock & MBB
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[]
SmallVector< MachineOperand, 4 > Cond
unsigned Opc
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
This file implements a map that provides insertion order iteration.
uint64_t IntrinsicInst * II
#define P(N)
RISCVCC::CondCode CC
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
Func MI getDebugLoc()))
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
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
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.
Definition Attributes.h:445
LLVM Basic Block Representation.
Definition BasicBlock.h:61
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
static constexpr 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.
Conditional Branch instruction.
This is an important base class in LLVM.
Definition Constant.h:44
This is the common base class for constrained floating point intrinsics.
DWARF expression.
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:63
A debug info location.
Definition DebugLoc.h:126
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.
Definition GCMetadata.h:80
Represents calls to the gc.relocate intrinsic.
Represents calls to the gc.result intrinsic.
Represents a gc.statepoint intrinsic call.
Definition Statepoint.h:61
Indirect Branch Instruction.
Invoke instruction.
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
The landingpad instruction holds all of the information necessary to generate correct exception handl...
An instruction for reading from memory.
Machine Value Type.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
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)
void addSuccessorWithProb(MachineBasicBlock *Src, MachineBasicBlock *Dst, BranchProbability Prob=BranchProbability::getUnknown()) override
SDValue getValue(const Value *V)
getValue - Return an SDValue for the given Value.
bool shouldKeepJumpConditionsTogether(const FunctionLoweringInfo &FuncInfo, const CondBrInst &I, Instruction::BinaryOps Opc, const Value *Lhs, const Value *Rhs, TargetLoweringBase::CondMergingParams Params) const
DenseMap< const Constant *, Register > ConstantsOut
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...
SDValue lowerStartEH(SDValue Chain, const BasicBlock *EHPadBB, MCSymbol *&BeginLabel)
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.
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
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.
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.
SDValue getNonRegisterValue(const Value *V)
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo....
const TargetTransformInfo * TTI
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > LPadToCallSiteMap
Map a landing pad to the call site indexes.
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)
StatepointLoweringState StatepointLowering
State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).
void setValueToPoison(const Value *V, const SDLoc &dl)
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)
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.
GCFunctionInfo * GFI
Garbage collection metadata for the function.
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,...
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...
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.
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)
static const unsigned LowestSDNodeOrder
Lowest valid SDNodeOrder.
FunctionLoweringInfo & FuncInfo
Information about the function as a whole.
void setValue(const Value *V, SDValue NewN)
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
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)
Multiway switch.
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.
Definition Type.h:46
Unconditional Branch instruction.
This function has undefined behavior.
A Use represents the edge between a Value definition and its users.
Definition Use.h:35
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
LLVM Value Representation.
Definition Value.h:75
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
CallInst * Call
#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.
Definition ISDOpcodes.h:43
@ ADD
Simple integer binary arithmetic operators.
Definition ISDOpcodes.h:266
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
Definition ISDOpcodes.h:885
@ FADD
Simple binary floating point operators.
Definition ISDOpcodes.h:420
@ FNEG
Perform various unary floating-point operations inspired by libm.
@ SHL
Shift and rotation operations.
Definition ISDOpcodes.h:793
@ AND
Bitwise operators - logical and, logical or, logical xor.
Definition ISDOpcodes.h:763
std::vector< CaseCluster > CaseClusterVector
SmallVector< SwitchWorkListItem, 4 > SwitchWorkList
ExceptionBehavior
Exception behavior used for floating point operations.
Definition FPEnv.h:39
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr Values
Definition InstrProf.h:91
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:280
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.
Definition ModRef.h:74
TargetTransformInfo TTI
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:879
#define N
Extended Value Type.
Definition ValueTypes.h:35
SmallVector< std::pair< Register, TypeSize >, 4 > getRegsAndSizes() const
Return a list of registers and their sizes.
RegsForValue()=default
SmallVector< unsigned, 4 > RegCount
This list holds the number of registers for each value.
SmallVector< EVT, 4 > ValueVTs
The value types of the values, which may not be legal, and may need be promoted or synthesized from o...
SmallVector< Register, 4 > Regs
This list holds the registers assigned to the values.
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.
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...
bool occupiesMultipleRegs() const
Check if the total RegCount is greater than one.
Print(const Value *V, const DanglingDebugInfo &DDI)
friend raw_ostream & operator<<(raw_ostream &OS, const DanglingDebugInfo::Print &P)
unsigned NumPatchBytes
The number of patchable bytes the call needs to get lowered into.
ArrayRef< const Use > GCTransitionArgs
The list of gc transition arguments present in the gc.statepoint being lowered.
ArrayRef< const Use > GCLives
The full list of gc-live arguments to the gc.statepoint being lowered.
uint64_t StatepointFlags
Flags associated with the meta arguments being lowered.
const BasicBlock * EHPadBB
The exception handling unwind destination, in case this represents an invoke of gc....
ArrayRef< const Use > DeoptState
The deoptimization state associated with this gc.statepoint call, if any.
TargetLowering::CallLoweringInfo CLI
Information regarding the underlying call instruction.
SmallVector< const GCRelocateInst *, 16 > GCRelocates
The set of gc.relocate calls associated with this gc.statepoint.
uint64_t ID
The ID that the resulting STATEPOINT instruction has to report.
const Instruction * StatepointInstr
The gc.statepoint instruction.
SmallVector< const Value *, 16 > Bases
Bases[i] is the base pointer for Ptrs[i].
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.