1 //===-- llvm/IntrinsicInst.h - Intrinsic Instruction Wrappers ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines classes that make it really easy to deal with intrinsic
11 // functions with the isa/dyncast family of functions. In particular, this
12 // allows you to do things like:
14 // if (MemCpyInst *MCI = dyn_cast<MemCpyInst>(Inst))
15 // ... MCI->getDest() ... MCI->getSource() ...
17 // All intrinsic function calls are instances of the call instruction, so these
18 // are all subclasses of the CallInst class. Note that none of these classes
19 // has state or virtual methods, which is an important part of this gross/neat
22 //===----------------------------------------------------------------------===//
24 #ifndef LLVM_IR_INTRINSICINST_H
25 #define LLVM_IR_INTRINSICINST_H
27 #include "llvm/IR/Constants.h"
28 #include "llvm/IR/DerivedTypes.h"
29 #include "llvm/IR/Function.h"
30 #include "llvm/IR/GlobalVariable.h"
31 #include "llvm/IR/Instructions.h"
32 #include "llvm/IR/Intrinsics.h"
33 #include "llvm/IR/Metadata.h"
34 #include "llvm/IR/Value.h"
35 #include "llvm/Support/Casting.h"
41 /// A wrapper class for inspecting calls to intrinsic functions.
42 /// This allows the standard isa/dyncast/cast functionality to work with calls
43 /// to intrinsic functions.
44 class IntrinsicInst : public CallInst {
46 IntrinsicInst() = delete;
47 IntrinsicInst(const IntrinsicInst &) = delete;
48 IntrinsicInst &operator=(const IntrinsicInst &) = delete;
50 /// Return the intrinsic ID of this intrinsic.
51 Intrinsic::ID getIntrinsicID() const {
52 return getCalledFunction()->getIntrinsicID();
55 // Methods for support type inquiry through isa, cast, and dyn_cast:
56 static bool classof(const CallInst *I) {
57 if (const Function *CF = I->getCalledFunction())
58 return CF->isIntrinsic();
61 static bool classof(const Value *V) {
62 return isa<CallInst>(V) && classof(cast<CallInst>(V));
66 /// This is the common base class for debug info intrinsics.
67 class DbgInfoIntrinsic : public IntrinsicInst {
69 /// Get the location corresponding to the variable referenced by the debug
70 /// info intrinsic. Depending on the intrinsic, this could be the
71 /// variable's value or its address.
72 Value *getVariableLocation(bool AllowNullOp = true) const;
74 /// Does this describe the address of a local variable. True for dbg.addr
75 /// and dbg.declare, but not dbg.value, which describes its value.
76 bool isAddressOfVariable() const {
77 return getIntrinsicID() != Intrinsic::dbg_value;
80 DILocalVariable *getVariable() const {
81 return cast<DILocalVariable>(getRawVariable());
84 DIExpression *getExpression() const {
85 return cast<DIExpression>(getRawExpression());
88 Metadata *getRawVariable() const {
89 return cast<MetadataAsValue>(getArgOperand(1))->getMetadata();
92 Metadata *getRawExpression() const {
93 return cast<MetadataAsValue>(getArgOperand(2))->getMetadata();
96 /// Get the size (in bits) of the variable, or fragment of the variable that
98 Optional<uint64_t> getFragmentSizeInBits() const;
100 /// \name Casting methods
102 static bool classof(const IntrinsicInst *I) {
103 switch (I->getIntrinsicID()) {
104 case Intrinsic::dbg_declare:
105 case Intrinsic::dbg_value:
106 case Intrinsic::dbg_addr:
107 case Intrinsic::dbg_label:
109 default: return false;
112 static bool classof(const Value *V) {
113 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
118 /// This represents the llvm.dbg.declare instruction.
119 class DbgDeclareInst : public DbgInfoIntrinsic {
121 Value *getAddress() const { return getVariableLocation(); }
123 /// \name Casting methods
125 static bool classof(const IntrinsicInst *I) {
126 return I->getIntrinsicID() == Intrinsic::dbg_declare;
128 static bool classof(const Value *V) {
129 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
134 /// This represents the llvm.dbg.addr instruction.
135 class DbgAddrIntrinsic : public DbgInfoIntrinsic {
137 Value *getAddress() const { return getVariableLocation(); }
139 /// \name Casting methods
141 static bool classof(const IntrinsicInst *I) {
142 return I->getIntrinsicID() == Intrinsic::dbg_addr;
144 static bool classof(const Value *V) {
145 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
149 /// This represents the llvm.dbg.value instruction.
150 class DbgValueInst : public DbgInfoIntrinsic {
152 Value *getValue() const {
153 return getVariableLocation(/* AllowNullOp = */ false);
156 /// \name Casting methods
158 static bool classof(const IntrinsicInst *I) {
159 return I->getIntrinsicID() == Intrinsic::dbg_value;
161 static bool classof(const Value *V) {
162 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
167 /// This represents the llvm.dbg.label instruction.
168 class DbgLabelInst : public DbgInfoIntrinsic {
170 DILabel *getLabel() const {
171 return cast<DILabel>(getRawVariable());
174 Metadata *getRawVariable() const {
175 return cast<MetadataAsValue>(getArgOperand(0))->getMetadata();
178 Metadata *getRawExpression() const {
182 /// Methods for support type inquiry through isa, cast, and dyn_cast:
184 static bool classof(const IntrinsicInst *I) {
185 return I->getIntrinsicID() == Intrinsic::dbg_label;
187 static bool classof(const Value *V) {
188 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
193 /// This is the common base class for constrained floating point intrinsics.
194 class ConstrainedFPIntrinsic : public IntrinsicInst {
205 enum ExceptionBehavior {
212 bool isUnaryOp() const;
213 bool isTernaryOp() const;
214 RoundingMode getRoundingMode() const;
215 ExceptionBehavior getExceptionBehavior() const;
217 // Methods for support type inquiry through isa, cast, and dyn_cast:
218 static bool classof(const IntrinsicInst *I) {
219 switch (I->getIntrinsicID()) {
220 case Intrinsic::experimental_constrained_fadd:
221 case Intrinsic::experimental_constrained_fsub:
222 case Intrinsic::experimental_constrained_fmul:
223 case Intrinsic::experimental_constrained_fdiv:
224 case Intrinsic::experimental_constrained_frem:
225 case Intrinsic::experimental_constrained_fma:
226 case Intrinsic::experimental_constrained_sqrt:
227 case Intrinsic::experimental_constrained_pow:
228 case Intrinsic::experimental_constrained_powi:
229 case Intrinsic::experimental_constrained_sin:
230 case Intrinsic::experimental_constrained_cos:
231 case Intrinsic::experimental_constrained_exp:
232 case Intrinsic::experimental_constrained_exp2:
233 case Intrinsic::experimental_constrained_log:
234 case Intrinsic::experimental_constrained_log10:
235 case Intrinsic::experimental_constrained_log2:
236 case Intrinsic::experimental_constrained_rint:
237 case Intrinsic::experimental_constrained_nearbyint:
239 default: return false;
242 static bool classof(const Value *V) {
243 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
247 /// Common base class for all memory intrinsics. Simply provides
249 /// Written as CRTP to avoid a common base class amongst the
250 /// three atomicity hierarchies.
251 template <typename Derived> class MemIntrinsicBase : public IntrinsicInst {
253 enum { ARG_DEST = 0, ARG_LENGTH = 2 };
256 Value *getRawDest() const {
257 return const_cast<Value *>(getArgOperand(ARG_DEST));
259 const Use &getRawDestUse() const { return getArgOperandUse(ARG_DEST); }
260 Use &getRawDestUse() { return getArgOperandUse(ARG_DEST); }
262 Value *getLength() const {
263 return const_cast<Value *>(getArgOperand(ARG_LENGTH));
265 const Use &getLengthUse() const { return getArgOperandUse(ARG_LENGTH); }
266 Use &getLengthUse() { return getArgOperandUse(ARG_LENGTH); }
268 /// This is just like getRawDest, but it strips off any cast
269 /// instructions (including addrspacecast) that feed it, giving the
270 /// original input. The returned value is guaranteed to be a pointer.
271 Value *getDest() const { return getRawDest()->stripPointerCasts(); }
273 unsigned getDestAddressSpace() const {
274 return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
277 unsigned getDestAlignment() const { return getParamAlignment(ARG_DEST); }
279 /// Set the specified arguments of the instruction.
280 void setDest(Value *Ptr) {
281 assert(getRawDest()->getType() == Ptr->getType() &&
282 "setDest called with pointer of wrong type!");
283 setArgOperand(ARG_DEST, Ptr);
286 void setDestAlignment(unsigned Align) {
287 removeParamAttr(ARG_DEST, Attribute::Alignment);
289 addParamAttr(ARG_DEST,
290 Attribute::getWithAlignment(getContext(), Align));
293 void setLength(Value *L) {
294 assert(getLength()->getType() == L->getType() &&
295 "setLength called with value of wrong type!");
296 setArgOperand(ARG_LENGTH, L);
300 /// Common base class for all memory transfer intrinsics. Simply provides
302 template <class BaseCL> class MemTransferBase : public BaseCL {
304 enum { ARG_SOURCE = 1 };
307 /// Return the arguments to the instruction.
308 Value *getRawSource() const {
309 return const_cast<Value *>(BaseCL::getArgOperand(ARG_SOURCE));
311 const Use &getRawSourceUse() const {
312 return BaseCL::getArgOperandUse(ARG_SOURCE);
314 Use &getRawSourceUse() { return BaseCL::getArgOperandUse(ARG_SOURCE); }
316 /// This is just like getRawSource, but it strips off any cast
317 /// instructions that feed it, giving the original input. The returned
318 /// value is guaranteed to be a pointer.
319 Value *getSource() const { return getRawSource()->stripPointerCasts(); }
321 unsigned getSourceAddressSpace() const {
322 return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
325 unsigned getSourceAlignment() const {
326 return BaseCL::getParamAlignment(ARG_SOURCE);
329 void setSource(Value *Ptr) {
330 assert(getRawSource()->getType() == Ptr->getType() &&
331 "setSource called with pointer of wrong type!");
332 BaseCL::setArgOperand(ARG_SOURCE, Ptr);
335 void setSourceAlignment(unsigned Align) {
336 BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
338 BaseCL::addParamAttr(ARG_SOURCE, Attribute::getWithAlignment(
339 BaseCL::getContext(), Align));
343 /// Common base class for all memset intrinsics. Simply provides
345 template <class BaseCL> class MemSetBase : public BaseCL {
347 enum { ARG_VALUE = 1 };
350 Value *getValue() const {
351 return const_cast<Value *>(BaseCL::getArgOperand(ARG_VALUE));
353 const Use &getValueUse() const {
354 return BaseCL::getArgOperandUse(ARG_VALUE);
356 Use &getValueUse() { return BaseCL::getArgOperandUse(ARG_VALUE); }
358 void setValue(Value *Val) {
359 assert(getValue()->getType() == Val->getType() &&
360 "setValue called with value of wrong type!");
361 BaseCL::setArgOperand(ARG_VALUE, Val);
365 // The common base class for the atomic memset/memmove/memcpy intrinsics
366 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
367 class AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
369 enum { ARG_ELEMENTSIZE = 3 };
372 Value *getRawElementSizeInBytes() const {
373 return const_cast<Value *>(getArgOperand(ARG_ELEMENTSIZE));
376 ConstantInt *getElementSizeInBytesCst() const {
377 return cast<ConstantInt>(getRawElementSizeInBytes());
380 uint32_t getElementSizeInBytes() const {
381 return getElementSizeInBytesCst()->getZExtValue();
384 void setElementSizeInBytes(Constant *V) {
385 assert(V->getType() == Type::getInt8Ty(getContext()) &&
386 "setElementSizeInBytes called with value of wrong type!");
387 setArgOperand(ARG_ELEMENTSIZE, V);
390 static bool classof(const IntrinsicInst *I) {
391 switch (I->getIntrinsicID()) {
392 case Intrinsic::memcpy_element_unordered_atomic:
393 case Intrinsic::memmove_element_unordered_atomic:
394 case Intrinsic::memset_element_unordered_atomic:
400 static bool classof(const Value *V) {
401 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
405 /// This class represents atomic memset intrinsic
406 // i.e. llvm.element.unordered.atomic.memset
407 class AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
409 static bool classof(const IntrinsicInst *I) {
410 return I->getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
412 static bool classof(const Value *V) {
413 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
417 // This class wraps the atomic memcpy/memmove intrinsics
418 // i.e. llvm.element.unordered.atomic.memcpy/memmove
419 class AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
421 static bool classof(const IntrinsicInst *I) {
422 switch (I->getIntrinsicID()) {
423 case Intrinsic::memcpy_element_unordered_atomic:
424 case Intrinsic::memmove_element_unordered_atomic:
430 static bool classof(const Value *V) {
431 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
435 /// This class represents the atomic memcpy intrinsic
436 /// i.e. llvm.element.unordered.atomic.memcpy
437 class AtomicMemCpyInst : public AtomicMemTransferInst {
439 static bool classof(const IntrinsicInst *I) {
440 return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
442 static bool classof(const Value *V) {
443 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
447 /// This class represents the atomic memmove intrinsic
448 /// i.e. llvm.element.unordered.atomic.memmove
449 class AtomicMemMoveInst : public AtomicMemTransferInst {
451 static bool classof(const IntrinsicInst *I) {
452 return I->getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
454 static bool classof(const Value *V) {
455 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
459 /// This is the common base class for memset/memcpy/memmove.
460 class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
462 enum { ARG_VOLATILE = 3 };
465 ConstantInt *getVolatileCst() const {
466 return cast<ConstantInt>(
467 const_cast<Value *>(getArgOperand(ARG_VOLATILE)));
470 bool isVolatile() const {
471 return !getVolatileCst()->isZero();
474 void setVolatile(Constant *V) { setArgOperand(ARG_VOLATILE, V); }
476 // Methods for support type inquiry through isa, cast, and dyn_cast:
477 static bool classof(const IntrinsicInst *I) {
478 switch (I->getIntrinsicID()) {
479 case Intrinsic::memcpy:
480 case Intrinsic::memmove:
481 case Intrinsic::memset:
483 default: return false;
486 static bool classof(const Value *V) {
487 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
491 /// This class wraps the llvm.memset intrinsic.
492 class MemSetInst : public MemSetBase<MemIntrinsic> {
494 // Methods for support type inquiry through isa, cast, and dyn_cast:
495 static bool classof(const IntrinsicInst *I) {
496 return I->getIntrinsicID() == Intrinsic::memset;
498 static bool classof(const Value *V) {
499 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
503 /// This class wraps the llvm.memcpy/memmove intrinsics.
504 class MemTransferInst : public MemTransferBase<MemIntrinsic> {
506 // Methods for support type inquiry through isa, cast, and dyn_cast:
507 static bool classof(const IntrinsicInst *I) {
508 return I->getIntrinsicID() == Intrinsic::memcpy ||
509 I->getIntrinsicID() == Intrinsic::memmove;
511 static bool classof(const Value *V) {
512 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
516 /// This class wraps the llvm.memcpy intrinsic.
517 class MemCpyInst : public MemTransferInst {
519 // Methods for support type inquiry through isa, cast, and dyn_cast:
520 static bool classof(const IntrinsicInst *I) {
521 return I->getIntrinsicID() == Intrinsic::memcpy;
523 static bool classof(const Value *V) {
524 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
528 /// This class wraps the llvm.memmove intrinsic.
529 class MemMoveInst : public MemTransferInst {
531 // Methods for support type inquiry through isa, cast, and dyn_cast:
532 static bool classof(const IntrinsicInst *I) {
533 return I->getIntrinsicID() == Intrinsic::memmove;
535 static bool classof(const Value *V) {
536 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
540 // The common base class for any memset/memmove/memcpy intrinsics;
541 // whether they be atomic or non-atomic.
542 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
543 // and llvm.memset/memcpy/memmove
544 class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
546 bool isVolatile() const {
547 // Only the non-atomic intrinsics can be volatile
548 if (auto *MI = dyn_cast<MemIntrinsic>(this))
549 return MI->isVolatile();
553 static bool classof(const IntrinsicInst *I) {
554 switch (I->getIntrinsicID()) {
555 case Intrinsic::memcpy:
556 case Intrinsic::memmove:
557 case Intrinsic::memset:
558 case Intrinsic::memcpy_element_unordered_atomic:
559 case Intrinsic::memmove_element_unordered_atomic:
560 case Intrinsic::memset_element_unordered_atomic:
566 static bool classof(const Value *V) {
567 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
571 /// This class represents any memset intrinsic
572 // i.e. llvm.element.unordered.atomic.memset
574 class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
576 static bool classof(const IntrinsicInst *I) {
577 switch (I->getIntrinsicID()) {
578 case Intrinsic::memset:
579 case Intrinsic::memset_element_unordered_atomic:
585 static bool classof(const Value *V) {
586 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
590 // This class wraps any memcpy/memmove intrinsics
591 // i.e. llvm.element.unordered.atomic.memcpy/memmove
592 // and llvm.memcpy/memmove
593 class AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
595 static bool classof(const IntrinsicInst *I) {
596 switch (I->getIntrinsicID()) {
597 case Intrinsic::memcpy:
598 case Intrinsic::memmove:
599 case Intrinsic::memcpy_element_unordered_atomic:
600 case Intrinsic::memmove_element_unordered_atomic:
606 static bool classof(const Value *V) {
607 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
611 /// This class represents any memcpy intrinsic
612 /// i.e. llvm.element.unordered.atomic.memcpy
614 class AnyMemCpyInst : public AnyMemTransferInst {
616 static bool classof(const IntrinsicInst *I) {
617 switch (I->getIntrinsicID()) {
618 case Intrinsic::memcpy:
619 case Intrinsic::memcpy_element_unordered_atomic:
625 static bool classof(const Value *V) {
626 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
630 /// This class represents any memmove intrinsic
631 /// i.e. llvm.element.unordered.atomic.memmove
633 class AnyMemMoveInst : public AnyMemTransferInst {
635 static bool classof(const IntrinsicInst *I) {
636 switch (I->getIntrinsicID()) {
637 case Intrinsic::memmove:
638 case Intrinsic::memmove_element_unordered_atomic:
644 static bool classof(const Value *V) {
645 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
649 /// This represents the llvm.va_start intrinsic.
650 class VAStartInst : public IntrinsicInst {
652 static bool classof(const IntrinsicInst *I) {
653 return I->getIntrinsicID() == Intrinsic::vastart;
655 static bool classof(const Value *V) {
656 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
659 Value *getArgList() const { return const_cast<Value*>(getArgOperand(0)); }
662 /// This represents the llvm.va_end intrinsic.
663 class VAEndInst : public IntrinsicInst {
665 static bool classof(const IntrinsicInst *I) {
666 return I->getIntrinsicID() == Intrinsic::vaend;
668 static bool classof(const Value *V) {
669 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
672 Value *getArgList() const { return const_cast<Value*>(getArgOperand(0)); }
675 /// This represents the llvm.va_copy intrinsic.
676 class VACopyInst : public IntrinsicInst {
678 static bool classof(const IntrinsicInst *I) {
679 return I->getIntrinsicID() == Intrinsic::vacopy;
681 static bool classof(const Value *V) {
682 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
685 Value *getDest() const { return const_cast<Value*>(getArgOperand(0)); }
686 Value *getSrc() const { return const_cast<Value*>(getArgOperand(1)); }
689 /// This represents the llvm.instrprof_increment intrinsic.
690 class InstrProfIncrementInst : public IntrinsicInst {
692 static bool classof(const IntrinsicInst *I) {
693 return I->getIntrinsicID() == Intrinsic::instrprof_increment;
695 static bool classof(const Value *V) {
696 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
699 GlobalVariable *getName() const {
700 return cast<GlobalVariable>(
701 const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
704 ConstantInt *getHash() const {
705 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
708 ConstantInt *getNumCounters() const {
709 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
712 ConstantInt *getIndex() const {
713 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
716 Value *getStep() const;
719 class InstrProfIncrementInstStep : public InstrProfIncrementInst {
721 static bool classof(const IntrinsicInst *I) {
722 return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
724 static bool classof(const Value *V) {
725 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
729 /// This represents the llvm.instrprof_value_profile intrinsic.
730 class InstrProfValueProfileInst : public IntrinsicInst {
732 static bool classof(const IntrinsicInst *I) {
733 return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
735 static bool classof(const Value *V) {
736 return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
739 GlobalVariable *getName() const {
740 return cast<GlobalVariable>(
741 const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
744 ConstantInt *getHash() const {
745 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
748 Value *getTargetValue() const {
749 return cast<Value>(const_cast<Value *>(getArgOperand(2)));
752 ConstantInt *getValueKind() const {
753 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
756 // Returns the value site index.
757 ConstantInt *getIndex() const {
758 return cast<ConstantInt>(const_cast<Value *>(getArgOperand(4)));
762 } // end namespace llvm
764 #endif // LLVM_IR_INTRINSICINST_H