LLVM: lib/IR/IRBuilder.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
33#include
34#include
35#include
36#include
37
38using namespace llvm;
39
40
41
42
43
45 const Twine &Name,
47 Module *M, bool AddNull) {
49 if (!M)
50 M = BB->getParent()->getParent();
55 GV->setAlignment(M->getDataLayout().getPrefTypeAlign(getInt8Ty()));
56 return GV;
57}
58
60 assert(BB && BB->getParent() && "No current function!");
61 return BB->getParent()->getReturnType();
62}
63
66
67
68
69 I->setDebugLoc(StoredDL.orElse(I->getDebugLoc()));
70}
71
73 Type *SrcTy = V->getType();
74 if (SrcTy == DestTy)
75 return V;
76
77 if (SrcTy->isAggregateType()) {
78 unsigned NumElements;
79 if (SrcTy->isStructTy()) {
82 "Expected StructTypes with equal number of elements");
83 NumElements = SrcTy->getStructNumElements();
84 } else {
85 assert(SrcTy->isArrayTy() && DestTy->isArrayTy() && "Expected ArrayType");
87 "Expected ArrayTypes with equal number of elements");
88 NumElements = SrcTy->getArrayNumElements();
89 }
90
92 for (unsigned I = 0; I < NumElements; ++I) {
97
99 }
100 return Result;
101 }
102
104}
105
113 return CI;
114}
115
117 Value *VScale = B.CreateVScale(Ty);
118 if (Scale == 1)
119 return VScale;
120
121 return B.CreateNUWMul(VScale, ConstantInt::get(Ty, Scale));
122}
123
125 if (EC.isFixed() || EC.isZero())
126 return ConstantInt::get(Ty, EC.getKnownMinValue());
127
129}
130
132 if (Size.isFixed() || Size.isZero())
133 return ConstantInt::get(Ty, Size.getKnownMinValue());
134
136}
137
141 Type *StepVecType = DstType;
142
143
144
146 StepVecType =
149 nullptr, Name);
150 if (StepVecType != DstType)
152 return Res;
153 }
154
156
157
159 for (unsigned i = 0; i < NumEls; ++i)
160 Indices.push_back(ConstantInt::get(STy, i));
161
162
164}
165
171
173
177 return CI;
178}
179
182 bool IsVolatile,
185 Type *Tys[] = {Dst->getType(), Size->getType()};
186
188
189 if (DstAlign)
192 return CI;
193}
194
198
201
203 CreateIntrinsic(Intrinsic::memset_element_unordered_atomic, Tys, Ops);
204
207 return CI;
208}
209
213 bool isVolatile,
215 assert((IntrID == Intrinsic::memcpy || IntrID == Intrinsic::memcpy_inline ||
216 IntrID == Intrinsic::memmove) &&
217 "Unexpected intrinsic ID");
219 Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
220
222
224 if (DstAlign)
225 MCI->setDestAlignment(*DstAlign);
226 if (SrcAlign)
227 MCI->setSourceAlignment(*SrcAlign);
228 MCI->setAAMetadata(AAInfo);
229 return CI;
230}
231
235 assert(DstAlign >= ElementSize &&
236 "Pointer alignment must be at least element size");
237 assert(SrcAlign >= ElementSize &&
238 "Pointer alignment must be at least element size");
240 Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
241
243 CreateIntrinsic(Intrinsic::memcpy_element_unordered_atomic, Tys, Ops);
244
245
247 AMCI->setDestAlignment(DstAlign);
248 AMCI->setSourceAlignment(SrcAlign);
249 AMCI->setAAMetadata(AAInfo);
250 return CI;
251}
252
253
255 assert(Val && "isConstantOne does not work with nullptr Val");
257 return CVal && CVal->isOne();
258}
259
264
265
266
267
268 if (!ArraySize)
269 ArraySize = ConstantInt::get(IntPtrTy, 1);
270 else if (ArraySize->getType() != IntPtrTy)
271 ArraySize = CreateIntCast(ArraySize, IntPtrTy, false);
272
275 AllocSize = ArraySize;
276 } else {
277
278 AllocSize = CreateMul(ArraySize, AllocSize, "mallocsize");
279 }
280 }
281
282 assert(AllocSize->getType() == IntPtrTy && "malloc arg is wrong size");
283
284 Module *M = BB->getParent()->getParent();
287 if (!MallocFunc)
288
289 MallocFunc = M->getOrInsertFunction("malloc", BPTy, IntPtrTy);
291
295 F->setReturnDoesNotAlias();
296 }
297
299
300 return MCall;
301}
302
306
307 return CreateMalloc(IntPtrTy, AllocTy, AllocSize, ArraySize, {}, MallocF,
308 Name);
309}
310
311
314 assert(Source->getType()->isPointerTy() &&
315 "Can not free something of nonpointer type!");
316
317 Module *M = BB->getParent()->getParent();
318
321
322 FunctionCallee FreeFunc = M->getOrInsertFunction("free", VoidTy, VoidPtrTy);
324 Result->setTailCall();
326 Result->setCallingConv(F->getCallingConv());
327
328 return Result;
329}
330
334 assert(DstAlign >= ElementSize &&
335 "Pointer alignment must be at least element size");
336 assert(SrcAlign >= ElementSize &&
337 "Pointer alignment must be at least element size");
339 Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
340
342 CreateIntrinsic(Intrinsic::memmove_element_unordered_atomic, Tys, Ops);
343
344
348 return CI;
349}
350
353 Type *Tys[] = { Src->getType() };
355}
356
361
366
368 return getReductionIntrinsic(Intrinsic::vector_reduce_add, Src);
369}
370
372 return getReductionIntrinsic(Intrinsic::vector_reduce_mul, Src);
373}
374
376 return getReductionIntrinsic(Intrinsic::vector_reduce_and, Src);
377}
378
380 return getReductionIntrinsic(Intrinsic::vector_reduce_or, Src);
381}
382
384 return getReductionIntrinsic(Intrinsic::vector_reduce_xor, Src);
385}
386
388 auto ID =
389 IsSigned ? Intrinsic::vector_reduce_smax : Intrinsic::vector_reduce_umax;
390 return getReductionIntrinsic(ID, Src);
391}
392
394 auto ID =
395 IsSigned ? Intrinsic::vector_reduce_smin : Intrinsic::vector_reduce_umin;
396 return getReductionIntrinsic(ID, Src);
397}
398
400 return getReductionIntrinsic(Intrinsic::vector_reduce_fmax, Src);
401}
402
404 return getReductionIntrinsic(Intrinsic::vector_reduce_fmin, Src);
405}
406
408 return getReductionIntrinsic(Intrinsic::vector_reduce_fmaximum, Src);
409}
410
412 return getReductionIntrinsic(Intrinsic::vector_reduce_fminimum, Src);
413}
414
417 "lifetime.start only applies to pointers.");
419}
420
423 "lifetime.end only applies to pointers.");
425}
426
428
430 "invariant.start only applies to pointers.");
433 else
435 "invariant.start requires the size to be an i64");
436
438
441}
442
445 return V->getAlign();
447 return getAlign(A->getAliaseeObject());
448 return {};
449}
450
453 "threadlocal_address only applies to thread local variables.");
455 {Ptr->getType()}, {Ptr});
459 }
460 return CI;
461}
462
467 "an assumption condition must be of type i1");
468
470 Module *M = BB->getParent()->getParent();
473}
474
476 return CreateIntrinsic(Intrinsic::experimental_noalias_scope_decl, {},
477 {Scope});
478}
479
480
481
482
483
484
485
486
487
488
491 const Twine &Name) {
493 assert(Ty->isVectorTy() && "Type should be vector");
494 assert(Mask && "Mask should not be all-ones (null)");
495 if (!PassThru)
497 Type *OverloadedTypes[] = { Ty, PtrTy };
498 Value *Ops[] = {Ptr, Mask, PassThru};
500 CreateMaskedIntrinsic(Intrinsic::masked_load, Ops, OverloadedTypes, Name);
502 return CI;
503}
504
505
506
507
508
509
510
516 assert(Mask && "Mask should not be all-ones (null)");
517 Type *OverloadedTypes[] = { DataTy, PtrTy };
518 Value *Ops[] = {Val, Ptr, Mask};
520 CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, OverloadedTypes);
522 return CI;
523}
524
525
526
527
531 const Twine &Name) {
533}
534
535
536
537
538
539
540
541
542
543
547 const Twine &Name) {
549 ElementCount NumElts = VecTy->getElementCount();
551 assert(NumElts == PtrsTy->getElementCount() && "Element count mismatch");
552
553 if (!Mask)
555
556 if (!PassThru)
558
559 Type *OverloadedTypes[] = {Ty, PtrsTy};
560 Value *Ops[] = {Ptrs, Mask, PassThru};
561
562
563
564 CallInst *CI = CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops,
565 OverloadedTypes, Name);
567 return CI;
568}
569
570
571
572
573
574
575
576
581 ElementCount NumElts = PtrsTy->getElementCount();
582
583 if (!Mask)
585
586 Type *OverloadedTypes[] = {DataTy, PtrsTy};
588
589
590
592 CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, OverloadedTypes);
594 return CI;
595}
596
597
598
599
600
601
602
603
604
605
609 const Twine &Name) {
610 assert(Ty->isVectorTy() && "Type should be vector");
611 assert(Mask && "Mask should not be all-ones (null)");
612 if (!PassThru)
614 Type *OverloadedTypes[] = {Ty};
615 Value *Ops[] = {Ptr, Mask, PassThru};
616 CallInst *CI = CreateMaskedIntrinsic(Intrinsic::masked_expandload, Ops,
617 OverloadedTypes, Name);
620 return CI;
621}
622
623
624
625
626
627
628
634 assert(Mask && "Mask should not be all-ones (null)");
635 Type *OverloadedTypes[] = {DataTy};
636 Value *Ops[] = {Val, Ptr, Mask};
637 CallInst *CI = CreateMaskedIntrinsic(Intrinsic::masked_compressstore, Ops,
638 OverloadedTypes);
641 return CI;
642}
643
644template
645static std::vector<Value *>
648 std::vector<Value *> Args;
649 Args.push_back(B.getInt64(ID));
650 Args.push_back(B.getInt32(NumPatchBytes));
651 Args.push_back(ActualCallee);
652 Args.push_back(B.getInt32(CallArgs.size()));
653 Args.push_back(B.getInt32(Flags));
655
656
657 Args.push_back(B.getInt32(0));
658 Args.push_back(B.getInt32(0));
659
660 return Args;
661}
662
663template<typename T1, typename T2, typename T3>
664static std::vector
668 std::vector Rval;
669 if (DeoptArgs)
671 if (TransitionArgs)
672 Rval.emplace_back("gc-transition",
674 if (GCArgs.size())
676 return Rval;
677}
678
679template <typename T0, typename T1, typename T2, typename T3>
685 const Twine &Name) {
686 Module *M = Builder->GetInsertBlock()->getParent()->getParent();
687
689 M, Intrinsic::experimental_gc_statepoint,
691
693 *Builder, ID, NumPatchBytes, ActualCallee.getCallee(), Flags, CallArgs);
694
695 CallInst *CI = Builder->CreateCall(
696 FnStatepoint, Args,
699 Attribute::get(Builder->getContext(), Attribute::ElementType,
701 return CI;
702}
703
710 CallArgs, std::nullopt , DeoptArgs, GCArgs, Name);
711}
712
718 const Twine &Name) {
720 this, ID, NumPatchBytes, ActualCallee, Flags, CallArgs, TransitionArgs,
721 DeoptArgs, GCArgs, Name);
722}
723
730 CallArgs, std::nullopt, DeoptArgs, GCArgs, Name);
731}
732
733template <typename T0, typename T1, typename T2, typename T3>
740 const Twine &Name) {
741 Module *M = Builder->GetInsertBlock()->getParent()->getParent();
742
744 M, Intrinsic::experimental_gc_statepoint,
746
747 std::vector<Value *> Args =
749 Flags, InvokeArgs);
750
752 FnStatepoint, NormalDest, UnwindDest, Args,
754 II->addParamAttr(2,
755 Attribute::get(Builder->getContext(), Attribute::ElementType,
757 return II;
758}
759
766 this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
768 std::nullopt , DeoptArgs, GCArgs, Name);
769}
770
776 const Twine &Name) {
778 this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest, Flags,
779 InvokeArgs, TransitionArgs, DeoptArgs, GCArgs, Name);
780}
781
786 const Twine &Name) {
788 this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
790 GCArgs, Name);
791}
792
794 Type *ResultType, const Twine &Name) {
796 Type *Types[] = {ResultType};
797
798 Value *Args[] = {Statepoint};
800}
801
803 int BaseOffset, int DerivedOffset,
804 Type *ResultType, const Twine &Name) {
805 Type *Types[] = {ResultType};
806
808 return CreateIntrinsic(Intrinsic::experimental_gc_relocate, Types, Args, {},
809 Name);
810}
811
813 const Twine &Name) {
815 return CreateIntrinsic(Intrinsic::experimental_gc_get_pointer_base,
816 {PtrTy, PtrTy}, {DerivedPtr}, {}, Name);
817}
818
820 const Twine &Name) {
822 return CreateIntrinsic(Intrinsic::experimental_gc_get_pointer_offset, {PtrTy},
823 {DerivedPtr}, {}, Name);
824}
825
828 const Twine &Name) {
831 return createCallHelper(Fn, {V}, Name, FMFSource);
832}
833
836 const Twine &Name) {
840 nullptr))
841 return V;
842 return createCallHelper(Fn, {LHS, RHS}, Name, FMFSource);
843}
844
849 const Twine &Name) {
852 return createCallHelper(Fn, Args, Name, FMFSource);
853}
854
858 const Twine &Name) {
860
862 ArgTys.reserve(Args.size());
863 for (auto &I : Args)
865
867 return createCallHelper(Fn, Args, Name, FMFSource);
868}
869
872 const Twine &Name, MDNode *FPMathTag, std::optional Rounding,
873 std::optionalfp::ExceptionBehavior Except) {
874 Value *RoundingV = getConstrainedFPRounding(Rounding);
875 Value *ExceptV = getConstrainedFPExcept(Except);
876
878
880 {L, R, RoundingV, ExceptV}, nullptr, Name);
882 setFPAttrs(C, FPMathTag, UseFMF);
883 return C;
884}
885
889 std::optional Rounding,
890 std::optionalfp::ExceptionBehavior Except) {
891 Value *RoundingV = getConstrainedFPRounding(Rounding);
892 Value *ExceptV = getConstrainedFPExcept(Except);
893
895
899
902 setFPAttrs(C, FPMathTag, UseFMF);
903 return C;
904}
905
909 std::optionalfp::ExceptionBehavior Except) {
910 Value *ExceptV = getConstrainedFPExcept(Except);
911
913
915 CreateIntrinsic(ID, {L->getType()}, {L, R, ExceptV}, nullptr, Name);
917 setFPAttrs(C, FPMathTag, UseFMF);
918 return C;
919}
920
924 assert(Ops.size() == 2 && "Invalid number of operands!");
926 Ops[0], Ops[1], Name, FPMathTag);
927 }
929 assert(Ops.size() == 1 && "Invalid number of operands!");
931 Ops[0], Name, FPMathTag);
932 }
934}
935
938 const Twine &Name, MDNode *FPMathTag, std::optional Rounding,
939 std::optionalfp::ExceptionBehavior Except) {
940 Value *ExceptV = getConstrainedFPExcept(Except);
941
943
946 Value *RoundingV = getConstrainedFPRounding(Rounding);
947 C = CreateIntrinsic(ID, {DestTy, V->getType()}, {V, RoundingV, ExceptV},
948 nullptr, Name);
949 } else
950 C = CreateIntrinsic(ID, {DestTy, V->getType()}, {V, ExceptV}, nullptr,
951 Name);
952
954
956 setFPAttrs(C, FPMathTag, UseFMF);
957 return C;
958}
959
963 bool IsSignaling) {
965 auto ID = IsSignaling ? Intrinsic::experimental_constrained_fcmps
966 : Intrinsic::experimental_constrained_fcmp;
968 }
969
971 return V;
974 Name);
975}
976
979 const Twine &Name, std::optionalfp::ExceptionBehavior Except) {
980 Value *PredicateV = getConstrainedFPPredicate(P);
981 Value *ExceptV = getConstrainedFPExcept(Except);
982
984 {L, R, PredicateV, ExceptV}, nullptr, Name);
986 return C;
987}
988
991 std::optional Rounding,
992 std::optionalfp::ExceptionBehavior Except) {
994
996 UseArgs.push_back(getConstrainedFPRounding(Rounding));
997 UseArgs.push_back(getConstrainedFPExcept(Except));
998
1001 return C;
1002}
1003
1007 const Twine &Name) {
1011 }
1012 return Ret;
1013}
1014
1019
1023 if (auto *V = Folder.FoldSelect(C, True, False))
1024 return V;
1025
1027 if (MDFrom) {
1029 MDNode *Unpred = MDFrom->getMetadata(LLVMContext::MD_unpredictable);
1030 Sel = addBranchMetadata(Sel, Prof, Unpred);
1031 }
1033 setFPAttrs(Sel, nullptr, FMFSource.get(FMF));
1034 return Insert(Sel, Name);
1035}
1036
1038 const Twine &Name) {
1039 assert(LHS->getType() == RHS->getType() &&
1040 "Pointer subtraction operand types must match!");
1045 Name);
1046}
1047
1050 "launder.invariant.group only applies to pointers.");
1051 auto *PtrType = Ptr->getType();
1052 Module *M = BB->getParent()->getParent();
1054 M, Intrinsic::launder_invariant_group, {PtrType});
1055
1058 PtrType &&
1059 "LaunderInvariantGroup should take and return the same type");
1060
1061 return CreateCall(FnLaunderInvariantGroup, {Ptr});
1062}
1063
1066 "strip.invariant.group only applies to pointers.");
1067
1068 auto *PtrType = Ptr->getType();
1069 Module *M = BB->getParent()->getParent();
1071 M, Intrinsic::strip_invariant_group, {PtrType});
1072
1075 PtrType &&
1076 "StripInvariantGroup should take and return the same type");
1077
1078 return CreateCall(FnStripInvariantGroup, {Ptr});
1079}
1080
1084 Module *M = BB->getParent()->getParent();
1088 }
1089
1091 int NumElts = Ty->getElementCount().getKnownMinValue();
1092 for (int i = 0; i < NumElts; ++i)
1093 ShuffleMask.push_back(NumElts - i - 1);
1095}
1096
1098 const Twine &Name) {
1101 "Splice expects matching operand types!");
1102
1104 Module *M = BB->getParent()->getParent();
1107
1110 }
1111
1113 assert(((-Imm <= NumElts) || (Imm < NumElts)) &&
1114 "Invalid immediate for vector splice!");
1115
1116
1117 unsigned Idx = (NumElts + Imm) % NumElts;
1119 for (unsigned I = 0; I < NumElts; ++I)
1120 Mask.push_back(Idx + I);
1121
1123}
1124
1126 const Twine &Name) {
1129}
1130
1132 const Twine &Name) {
1133 assert(EC.isNonZero() && "Cannot splat to an empty vector!");
1134
1135
1138
1139
1141 Zeros.resize(EC.getKnownMinValue());
1143}
1144
1146 const Twine &Name) {
1147 assert(Ops.size() >= 2 && Ops.size() <= 8 &&
1148 "Unexpected number of operands to interleave");
1149
1150
1152
1153#ifndef NDEBUG
1154 for (unsigned I = 1; I < Ops.size(); I++) {
1156 "Vector interleave expects matching operand types!");
1157 }
1158#endif
1159
1163 SubvecTy->getElementCount() * Ops.size());
1165}
1166
1168 unsigned Dimension,
1169 unsigned LastIndex,
1173 "Invalid Base ptr type for preserve.array.access.index.");
1174
1179
1181
1185 {ResultType, BaseType}, {Base, DimV, LastIndexV});
1188 if (DbgInfo)
1189 Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
1190
1191 return Fn;
1192}
1193
1197 "Invalid Base ptr type for preserve.union.access.index.");
1199
1203 if (DbgInfo)
1204 Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
1205
1206 return Fn;
1207}
1208
1210 Type *ElTy, Value *Base, unsigned Index, unsigned FieldIndex,
1214 "Invalid Base ptr type for preserve.struct.access.index.");
1215
1218 Type *ResultType =
1220
1223 CreateIntrinsic(Intrinsic::preserve_struct_access_index,
1224 {ResultType, BaseType}, {Base, GEPIndex, DIIndex});
1227 if (DbgInfo)
1228 Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
1229
1230 return Fn;
1231}
1232
1236 {FPNum, TestV});
1237}
1238
1239CallInst *IRBuilderBase::CreateAlignmentAssumptionHelper(const DataLayout &DL,
1240 Value *PtrValue,
1241 Value *AlignValue,
1242 Value *OffsetValue) {
1244 if (OffsetValue)
1248}
1249
1251 Value *PtrValue,
1252 unsigned Alignment,
1253 Value *OffsetValue) {
1255 "trying to create an alignment assumption on a non-pointer?");
1256 assert(Alignment != 0 && "Invalid Alignment");
1259 Value *AlignValue = ConstantInt::get(IntPtrTy, Alignment);
1260 return CreateAlignmentAssumptionHelper(DL, PtrValue, AlignValue, OffsetValue);
1261}
1262
1264 Value *PtrValue,
1265 Value *Alignment,
1266 Value *OffsetValue) {
1268 "trying to create an alignment assumption on a non-pointer?");
1269 return CreateAlignmentAssumptionHelper(DL, PtrValue, Alignment, OffsetValue);
1270}
1271
1273 Value *SizeValue) {
1275 "trying to create an deferenceable assumption on a non-pointer?");
1279 {DereferenceableOpB});
1280}
1281
1285void ConstantFolder::anchor() {}
1286void NoFolder::anchor() {}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static bool isConstantOne(const Value *Val)
isConstantOne - Return true only if val is constant int 1
Definition IRBuilder.cpp:254
static InvokeInst * CreateGCStatepointInvokeCommon(IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags, ArrayRef< T0 > InvokeArgs, std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)
Definition IRBuilder.cpp:734
static CallInst * CreateGCStatepointCallCommon(IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs, std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)
Definition IRBuilder.cpp:680
static Value * CreateVScaleMultiple(IRBuilderBase &B, Type *Ty, uint64_t Scale)
Definition IRBuilder.cpp:116
static std::vector< OperandBundleDef > getStatepointBundles(std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs)
Definition IRBuilder.cpp:665
static std::vector< Value * > getStatepointArgs(IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs)
Definition IRBuilder.cpp:646
Module.h This file contains the declarations for the Module class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
uint64_t IntrinsicInst * II
This file contains the declarations for profiling metadata utility functions.
const SmallVectorImpl< MachineOperand > & Cond
static SymbolRef::Type getType(const Symbol *Sym)
static const char PassName[]
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
static LLVM_ABI Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
LLVM Basic Block Representation.
void setCallingConv(CallingConv::ID CC)
void addRetAttr(Attribute::AttrKind Kind)
Adds the attribute to the return value.
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
This class represents a function call, abstracting a target machine's calling convention.
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
void setTailCall(bool IsTc=true)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static LLVM_ABI Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
static LLVM_ABI Constant * getSizeOf(Type *Ty)
getSizeOf constant expr - computes the (alloc) size of a type (in address-units, not bits) in a targe...
This is the shared class of boolean and integer constants.
bool isOne() const
This is just a convenience method to make client code smaller for a common case.
static LLVM_ABI ConstantInt * getTrue(LLVMContext &Context)
static LLVM_ABI Constant * get(ArrayRef< Constant * > V)
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
static constexpr ElementCount getFixed(ScalarTy MinVal)
This instruction compares its operands according to the predicate given to the constructor.
This provides a helper for copying FMF from an instruction or setting specified flags.
FastMathFlags get(FastMathFlags Default) const
Convenience struct for specifying and reasoning about fast-math flags.
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
FunctionType * getFunctionType()
Type * getParamType(unsigned i) const
Parameter type accessors.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Type * getReturnType() const
Returns the type of the ret val.
static Type * getGEPReturnType(Value *Ptr, ArrayRef< Value * > IdxList)
Returns the pointer type returned by the GEP instruction, which may be a vector of pointers.
@ PrivateLinkage
Like Internal, but omit from symbol table.
Common base class shared among various IRBuilders.
Value * CreateExactSDiv(Value *LHS, Value *RHS, const Twine &Name="")
ConstantInt * getInt1(bool V)
Get a constant value representing either true or false.
LLVM_ABI Value * CreatePtrDiff(Type *ElemTy, Value *LHS, Value *RHS, const Twine &Name="")
Return the i64 difference between two pointer values, dividing out the size of the pointed-to objects...
Definition IRBuilder.cpp:1037
LLVM_ABI CallInst * CreateMulReduce(Value *Src)
Create a vector int mul reduction intrinsic of the source vector.
Definition IRBuilder.cpp:371
LLVM_ABI CallInst * CreateFAddReduce(Value *Acc, Value *Src)
Create a sequential vector fadd reduction intrinsic of the source vector.
Definition IRBuilder.cpp:357
LLVM_ABI Value * CreateLaunderInvariantGroup(Value *Ptr)
Create a launder.invariant.group intrinsic call.
Definition IRBuilder.cpp:1048
LLVM_ABI CallInst * CreateConstrainedFPUnroundedBinOp(Intrinsic::ID ID, Value *L, Value *R, FMFSource FMFSource={}, const Twine &Name="", MDNode *FPMathTag=nullptr, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
Definition IRBuilder.cpp:906
Value * CreateInsertElement(Type *VecTy, Value *NewElt, Value *Idx, const Twine &Name="")
LLVM_ABI CallInst * CreateThreadLocalAddress(Value *Ptr)
Create a call to llvm.threadlocal.address intrinsic.
Definition IRBuilder.cpp:451
IntegerType * getInt1Ty()
Fetch the type representing a single bit.
LLVM_ABI CallInst * CreateMaskedCompressStore(Value *Val, Value *Ptr, MaybeAlign Align, Value *Mask=nullptr)
Create a call to Masked Compress Store intrinsic.
Definition IRBuilder.cpp:629
Value * CreateInsertValue(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &Name="")
LLVM_ABI Type * getCurrentFunctionReturnType() const
Get the return type of the current function that we're emitting into.
Definition IRBuilder.cpp:59
LLVM_ABI CallInst * CreateGCGetPointerBase(Value *DerivedPtr, const Twine &Name="")
Create a call to the experimental.gc.pointer.base intrinsic to get the base pointer for the specified...
Definition IRBuilder.cpp:812
LLVM_ABI CallInst * CreateLifetimeStart(Value *Ptr)
Create a lifetime.start intrinsic.
Definition IRBuilder.cpp:415
LLVM_ABI CallInst * CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee, ArrayRef< Value * > CallArgs, std::optional< ArrayRef< Value * > > DeoptArgs, ArrayRef< Value * > GCArgs, const Twine &Name="")
Create a call to the experimental.gc.statepoint intrinsic to start a new statepoint sequence.
Definition IRBuilder.cpp:704
LLVM_ABI CallInst * CreateLifetimeEnd(Value *Ptr)
Create a lifetime.end intrinsic.
Definition IRBuilder.cpp:421
LLVM_ABI CallInst * CreateConstrainedFPCmp(Intrinsic::ID ID, CmpInst::Predicate P, Value *L, Value *R, const Twine &Name="", std::optional< fp::ExceptionBehavior > Except=std::nullopt)
Definition IRBuilder.cpp:977
LLVM_ABI Value * CreateSelectFMF(Value *C, Value *True, Value *False, FMFSource FMFSource, const Twine &Name="", Instruction *MDFrom=nullptr)
Definition IRBuilder.cpp:1020
LLVM_ABI CallInst * CreateAndReduce(Value *Src)
Create a vector int AND reduction intrinsic of the source vector.
Definition IRBuilder.cpp:375
LLVM_ABI Value * CreateVectorSplice(Value *V1, Value *V2, int64_t Imm, const Twine &Name="")
Return a vector splice intrinsic if using scalable vectors, otherwise return a shufflevector.
Definition IRBuilder.cpp:1097
LLVM_ABI CallInst * CreateAssumption(Value *Cond, ArrayRef< OperandBundleDef > OpBundles={})
Create an assume intrinsic call that allows the optimizer to assume that the provided condition will ...
Definition IRBuilder.cpp:464
LLVM_ABI Value * CreateVectorSplat(unsigned NumElts, Value *V, const Twine &Name="")
Return a vector value that contains.
Definition IRBuilder.cpp:1125
Value * CreateExtractValue(Value *Agg, ArrayRef< unsigned > Idxs, const Twine &Name="")
LLVM_ABI Value * CreatePreserveStructAccessIndex(Type *ElTy, Value *Base, unsigned Index, unsigned FieldIndex, MDNode *DbgInfo)
Definition IRBuilder.cpp:1209
LLVM_ABI CallInst * CreateAlignmentAssumption(const DataLayout &DL, Value *PtrValue, unsigned Alignment, Value *OffsetValue=nullptr)
Create an assume intrinsic call that represents an alignment assumption on the provided pointer.
Definition IRBuilder.cpp:1250
LLVM_ABI CallInst * CreateMaskedLoad(Type *Ty, Value *Ptr, Align Alignment, Value *Mask, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Load intrinsic.
Definition IRBuilder.cpp:489
LLVM_ABI CallInst * CreateConstrainedFPCall(Function *Callee, ArrayRef< Value * > Args, const Twine &Name="", std::optional< RoundingMode > Rounding=std::nullopt, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
Definition IRBuilder.cpp:989
LLVM_ABI Value * CreateSelect(Value *C, Value *True, Value *False, const Twine &Name="", Instruction *MDFrom=nullptr)
Definition IRBuilder.cpp:1015
LLVM_ABI CallInst * CreateGCGetPointerOffset(Value *DerivedPtr, const Twine &Name="")
Create a call to the experimental.gc.get.pointer.offset intrinsic to get the offset of the specified ...
Definition IRBuilder.cpp:819
LLVM_ABI CallInst * CreateAddReduce(Value *Src)
Create a vector int add reduction intrinsic of the source vector.
Definition IRBuilder.cpp:367
LLVM_ABI CallInst * CreateConstrainedFPBinOp(Intrinsic::ID ID, Value *L, Value *R, FMFSource FMFSource={}, const Twine &Name="", MDNode *FPMathTag=nullptr, std::optional< RoundingMode > Rounding=std::nullopt, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
Definition IRBuilder.cpp:870
IntegerType * getIntPtrTy(const DataLayout &DL, unsigned AddrSpace=0)
Fetch the type of an integer with size at least as big as that of a pointer in the given address spac...
LLVM_ABI Value * CreateAggregateCast(Value *V, Type *DestTy)
Cast between aggregate types that must have identical structure but may differ in their leaf types.
Definition IRBuilder.cpp:72
IntegerType * getInt64Ty()
Fetch the type representing a 64-bit integer.
LLVM_ABI CallInst * CreateElementUnorderedAtomicMemMove(Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size, uint32_t ElementSize, const AAMDNodes &AAInfo=AAMDNodes())
Create and insert an element unordered-atomic memmove between the specified pointers.
Definition IRBuilder.cpp:331
LLVM_ABI Value * CreateVectorReverse(Value *V, const Twine &Name="")
Return a vector value that contains the vector V reversed.
Definition IRBuilder.cpp:1081
LLVM_ABI CallInst * CreateXorReduce(Value *Src)
Create a vector int XOR reduction intrinsic of the source vector.
Definition IRBuilder.cpp:383
ConstantInt * getInt64(uint64_t C)
Get a constant 64-bit value.
Value * getAllOnesMask(ElementCount NumElts)
Return an all true boolean vector (mask) with NumElts lanes.
Value * CreateUnOp(Instruction::UnaryOps Opc, Value *V, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI CallInst * CreateOrReduce(Value *Src)
Create a vector int OR reduction intrinsic of the source vector.
Definition IRBuilder.cpp:379
LLVM_ABI CallInst * CreateMalloc(Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize, ArrayRef< OperandBundleDef > OpB, Function *MallocF=nullptr, const Twine &Name="")
Definition IRBuilder.cpp:260
LLVM_ABI CallInst * CreateFPMinReduce(Value *Src)
Create a vector float min reduction intrinsic of the source vector.
Definition IRBuilder.cpp:403
LLVM_ABI CallInst * CreateFPMaximumReduce(Value *Src)
Create a vector float maximum reduction intrinsic of the source vector.
Definition IRBuilder.cpp:407
LLVM_ABI Value * CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with 2 operands which is mangled on the first type.
Definition IRBuilder.cpp:834
LLVM_ABI Value * createIsFPClass(Value *FPNum, unsigned Test)
Definition IRBuilder.cpp:1233
LLVM_ABI CallInst * CreateIntrinsic(Intrinsic::ID ID, ArrayRef< Type * > Types, ArrayRef< Value * > Args, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with Args, mangled using Types.
Definition IRBuilder.cpp:845
LLVM_ABI CallInst * CreateFPMaxReduce(Value *Src)
Create a vector float max reduction intrinsic of the source vector.
Definition IRBuilder.cpp:399
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
LLVM_ABI CallInst * CreateFree(Value *Source, ArrayRef< OperandBundleDef > Bundles={})
Generate the IR for a call to the builtin free function.
Definition IRBuilder.cpp:312
Value * CreateBitOrPointerCast(Value *V, Type *DestTy, const Twine &Name="")
InstTy * Insert(InstTy *I, const Twine &Name="") const
Insert and return the specified instruction.
LLVM_ABI DebugLoc getCurrentDebugLocation() const
Get location information used by debugging information.
Definition IRBuilder.cpp:64
Value * CreateSub(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
LLVM_ABI CallInst * CreateUnaryIntrinsic(Intrinsic::ID ID, Value *V, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with 1 operand which is mangled on its type.
Definition IRBuilder.cpp:826
CallInst * CreateElementUnorderedAtomicMemSet(Value *Ptr, Value *Val, uint64_t Size, Align Alignment, uint32_t ElementSize, const AAMDNodes &AAInfo=AAMDNodes())
Create and insert an element unordered-atomic memset of the region of memory starting at the given po...
CallInst * CreateMemSet(Value *Ptr, Value *Val, uint64_t Size, MaybeAlign Align, bool isVolatile=false, const AAMDNodes &AAInfo=AAMDNodes())
Create and insert a memset to the specified pointer and the specified value.
LLVM_ABI Value * CreateNAryOp(unsigned Opc, ArrayRef< Value * > Ops, const Twine &Name="", MDNode *FPMathTag=nullptr)
Create either a UnaryOperator or BinaryOperator depending on Opc.
Definition IRBuilder.cpp:921
LLVM_ABI CallInst * CreateConstrainedFPIntrinsic(Intrinsic::ID ID, ArrayRef< Type * > Types, ArrayRef< Value * > Args, FMFSource FMFSource, const Twine &Name, MDNode *FPMathTag=nullptr, std::optional< RoundingMode > Rounding=std::nullopt, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
This function is like CreateIntrinsic for constrained fp intrinsics.
Definition IRBuilder.cpp:886
Value * CreateShuffleVector(Value *V1, Value *V2, Value *Mask, const Twine &Name="")
LLVMContext & getContext() const
LLVM_ABI Value * CreatePreserveUnionAccessIndex(Value *Base, unsigned FieldIndex, MDNode *DbgInfo)
Definition IRBuilder.cpp:1194
LLVM_ABI CallInst * CreateIntMaxReduce(Value *Src, bool IsSigned=false)
Create a vector integer max reduction intrinsic of the source vector.
Definition IRBuilder.cpp:387
LLVM_ABI Value * CreateSelectWithUnknownProfile(Value *C, Value *True, Value *False, StringRef PassName, const Twine &Name="")
Definition IRBuilder.cpp:1004
LLVM_ABI CallInst * CreateMaskedStore(Value *Val, Value *Ptr, Align Alignment, Value *Mask)
Create a call to Masked Store intrinsic.
Definition IRBuilder.cpp:511
Value * CreatePtrToInt(Value *V, Type *DestTy, const Twine &Name="")
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value * > Args={}, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI CallInst * CreateGCResult(Instruction *Statepoint, Type *ResultType, const Twine &Name="")
Create a call to the experimental.gc.result intrinsic to extract the result from a call wrapped in a ...
Definition IRBuilder.cpp:793
Value * CreateTrunc(Value *V, Type *DestTy, const Twine &Name="", bool IsNUW=false, bool IsNSW=false)
Value * CreateBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI Value * CreateTypeSize(Type *Ty, TypeSize Size)
Create an expression which evaluates to the number of units in Size at runtime.
Definition IRBuilder.cpp:131
LLVM_ABI CallInst * CreateDereferenceableAssumption(Value *PtrValue, Value *SizeValue)
Create an assume intrinsic call that represents an dereferencable assumption on the provided pointer.
Definition IRBuilder.cpp:1272
Value * CreateIntCast(Value *V, Type *DestTy, bool isSigned, const Twine &Name="")
LLVM_ABI CallInst * CreateIntMinReduce(Value *Src, bool IsSigned=false)
Create a vector integer min reduction intrinsic of the source vector.
Definition IRBuilder.cpp:393
LLVM_ABI CallInst * CreateElementUnorderedAtomicMemCpy(Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size, uint32_t ElementSize, const AAMDNodes &AAInfo=AAMDNodes())
Create and insert an element unordered-atomic memcpy between the specified pointers.
Definition IRBuilder.cpp:232
void setConstrainedFPCallAttr(CallBase *I)
LLVM_ABI InvokeInst * CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, ArrayRef< Value * > InvokeArgs, std::optional< ArrayRef< Value * > > DeoptArgs, ArrayRef< Value * > GCArgs, const Twine &Name="")
Create an invoke to the experimental.gc.statepoint intrinsic to start a new statepoint sequence.
Definition IRBuilder.cpp:760
LLVM_ABI CallInst * CreateMaskedExpandLoad(Type *Ty, Value *Ptr, MaybeAlign Align, Value *Mask=nullptr, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Expand Load intrinsic.
Definition IRBuilder.cpp:606
const IRBuilderFolder & Folder
LLVM_ABI CallInst * CreateMemTransferInst(Intrinsic::ID IntrID, Value *Dst, MaybeAlign DstAlign, Value *Src, MaybeAlign SrcAlign, Value *Size, bool isVolatile=false, const AAMDNodes &AAInfo=AAMDNodes())
Definition IRBuilder.cpp:210
LLVM_ABI Value * CreateVectorInterleave(ArrayRef< Value * > Ops, const Twine &Name="")
Definition IRBuilder.cpp:1145
LLVM_ABI CallInst * CreateFMulReduce(Value *Acc, Value *Src)
Create a sequential vector fmul reduction intrinsic of the source vector.
Definition IRBuilder.cpp:362
LLVM_ABI CallInst * CreateMemSetInline(Value *Dst, MaybeAlign DstAlign, Value *Val, Value *Size, bool IsVolatile=false, const AAMDNodes &AAInfo=AAMDNodes())
Definition IRBuilder.cpp:180
LLVM_ABI void SetInstDebugLocation(Instruction *I) const
If this builder has a current debug location, set it on the specified instruction.
Definition IRBuilder.cpp:65
IntegerType * getInt8Ty()
Fetch the type representing an 8-bit integer.
LLVM_ABI CallInst * CreateGCRelocate(Instruction *Statepoint, int BaseOffset, int DerivedOffset, Type *ResultType, const Twine &Name="")
Create a call to the experimental.gc.relocate intrinsics to project the relocated value of one pointe...
Definition IRBuilder.cpp:802
LLVM_ABI Value * CreateStepVector(Type *DstType, const Twine &Name="")
Creates a vector of type DstType with the linear sequence <0, 1, ...>
Definition IRBuilder.cpp:138
LLVM_ABI Value * CreatePreserveArrayAccessIndex(Type *ElTy, Value *Base, unsigned Dimension, unsigned LastIndex, MDNode *DbgInfo)
Definition IRBuilder.cpp:1167
LLVM_ABI CallInst * CreateInvariantStart(Value *Ptr, ConstantInt *Size=nullptr)
Create a call to invariant.start intrinsic.
Definition IRBuilder.cpp:427
Value * CreateMul(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
LLVM_ABI Instruction * CreateNoAliasScopeDeclaration(Value *Scope)
Create a llvm.experimental.noalias.scope.decl intrinsic call.
Definition IRBuilder.cpp:475
LLVM_ABI CallInst * CreateMaskedScatter(Value *Val, Value *Ptrs, Align Alignment, Value *Mask=nullptr)
Create a call to Masked Scatter intrinsic.
Definition IRBuilder.cpp:577
LLVM_ABI GlobalVariable * CreateGlobalString(StringRef Str, const Twine &Name="", unsigned AddressSpace=0, Module *M=nullptr, bool AddNull=true)
Make a new global variable with initializer type i8*.
Definition IRBuilder.cpp:44
LLVM_ABI Value * CreateElementCount(Type *Ty, ElementCount EC)
Create an expression which evaluates to the number of elements in EC at runtime.
Definition IRBuilder.cpp:124
LLVM_ABI CallInst * CreateFPMinimumReduce(Value *Src)
Create a vector float minimum reduction intrinsic of the source vector.
Definition IRBuilder.cpp:411
LLVM_ABI CallInst * CreateConstrainedFPCast(Intrinsic::ID ID, Value *V, Type *DestTy, FMFSource FMFSource={}, const Twine &Name="", MDNode *FPMathTag=nullptr, std::optional< RoundingMode > Rounding=std::nullopt, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
Definition IRBuilder.cpp:936
LLVM_ABI Value * CreateStripInvariantGroup(Value *Ptr)
Create a strip.invariant.group intrinsic call.
Definition IRBuilder.cpp:1064
LLVM_ABI CallInst * CreateMaskedGather(Type *Ty, Value *Ptrs, Align Alignment, Value *Mask=nullptr, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Gather intrinsic.
Definition IRBuilder.cpp:544
~IRBuilderCallbackInserter() override
virtual ~IRBuilderDefaultInserter()
virtual Value * FoldCmp(CmpInst::Predicate P, Value *LHS, Value *RHS) const =0
virtual ~IRBuilderFolder()
LLVM_ABI void setAAMetadata(const AAMDNodes &N)
Sets the AA metadata on this instruction from the AAMDNodes structure.
LLVM_ABI void setFastMathFlags(FastMathFlags FMF)
Convenience function for setting multiple fast-math flags on this instruction, which must be an opera...
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
LLVM_ABI void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
A Module instance is used to store all the information related to an LLVM module.
A container for an operand bundle being viewed as a set of values rather than a set of uses.
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
This class represents the LLVM 'select' instruction.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", InsertPosition InsertBefore=nullptr, const Instruction *MDFrom=nullptr)
void reserve(size_type N)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
LLVM_ABI Type * getStructElementType(unsigned N) const
bool isVectorTy() const
True if this is an instance of VectorType.
bool isArrayTy() const
True if this is an instance of ArrayType.
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
Type * getArrayElementType() const
LLVM_ABI unsigned getStructNumElements() const
LLVM_ABI uint64_t getArrayNumElements() const
static LLVM_ABI Type * getVoidTy(LLVMContext &C)
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isStructTy() const
True if this is an instance of StructType.
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
bool isVoidTy() const
Return true if this is 'void'.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
LLVM_ABI bool hasConstrainedFPRoundingModeOperand(ID QID)
Returns true if the intrinsic ID is for one of the "ConstrainedFloating-Point Intrinsics" that take r...
LLVM_ABI Intrinsic::ID getInterleaveIntrinsicID(unsigned Factor)
Returns the corresponding llvm.vector.interleaveN intrinsic for factor N.
This is an optimization pass for GlobalISel generic memory operations.
MaybeAlign getAlign(const CallInst &I, unsigned Index)
LLVM_ABI void setExplicitlyUnknownBranchWeightsIfProfiled(Instruction &I, StringRef PassName, const Function *F=nullptr)
Like setExplicitlyUnknownBranchWeights(...), but only sets unknown branch weights in the new instruct...
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
FunctionAddr VTableAddr uintptr_t uintptr_t Data
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.