LLVM  14.0.0git
IntrinsicInst.h
Go to the documentation of this file.
1 //===-- llvm/IntrinsicInst.h - Intrinsic Instruction Wrappers ---*- 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 file defines classes that make it really easy to deal with intrinsic
10 // functions with the isa/dyncast family of functions. In particular, this
11 // allows you to do things like:
12 //
13 // if (MemCpyInst *MCI = dyn_cast<MemCpyInst>(Inst))
14 // ... MCI->getDest() ... MCI->getSource() ...
15 //
16 // All intrinsic function calls are instances of the call instruction, so these
17 // are all subclasses of the CallInst class. Note that none of these classes
18 // has state or virtual methods, which is an important part of this gross/neat
19 // hack working.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 #ifndef LLVM_IR_INTRINSICINST_H
24 #define LLVM_IR_INTRINSICINST_H
25 
26 #include "llvm/IR/Constants.h"
28 #include "llvm/IR/DerivedTypes.h"
29 #include "llvm/IR/FPEnv.h"
30 #include "llvm/IR/Function.h"
31 #include "llvm/IR/GlobalVariable.h"
32 #include "llvm/IR/Instructions.h"
33 #include "llvm/IR/Intrinsics.h"
34 #include "llvm/IR/Metadata.h"
35 #include "llvm/IR/Value.h"
36 #include "llvm/Support/Casting.h"
37 #include <cassert>
38 #include <cstdint>
39 
40 namespace llvm {
41 
42 /// A wrapper class for inspecting calls to intrinsic functions.
43 /// This allows the standard isa/dyncast/cast functionality to work with calls
44 /// to intrinsic functions.
45 class IntrinsicInst : public CallInst {
46 public:
47  IntrinsicInst() = delete;
48  IntrinsicInst(const IntrinsicInst &) = delete;
49  IntrinsicInst &operator=(const IntrinsicInst &) = delete;
50 
51  /// Return the intrinsic ID of this intrinsic.
54  }
55 
56  /// Return true if swapping the first two arguments to the intrinsic produces
57  /// the same result.
58  bool isCommutative() const {
59  switch (getIntrinsicID()) {
60  case Intrinsic::maxnum:
61  case Intrinsic::minnum:
62  case Intrinsic::maximum:
63  case Intrinsic::minimum:
64  case Intrinsic::smax:
65  case Intrinsic::smin:
66  case Intrinsic::umax:
67  case Intrinsic::umin:
68  case Intrinsic::sadd_sat:
69  case Intrinsic::uadd_sat:
70  case Intrinsic::sadd_with_overflow:
71  case Intrinsic::uadd_with_overflow:
72  case Intrinsic::smul_with_overflow:
73  case Intrinsic::umul_with_overflow:
74  case Intrinsic::smul_fix:
75  case Intrinsic::umul_fix:
76  case Intrinsic::smul_fix_sat:
77  case Intrinsic::umul_fix_sat:
78  case Intrinsic::fma:
79  case Intrinsic::fmuladd:
80  return true;
81  default:
82  return false;
83  }
84  }
85 
86  // Checks if the intrinsic is an annotation.
87  bool isAssumeLikeIntrinsic() const {
88  switch (getIntrinsicID()) {
89  default: break;
90  case Intrinsic::assume:
91  case Intrinsic::sideeffect:
92  case Intrinsic::pseudoprobe:
93  case Intrinsic::dbg_declare:
94  case Intrinsic::dbg_value:
95  case Intrinsic::dbg_label:
96  case Intrinsic::invariant_start:
97  case Intrinsic::invariant_end:
98  case Intrinsic::lifetime_start:
99  case Intrinsic::lifetime_end:
100  case Intrinsic::experimental_noalias_scope_decl:
101  case Intrinsic::objectsize:
102  case Intrinsic::ptr_annotation:
103  case Intrinsic::var_annotation:
104  return true;
105  }
106  return false;
107  }
108 
109  // Methods for support type inquiry through isa, cast, and dyn_cast:
110  static bool classof(const CallInst *I) {
111  if (const Function *CF = I->getCalledFunction())
112  return CF->isIntrinsic();
113  return false;
114  }
115  static bool classof(const Value *V) {
116  return isa<CallInst>(V) && classof(cast<CallInst>(V));
117  }
118 };
119 
120 /// Check if \p ID corresponds to a debug info intrinsic.
121 static inline bool isDbgInfoIntrinsic(Intrinsic::ID ID) {
122  switch (ID) {
123  case Intrinsic::dbg_declare:
124  case Intrinsic::dbg_value:
125  case Intrinsic::dbg_addr:
126  case Intrinsic::dbg_label:
127  return true;
128  default:
129  return false;
130  }
131 }
132 
133 /// This is the common base class for debug info intrinsics.
135 public:
136  /// \name Casting methods
137  /// @{
138  static bool classof(const IntrinsicInst *I) {
139  return isDbgInfoIntrinsic(I->getIntrinsicID());
140  }
141  static bool classof(const Value *V) {
142  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
143  }
144  /// @}
145 };
146 
147 /// This is the common base class for debug info intrinsics for variables.
149 public:
150  // Iterator for ValueAsMetadata that internally uses direct pointer iteration
151  // over either a ValueAsMetadata* or a ValueAsMetadata**, dereferencing to the
152  // ValueAsMetadata .
154  : public iterator_facade_base<location_op_iterator,
155  std::bidirectional_iterator_tag, Value *> {
157 
158  public:
159  location_op_iterator(ValueAsMetadata *SingleIter) : I(SingleIter) {}
160  location_op_iterator(ValueAsMetadata **MultiIter) : I(MultiIter) {}
161 
164  I = R.I;
165  return *this;
166  }
167  bool operator==(const location_op_iterator &RHS) const {
168  return I == RHS.I;
169  }
170  const Value *operator*() const {
171  ValueAsMetadata *VAM = I.is<ValueAsMetadata *>()
172  ? I.get<ValueAsMetadata *>()
173  : *I.get<ValueAsMetadata **>();
174  return VAM->getValue();
175  };
177  ValueAsMetadata *VAM = I.is<ValueAsMetadata *>()
178  ? I.get<ValueAsMetadata *>()
179  : *I.get<ValueAsMetadata **>();
180  return VAM->getValue();
181  }
183  if (I.is<ValueAsMetadata *>())
184  I = I.get<ValueAsMetadata *>() + 1;
185  else
186  I = I.get<ValueAsMetadata **>() + 1;
187  return *this;
188  }
190  if (I.is<ValueAsMetadata *>())
191  I = I.get<ValueAsMetadata *>() - 1;
192  else
193  I = I.get<ValueAsMetadata **>() - 1;
194  return *this;
195  }
196  };
197 
198  /// Get the locations corresponding to the variable referenced by the debug
199  /// info intrinsic. Depending on the intrinsic, this could be the
200  /// variable's value or its address.
202 
203  Value *getVariableLocationOp(unsigned OpIdx) const;
204 
205  void replaceVariableLocationOp(Value *OldValue, Value *NewValue);
206  void replaceVariableLocationOp(unsigned OpIdx, Value *NewValue);
207  /// Adding a new location operand will always result in this intrinsic using
208  /// an ArgList, and must always be accompanied by a new expression that uses
209  /// the new operand.
212 
213  void setVariable(DILocalVariable *NewVar) {
214  setArgOperand(1, MetadataAsValue::get(NewVar->getContext(), NewVar));
215  }
216 
218  setArgOperand(2, MetadataAsValue::get(NewExpr->getContext(), NewExpr));
219  }
220 
221  unsigned getNumVariableLocationOps() const {
222  if (hasArgList())
223  return cast<DIArgList>(getRawLocation())->getArgs().size();
224  return 1;
225  }
226 
227  bool hasArgList() const { return isa<DIArgList>(getRawLocation()); }
228 
229  /// Does this describe the address of a local variable. True for dbg.addr
230  /// and dbg.declare, but not dbg.value, which describes its value.
231  bool isAddressOfVariable() const {
232  return getIntrinsicID() != Intrinsic::dbg_value;
233  }
234 
235  void setUndef() {
236  // TODO: When/if we remove duplicate values from DIArgLists, we don't need
237  // this set anymore.
238  SmallPtrSet<Value *, 4> RemovedValues;
239  for (Value *OldValue : location_ops()) {
240  if (!RemovedValues.insert(OldValue).second)
241  continue;
242  Value *Undef = UndefValue::get(OldValue->getType());
243  replaceVariableLocationOp(OldValue, Undef);
244  }
245  }
246 
247  bool isUndef() const {
248  return (getNumVariableLocationOps() == 0 &&
249  !getExpression()->isComplex()) ||
250  any_of(location_ops(), [](Value *V) { return isa<UndefValue>(V); });
251  }
252 
254  return cast<DILocalVariable>(getRawVariable());
255  }
256 
258  return cast<DIExpression>(getRawExpression());
259  }
260 
262  return cast<MetadataAsValue>(getArgOperand(0))->getMetadata();
263  }
264 
266  return cast<MetadataAsValue>(getArgOperand(1))->getMetadata();
267  }
268 
270  return cast<MetadataAsValue>(getArgOperand(2))->getMetadata();
271  }
272 
273  /// Use of this should generally be avoided; instead,
274  /// replaceVariableLocationOp and addVariableLocationOps should be used where
275  /// possible to avoid creating invalid state.
276  void setRawLocation(Metadata *Location) {
277  return setArgOperand(0, MetadataAsValue::get(getContext(), Location));
278  }
279 
280  /// Get the size (in bits) of the variable, or fragment of the variable that
281  /// is described.
283 
284  /// \name Casting methods
285  /// @{
286  static bool classof(const IntrinsicInst *I) {
287  switch (I->getIntrinsicID()) {
288  case Intrinsic::dbg_declare:
289  case Intrinsic::dbg_value:
290  case Intrinsic::dbg_addr:
291  return true;
292  default:
293  return false;
294  }
295  }
296  static bool classof(const Value *V) {
297  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
298  }
299  /// @}
300 private:
301  void setArgOperand(unsigned i, Value *v) {
303  }
304  void setOperand(unsigned i, Value *v) { DbgInfoIntrinsic::setOperand(i, v); }
305 };
306 
307 /// This represents the llvm.dbg.declare instruction.
309 public:
310  Value *getAddress() const {
312  "dbg.declare must have exactly 1 location operand.");
313  return getVariableLocationOp(0);
314  }
315 
316  /// \name Casting methods
317  /// @{
318  static bool classof(const IntrinsicInst *I) {
319  return I->getIntrinsicID() == Intrinsic::dbg_declare;
320  }
321  static bool classof(const Value *V) {
322  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
323  }
324  /// @}
325 };
326 
327 /// This represents the llvm.dbg.addr instruction.
329 public:
330  Value *getAddress() const {
332  "dbg.addr must have exactly 1 location operand.");
333  return getVariableLocationOp(0);
334  }
335 
336  /// \name Casting methods
337  /// @{
338  static bool classof(const IntrinsicInst *I) {
339  return I->getIntrinsicID() == Intrinsic::dbg_addr;
340  }
341  static bool classof(const Value *V) {
342  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
343  }
344 };
345 
346 /// This represents the llvm.dbg.value instruction.
348 public:
349  // The default argument should only be used in ISel, and the default option
350  // should be removed once ISel support for multiple location ops is complete.
351  Value *getValue(unsigned OpIdx = 0) const {
352  return getVariableLocationOp(OpIdx);
353  }
355  return location_ops();
356  }
357 
358  /// \name Casting methods
359  /// @{
360  static bool classof(const IntrinsicInst *I) {
361  return I->getIntrinsicID() == Intrinsic::dbg_value;
362  }
363  static bool classof(const Value *V) {
364  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
365  }
366  /// @}
367 };
368 
369 /// This represents the llvm.dbg.label instruction.
371 public:
372  DILabel *getLabel() const { return cast<DILabel>(getRawLabel()); }
373 
375  return cast<MetadataAsValue>(getArgOperand(0))->getMetadata();
376  }
377 
378  /// Methods for support type inquiry through isa, cast, and dyn_cast:
379  /// @{
380  static bool classof(const IntrinsicInst *I) {
381  return I->getIntrinsicID() == Intrinsic::dbg_label;
382  }
383  static bool classof(const Value *V) {
384  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
385  }
386  /// @}
387 };
388 
389 /// This is the common base class for vector predication intrinsics.
390 class VPIntrinsic : public IntrinsicInst {
391 public:
392  /// \brief Declares a llvm.vp.* intrinsic in \p M that matches the parameters
393  /// \p Params.
395  ArrayRef<Value *> Params);
396 
399 
400  /// The llvm.vp.* intrinsics for this instruction Opcode
401  static Intrinsic::ID getForOpcode(unsigned OC);
402 
403  // Whether \p ID is a VP intrinsic ID.
404  static bool isVPIntrinsic(Intrinsic::ID);
405 
406  /// \return The mask parameter or nullptr.
407  Value *getMaskParam() const;
408  void setMaskParam(Value *);
409 
410  /// \return The vector length parameter or nullptr.
411  Value *getVectorLengthParam() const;
412  void setVectorLengthParam(Value *);
413 
414  /// \return Whether the vector length param can be ignored.
415  bool canIgnoreVectorLengthParam() const;
416 
417  /// \return The static element count (vector number of elements) the vector
418  /// length parameter applies to.
420 
421  /// \return The alignment of the pointer used by this load/store/gather or
422  /// scatter.
424  // MaybeAlign setPointerAlignment(Align NewAlign); // TODO
425 
426  /// \return The pointer operand of this load,store, gather or scatter.
427  Value *getMemoryPointerParam() const;
429 
430  /// \return The data (payload) operand of this store or scatter.
431  Value *getMemoryDataParam() const;
433 
434  // Methods for support type inquiry through isa, cast, and dyn_cast:
435  static bool classof(const IntrinsicInst *I) {
436  return isVPIntrinsic(I->getIntrinsicID());
437  }
438  static bool classof(const Value *V) {
439  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
440  }
441 
442  // Equivalent non-predicated opcode
445  }
446 
447  // Equivalent non-predicated opcode
449 };
450 
451 /// This represents vector predication reduction intrinsics.
453 public:
454  static bool isVPReduction(Intrinsic::ID ID);
455 
456  unsigned getStartParamPos() const;
457  unsigned getVectorParamPos() const;
458 
461 
462  /// Methods for support type inquiry through isa, cast, and dyn_cast:
463  /// @{
464  static bool classof(const IntrinsicInst *I) {
465  return VPReductionIntrinsic::isVPReduction(I->getIntrinsicID());
466  }
467  static bool classof(const Value *V) {
468  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
469  }
470  /// @}
471 };
472 
473 /// This is the common base class for constrained floating point intrinsics.
475 public:
476  bool isUnaryOp() const;
477  bool isTernaryOp() const;
480  bool isDefaultFPEnvironment() const;
481 
482  // Methods for support type inquiry through isa, cast, and dyn_cast:
483  static bool classof(const IntrinsicInst *I);
484  static bool classof(const Value *V) {
485  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
486  }
487 };
488 
489 /// Constrained floating point compare intrinsics.
491 public:
493 
494  // Methods for support type inquiry through isa, cast, and dyn_cast:
495  static bool classof(const IntrinsicInst *I) {
496  switch (I->getIntrinsicID()) {
497  case Intrinsic::experimental_constrained_fcmp:
498  case Intrinsic::experimental_constrained_fcmps:
499  return true;
500  default:
501  return false;
502  }
503  }
504  static bool classof(const Value *V) {
505  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
506  }
507 };
508 
509 /// This class represents min/max intrinsics.
511 public:
512  static bool classof(const IntrinsicInst *I) {
513  switch (I->getIntrinsicID()) {
514  case Intrinsic::umin:
515  case Intrinsic::umax:
516  case Intrinsic::smin:
517  case Intrinsic::smax:
518  return true;
519  default:
520  return false;
521  }
522  }
523  static bool classof(const Value *V) {
524  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
525  }
526 
527  Value *getLHS() const { return const_cast<Value *>(getArgOperand(0)); }
528  Value *getRHS() const { return const_cast<Value *>(getArgOperand(1)); }
529 
530  /// Returns the comparison predicate underlying the intrinsic.
532  switch (getIntrinsicID()) {
533  case Intrinsic::umin:
534  return ICmpInst::Predicate::ICMP_ULT;
535  case Intrinsic::umax:
536  return ICmpInst::Predicate::ICMP_UGT;
537  case Intrinsic::smin:
538  return ICmpInst::Predicate::ICMP_SLT;
539  case Intrinsic::smax:
540  return ICmpInst::Predicate::ICMP_SGT;
541  default:
542  llvm_unreachable("Invalid intrinsic");
543  }
544  }
545 
546  /// Whether the intrinsic is signed or unsigned.
547  bool isSigned() const { return ICmpInst::isSigned(getPredicate()); };
548 };
549 
550 /// This class represents an intrinsic that is based on a binary operation.
551 /// This includes op.with.overflow and saturating add/sub intrinsics.
553 public:
554  static bool classof(const IntrinsicInst *I) {
555  switch (I->getIntrinsicID()) {
556  case Intrinsic::uadd_with_overflow:
557  case Intrinsic::sadd_with_overflow:
558  case Intrinsic::usub_with_overflow:
559  case Intrinsic::ssub_with_overflow:
560  case Intrinsic::umul_with_overflow:
561  case Intrinsic::smul_with_overflow:
562  case Intrinsic::uadd_sat:
563  case Intrinsic::sadd_sat:
564  case Intrinsic::usub_sat:
565  case Intrinsic::ssub_sat:
566  return true;
567  default:
568  return false;
569  }
570  }
571  static bool classof(const Value *V) {
572  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
573  }
574 
575  Value *getLHS() const { return const_cast<Value *>(getArgOperand(0)); }
576  Value *getRHS() const { return const_cast<Value *>(getArgOperand(1)); }
577 
578  /// Returns the binary operation underlying the intrinsic.
580 
581  /// Whether the intrinsic is signed or unsigned.
582  bool isSigned() const;
583 
584  /// Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
585  unsigned getNoWrapKind() const;
586 };
587 
588 /// Represents an op.with.overflow intrinsic.
590 public:
591  static bool classof(const IntrinsicInst *I) {
592  switch (I->getIntrinsicID()) {
593  case Intrinsic::uadd_with_overflow:
594  case Intrinsic::sadd_with_overflow:
595  case Intrinsic::usub_with_overflow:
596  case Intrinsic::ssub_with_overflow:
597  case Intrinsic::umul_with_overflow:
598  case Intrinsic::smul_with_overflow:
599  return true;
600  default:
601  return false;
602  }
603  }
604  static bool classof(const Value *V) {
605  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
606  }
607 };
608 
609 /// Represents a saturating add/sub intrinsic.
611 public:
612  static bool classof(const IntrinsicInst *I) {
613  switch (I->getIntrinsicID()) {
614  case Intrinsic::uadd_sat:
615  case Intrinsic::sadd_sat:
616  case Intrinsic::usub_sat:
617  case Intrinsic::ssub_sat:
618  return true;
619  default:
620  return false;
621  }
622  }
623  static bool classof(const Value *V) {
624  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
625  }
626 };
627 
628 /// Common base class for all memory intrinsics. Simply provides
629 /// common methods.
630 /// Written as CRTP to avoid a common base class amongst the
631 /// three atomicity hierarchies.
632 template <typename Derived> class MemIntrinsicBase : public IntrinsicInst {
633 private:
634  enum { ARG_DEST = 0, ARG_LENGTH = 2 };
635 
636 public:
637  Value *getRawDest() const {
638  return const_cast<Value *>(getArgOperand(ARG_DEST));
639  }
640  const Use &getRawDestUse() const { return getArgOperandUse(ARG_DEST); }
641  Use &getRawDestUse() { return getArgOperandUse(ARG_DEST); }
642 
643  Value *getLength() const {
644  return const_cast<Value *>(getArgOperand(ARG_LENGTH));
645  }
646  const Use &getLengthUse() const { return getArgOperandUse(ARG_LENGTH); }
647  Use &getLengthUse() { return getArgOperandUse(ARG_LENGTH); }
648 
649  /// This is just like getRawDest, but it strips off any cast
650  /// instructions (including addrspacecast) that feed it, giving the
651  /// original input. The returned value is guaranteed to be a pointer.
652  Value *getDest() const { return getRawDest()->stripPointerCasts(); }
653 
654  unsigned getDestAddressSpace() const {
655  return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
656  }
657 
658  /// FIXME: Remove this function once transition to Align is over.
659  /// Use getDestAlign() instead.
660  unsigned getDestAlignment() const {
661  if (auto MA = getParamAlign(ARG_DEST))
662  return MA->value();
663  return 0;
664  }
665  MaybeAlign getDestAlign() const { return getParamAlign(ARG_DEST); }
666 
667  /// Set the specified arguments of the instruction.
668  void setDest(Value *Ptr) {
669  assert(getRawDest()->getType() == Ptr->getType() &&
670  "setDest called with pointer of wrong type!");
671  setArgOperand(ARG_DEST, Ptr);
672  }
673 
674  /// FIXME: Remove this function once transition to Align is over.
675  /// Use the version that takes MaybeAlign instead of this one.
676  void setDestAlignment(unsigned Alignment) {
677  setDestAlignment(MaybeAlign(Alignment));
678  }
679  void setDestAlignment(MaybeAlign Alignment) {
680  removeParamAttr(ARG_DEST, Attribute::Alignment);
681  if (Alignment)
682  addParamAttr(ARG_DEST,
683  Attribute::getWithAlignment(getContext(), *Alignment));
684  }
685  void setDestAlignment(Align Alignment) {
686  removeParamAttr(ARG_DEST, Attribute::Alignment);
687  addParamAttr(ARG_DEST,
689  }
690 
691  void setLength(Value *L) {
692  assert(getLength()->getType() == L->getType() &&
693  "setLength called with value of wrong type!");
694  setArgOperand(ARG_LENGTH, L);
695  }
696 };
697 
698 /// Common base class for all memory transfer intrinsics. Simply provides
699 /// common methods.
700 template <class BaseCL> class MemTransferBase : public BaseCL {
701 private:
702  enum { ARG_SOURCE = 1 };
703 
704 public:
705  /// Return the arguments to the instruction.
706  Value *getRawSource() const {
707  return const_cast<Value *>(BaseCL::getArgOperand(ARG_SOURCE));
708  }
709  const Use &getRawSourceUse() const {
710  return BaseCL::getArgOperandUse(ARG_SOURCE);
711  }
712  Use &getRawSourceUse() { return BaseCL::getArgOperandUse(ARG_SOURCE); }
713 
714  /// This is just like getRawSource, but it strips off any cast
715  /// instructions that feed it, giving the original input. The returned
716  /// value is guaranteed to be a pointer.
717  Value *getSource() const { return getRawSource()->stripPointerCasts(); }
718 
719  unsigned getSourceAddressSpace() const {
720  return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
721  }
722 
723  /// FIXME: Remove this function once transition to Align is over.
724  /// Use getSourceAlign() instead.
725  unsigned getSourceAlignment() const {
726  if (auto MA = BaseCL::getParamAlign(ARG_SOURCE))
727  return MA->value();
728  return 0;
729  }
730 
732  return BaseCL::getParamAlign(ARG_SOURCE);
733  }
734 
735  void setSource(Value *Ptr) {
736  assert(getRawSource()->getType() == Ptr->getType() &&
737  "setSource called with pointer of wrong type!");
738  BaseCL::setArgOperand(ARG_SOURCE, Ptr);
739  }
740 
741  /// FIXME: Remove this function once transition to Align is over.
742  /// Use the version that takes MaybeAlign instead of this one.
743  void setSourceAlignment(unsigned Alignment) {
744  setSourceAlignment(MaybeAlign(Alignment));
745  }
746  void setSourceAlignment(MaybeAlign Alignment) {
747  BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
748  if (Alignment)
749  BaseCL::addParamAttr(ARG_SOURCE, Attribute::getWithAlignment(
750  BaseCL::getContext(), *Alignment));
751  }
752  void setSourceAlignment(Align Alignment) {
753  BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
754  BaseCL::addParamAttr(ARG_SOURCE, Attribute::getWithAlignment(
755  BaseCL::getContext(), Alignment));
756  }
757 };
758 
759 /// Common base class for all memset intrinsics. Simply provides
760 /// common methods.
761 template <class BaseCL> class MemSetBase : public BaseCL {
762 private:
763  enum { ARG_VALUE = 1 };
764 
765 public:
766  Value *getValue() const {
767  return const_cast<Value *>(BaseCL::getArgOperand(ARG_VALUE));
768  }
769  const Use &getValueUse() const { return BaseCL::getArgOperandUse(ARG_VALUE); }
770  Use &getValueUse() { return BaseCL::getArgOperandUse(ARG_VALUE); }
771 
772  void setValue(Value *Val) {
773  assert(getValue()->getType() == Val->getType() &&
774  "setValue called with value of wrong type!");
775  BaseCL::setArgOperand(ARG_VALUE, Val);
776  }
777 };
778 
779 // The common base class for the atomic memset/memmove/memcpy intrinsics
780 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
781 class AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
782 private:
783  enum { ARG_ELEMENTSIZE = 3 };
784 
785 public:
787  return const_cast<Value *>(getArgOperand(ARG_ELEMENTSIZE));
788  }
789 
791  return cast<ConstantInt>(getRawElementSizeInBytes());
792  }
793 
796  }
797 
800  "setElementSizeInBytes called with value of wrong type!");
801  setArgOperand(ARG_ELEMENTSIZE, V);
802  }
803 
804  static bool classof(const IntrinsicInst *I) {
805  switch (I->getIntrinsicID()) {
806  case Intrinsic::memcpy_element_unordered_atomic:
807  case Intrinsic::memmove_element_unordered_atomic:
808  case Intrinsic::memset_element_unordered_atomic:
809  return true;
810  default:
811  return false;
812  }
813  }
814  static bool classof(const Value *V) {
815  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
816  }
817 };
818 
819 /// This class represents atomic memset intrinsic
820 // i.e. llvm.element.unordered.atomic.memset
821 class AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
822 public:
823  static bool classof(const IntrinsicInst *I) {
824  return I->getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
825  }
826  static bool classof(const Value *V) {
827  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
828  }
829 };
830 
831 // This class wraps the atomic memcpy/memmove intrinsics
832 // i.e. llvm.element.unordered.atomic.memcpy/memmove
833 class AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
834 public:
835  static bool classof(const IntrinsicInst *I) {
836  switch (I->getIntrinsicID()) {
837  case Intrinsic::memcpy_element_unordered_atomic:
838  case Intrinsic::memmove_element_unordered_atomic:
839  return true;
840  default:
841  return false;
842  }
843  }
844  static bool classof(const Value *V) {
845  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
846  }
847 };
848 
849 /// This class represents the atomic memcpy intrinsic
850 /// i.e. llvm.element.unordered.atomic.memcpy
852 public:
853  static bool classof(const IntrinsicInst *I) {
854  return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
855  }
856  static bool classof(const Value *V) {
857  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
858  }
859 };
860 
861 /// This class represents the atomic memmove intrinsic
862 /// i.e. llvm.element.unordered.atomic.memmove
864 public:
865  static bool classof(const IntrinsicInst *I) {
866  return I->getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
867  }
868  static bool classof(const Value *V) {
869  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
870  }
871 };
872 
873 /// This is the common base class for memset/memcpy/memmove.
874 class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
875 private:
876  enum { ARG_VOLATILE = 3 };
877 
878 public:
880  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(ARG_VOLATILE)));
881  }
882 
883  bool isVolatile() const { return !getVolatileCst()->isZero(); }
884 
885  void setVolatile(Constant *V) { setArgOperand(ARG_VOLATILE, V); }
886 
887  // Methods for support type inquiry through isa, cast, and dyn_cast:
888  static bool classof(const IntrinsicInst *I) {
889  switch (I->getIntrinsicID()) {
890  case Intrinsic::memcpy:
891  case Intrinsic::memmove:
892  case Intrinsic::memset:
893  case Intrinsic::memcpy_inline:
894  return true;
895  default:
896  return false;
897  }
898  }
899  static bool classof(const Value *V) {
900  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
901  }
902 };
903 
904 /// This class wraps the llvm.memset intrinsic.
905 class MemSetInst : public MemSetBase<MemIntrinsic> {
906 public:
907  // Methods for support type inquiry through isa, cast, and dyn_cast:
908  static bool classof(const IntrinsicInst *I) {
909  return I->getIntrinsicID() == Intrinsic::memset;
910  }
911  static bool classof(const Value *V) {
912  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
913  }
914 };
915 
916 /// This class wraps the llvm.memcpy/memmove intrinsics.
917 class MemTransferInst : public MemTransferBase<MemIntrinsic> {
918 public:
919  // Methods for support type inquiry through isa, cast, and dyn_cast:
920  static bool classof(const IntrinsicInst *I) {
921  switch (I->getIntrinsicID()) {
922  case Intrinsic::memcpy:
923  case Intrinsic::memmove:
924  case Intrinsic::memcpy_inline:
925  return true;
926  default:
927  return false;
928  }
929  }
930  static bool classof(const Value *V) {
931  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
932  }
933 };
934 
935 /// This class wraps the llvm.memcpy intrinsic.
936 class MemCpyInst : public MemTransferInst {
937 public:
938  // Methods for support type inquiry through isa, cast, and dyn_cast:
939  static bool classof(const IntrinsicInst *I) {
940  return I->getIntrinsicID() == Intrinsic::memcpy ||
941  I->getIntrinsicID() == Intrinsic::memcpy_inline;
942  }
943  static bool classof(const Value *V) {
944  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
945  }
946 };
947 
948 /// This class wraps the llvm.memmove intrinsic.
949 class MemMoveInst : public MemTransferInst {
950 public:
951  // Methods for support type inquiry through isa, cast, and dyn_cast:
952  static bool classof(const IntrinsicInst *I) {
953  return I->getIntrinsicID() == Intrinsic::memmove;
954  }
955  static bool classof(const Value *V) {
956  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
957  }
958 };
959 
960 /// This class wraps the llvm.memcpy.inline intrinsic.
961 class MemCpyInlineInst : public MemCpyInst {
962 public:
964  return cast<ConstantInt>(MemCpyInst::getLength());
965  }
966  // Methods for support type inquiry through isa, cast, and dyn_cast:
967  static bool classof(const IntrinsicInst *I) {
968  return I->getIntrinsicID() == Intrinsic::memcpy_inline;
969  }
970  static bool classof(const Value *V) {
971  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
972  }
973 };
974 
975 // The common base class for any memset/memmove/memcpy intrinsics;
976 // whether they be atomic or non-atomic.
977 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
978 // and llvm.memset/memcpy/memmove
979 class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
980 public:
981  bool isVolatile() const {
982  // Only the non-atomic intrinsics can be volatile
983  if (auto *MI = dyn_cast<MemIntrinsic>(this))
984  return MI->isVolatile();
985  return false;
986  }
987 
988  static bool classof(const IntrinsicInst *I) {
989  switch (I->getIntrinsicID()) {
990  case Intrinsic::memcpy:
991  case Intrinsic::memcpy_inline:
992  case Intrinsic::memmove:
993  case Intrinsic::memset:
994  case Intrinsic::memcpy_element_unordered_atomic:
995  case Intrinsic::memmove_element_unordered_atomic:
996  case Intrinsic::memset_element_unordered_atomic:
997  return true;
998  default:
999  return false;
1000  }
1001  }
1002  static bool classof(const Value *V) {
1003  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1004  }
1005 };
1006 
1007 /// This class represents any memset intrinsic
1008 // i.e. llvm.element.unordered.atomic.memset
1009 // and llvm.memset
1010 class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
1011 public:
1012  static bool classof(const IntrinsicInst *I) {
1013  switch (I->getIntrinsicID()) {
1014  case Intrinsic::memset:
1015  case Intrinsic::memset_element_unordered_atomic:
1016  return true;
1017  default:
1018  return false;
1019  }
1020  }
1021  static bool classof(const Value *V) {
1022  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1023  }
1024 };
1025 
1026 // This class wraps any memcpy/memmove intrinsics
1027 // i.e. llvm.element.unordered.atomic.memcpy/memmove
1028 // and llvm.memcpy/memmove
1029 class AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
1030 public:
1031  static bool classof(const IntrinsicInst *I) {
1032  switch (I->getIntrinsicID()) {
1033  case Intrinsic::memcpy:
1034  case Intrinsic::memcpy_inline:
1035  case Intrinsic::memmove:
1036  case Intrinsic::memcpy_element_unordered_atomic:
1037  case Intrinsic::memmove_element_unordered_atomic:
1038  return true;
1039  default:
1040  return false;
1041  }
1042  }
1043  static bool classof(const Value *V) {
1044  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1045  }
1046 };
1047 
1048 /// This class represents any memcpy intrinsic
1049 /// i.e. llvm.element.unordered.atomic.memcpy
1050 /// and llvm.memcpy
1052 public:
1053  static bool classof(const IntrinsicInst *I) {
1054  switch (I->getIntrinsicID()) {
1055  case Intrinsic::memcpy:
1056  case Intrinsic::memcpy_inline:
1057  case Intrinsic::memcpy_element_unordered_atomic:
1058  return true;
1059  default:
1060  return false;
1061  }
1062  }
1063  static bool classof(const Value *V) {
1064  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1065  }
1066 };
1067 
1068 /// This class represents any memmove intrinsic
1069 /// i.e. llvm.element.unordered.atomic.memmove
1070 /// and llvm.memmove
1072 public:
1073  static bool classof(const IntrinsicInst *I) {
1074  switch (I->getIntrinsicID()) {
1075  case Intrinsic::memmove:
1076  case Intrinsic::memmove_element_unordered_atomic:
1077  return true;
1078  default:
1079  return false;
1080  }
1081  }
1082  static bool classof(const Value *V) {
1083  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1084  }
1085 };
1086 
1087 /// This represents the llvm.va_start intrinsic.
1088 class VAStartInst : public IntrinsicInst {
1089 public:
1090  static bool classof(const IntrinsicInst *I) {
1091  return I->getIntrinsicID() == Intrinsic::vastart;
1092  }
1093  static bool classof(const Value *V) {
1094  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1095  }
1096 
1097  Value *getArgList() const { return const_cast<Value *>(getArgOperand(0)); }
1098 };
1099 
1100 /// This represents the llvm.va_end intrinsic.
1101 class VAEndInst : public IntrinsicInst {
1102 public:
1103  static bool classof(const IntrinsicInst *I) {
1104  return I->getIntrinsicID() == Intrinsic::vaend;
1105  }
1106  static bool classof(const Value *V) {
1107  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1108  }
1109 
1110  Value *getArgList() const { return const_cast<Value *>(getArgOperand(0)); }
1111 };
1112 
1113 /// This represents the llvm.va_copy intrinsic.
1114 class VACopyInst : public IntrinsicInst {
1115 public:
1116  static bool classof(const IntrinsicInst *I) {
1117  return I->getIntrinsicID() == Intrinsic::vacopy;
1118  }
1119  static bool classof(const Value *V) {
1120  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1121  }
1122 
1123  Value *getDest() const { return const_cast<Value *>(getArgOperand(0)); }
1124  Value *getSrc() const { return const_cast<Value *>(getArgOperand(1)); }
1125 };
1126 
1127 /// This represents the llvm.instrprof_increment intrinsic.
1129 public:
1130  static bool classof(const IntrinsicInst *I) {
1131  return I->getIntrinsicID() == Intrinsic::instrprof_increment;
1132  }
1133  static bool classof(const Value *V) {
1134  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1135  }
1136 
1138  return cast<GlobalVariable>(
1139  const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
1140  }
1141 
1143  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1144  }
1145 
1147  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
1148  }
1149 
1151  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1152  }
1153 
1154  Value *getStep() const;
1155 };
1156 
1158 public:
1159  static bool classof(const IntrinsicInst *I) {
1160  return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1161  }
1162  static bool classof(const Value *V) {
1163  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1164  }
1165 };
1166 
1167 /// This represents the llvm.instrprof_value_profile intrinsic.
1169 public:
1170  static bool classof(const IntrinsicInst *I) {
1171  return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
1172  }
1173  static bool classof(const Value *V) {
1174  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1175  }
1176 
1178  return cast<GlobalVariable>(
1179  const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
1180  }
1181 
1183  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1184  }
1185 
1187  return cast<Value>(const_cast<Value *>(getArgOperand(2)));
1188  }
1189 
1191  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1192  }
1193 
1194  // Returns the value site index.
1196  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(4)));
1197  }
1198 };
1199 
1201 public:
1202  static bool classof(const IntrinsicInst *I) {
1203  return I->getIntrinsicID() == Intrinsic::pseudoprobe;
1204  }
1205 
1206  static bool classof(const Value *V) {
1207  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1208  }
1209 
1211  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(0)));
1212  }
1213 
1215  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1216  }
1217 
1219  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
1220  }
1221 
1223  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1224  }
1225 };
1226 
1228 public:
1229  static bool classof(const IntrinsicInst *I) {
1230  return I->getIntrinsicID() == Intrinsic::experimental_noalias_scope_decl;
1231  }
1232 
1233  static bool classof(const Value *V) {
1234  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1235  }
1236 
1238  auto *MV =
1239  cast<MetadataAsValue>(getOperand(Intrinsic::NoAliasScopeDeclScopeArg));
1240  return cast<MDNode>(MV->getMetadata());
1241  }
1242 
1243  void setScopeList(MDNode *ScopeList) {
1245  MetadataAsValue::get(getContext(), ScopeList));
1246  }
1247 };
1248 
1249 // Defined in Statepoint.h -- NOT a subclass of IntrinsicInst
1250 class GCStatepointInst;
1251 
1252 /// Common base class for representing values projected from a statepoint.
1253 /// Currently, the only projections available are gc.result and gc.relocate.
1255 public:
1256  static bool classof(const IntrinsicInst *I) {
1257  return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
1258  I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1259  }
1260 
1261  static bool classof(const Value *V) {
1262  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1263  }
1264 
1265  /// Return true if this relocate is tied to the invoke statepoint.
1266  /// This includes relocates which are on the unwinding path.
1267  bool isTiedToInvoke() const {
1268  const Value *Token = getArgOperand(0);
1269 
1270  return isa<LandingPadInst>(Token) || isa<InvokeInst>(Token);
1271  }
1272 
1273  /// The statepoint with which this gc.relocate is associated.
1274  const GCStatepointInst *getStatepoint() const;
1275 };
1276 
1277 /// Represents calls to the gc.relocate intrinsic.
1279 public:
1280  static bool classof(const IntrinsicInst *I) {
1281  return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
1282  }
1283 
1284  static bool classof(const Value *V) {
1285  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1286  }
1287 
1288  /// The index into the associate statepoint's argument list
1289  /// which contains the base pointer of the pointer whose
1290  /// relocation this gc.relocate describes.
1291  unsigned getBasePtrIndex() const {
1292  return cast<ConstantInt>(getArgOperand(1))->getZExtValue();
1293  }
1294 
1295  /// The index into the associate statepoint's argument list which
1296  /// contains the pointer whose relocation this gc.relocate describes.
1297  unsigned getDerivedPtrIndex() const {
1298  return cast<ConstantInt>(getArgOperand(2))->getZExtValue();
1299  }
1300 
1301  Value *getBasePtr() const;
1302  Value *getDerivedPtr() const;
1303 };
1304 
1305 /// Represents calls to the gc.result intrinsic.
1307 public:
1308  static bool classof(const IntrinsicInst *I) {
1309  return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1310  }
1311 
1312  static bool classof(const Value *V) {
1313  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1314  }
1315 };
1316 
1317 
1318 /// This represents the llvm.assume intrinsic.
1319 class AssumeInst : public IntrinsicInst {
1320 public:
1321  static bool classof(const IntrinsicInst *I) {
1322  return I->getIntrinsicID() == Intrinsic::assume;
1323  }
1324  static bool classof(const Value *V) {
1325  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1326  }
1327 };
1328 
1329 } // end namespace llvm
1330 
1331 #endif // LLVM_IR_INTRINSICINST_H
llvm::DbgVariableIntrinsic::setRawLocation
void setRawLocation(Metadata *Location)
Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOp...
Definition: IntrinsicInst.h:276
llvm::NoAliasScopeDeclInst
Definition: IntrinsicInst.h:1227
i
i
Definition: README.txt:29
llvm::DbgDeclareInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:321
llvm::DbgVariableIntrinsic::getExpression
DIExpression * getExpression() const
Definition: IntrinsicInst.h:257
llvm::BinaryOpIntrinsic::getBinaryOp
Instruction::BinaryOps getBinaryOp() const
Returns the binary operation underlying the intrinsic.
Definition: IntrinsicInst.cpp:558
llvm::VPIntrinsic::getVectorLengthParamPos
static Optional< unsigned > getVectorLengthParamPos(Intrinsic::ID IntrinsicID)
Definition: IntrinsicInst.cpp:331
llvm::DbgAddrIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:338
llvm::SaturatingInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:612
llvm::MemCpyInlineInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:970
llvm::MemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:908
llvm::DbgInfoIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:138
llvm::MemCpyInlineInst::getLength
ConstantInt * getLength() const
Definition: IntrinsicInst.h:963
llvm::MemIntrinsicBase::getDestAlignment
unsigned getDestAlignment() const
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:660
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm::DbgVariableIntrinsic::getRawExpression
Metadata * getRawExpression() const
Definition: IntrinsicInst.h:269
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::DbgDeclareInst::getAddress
Value * getAddress() const
Definition: IntrinsicInst.h:310
llvm::InstrProfIncrementInst::getStep
Value * getStep() const
Definition: IntrinsicInst.cpp:181
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::PseudoProbeInst
Definition: IntrinsicInst.h:1200
llvm::DbgValueInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:360
llvm::InstrProfIncrementInstStep::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1162
llvm::MinMaxIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:512
llvm::WithOverflowInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:591
Metadata.h
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:720
llvm::MemIntrinsicBase::getDestAlign
MaybeAlign getDestAlign() const
Definition: IntrinsicInst.h:665
llvm::InstrProfValueProfileInst::getHash
ConstantInt * getHash() const
Definition: IntrinsicInst.h:1182
llvm::ElementCount
Definition: TypeSize.h:386
llvm::ConstrainedFPCmpIntrinsic
Constrained floating point compare intrinsics.
Definition: IntrinsicInst.h:490
DebugInfoMetadata.h
llvm::ConstrainedFPCmpIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:504
llvm::MemTransferInst
This class wraps the llvm.memcpy/memmove intrinsics.
Definition: IntrinsicInst.h:917
llvm::Function
Definition: Function.h:62
llvm::AtomicMemIntrinsic::getElementSizeInBytes
uint32_t getElementSizeInBytes() const
Definition: IntrinsicInst.h:794
llvm::GCRelocateInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1280
llvm::DbgVariableIntrinsic::location_op_iterator::operator*
Value * operator*()
Definition: IntrinsicInst.h:176
llvm::IntrinsicInst::getIntrinsicID
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
Definition: IntrinsicInst.h:52
llvm::MemMoveInst
This class wraps the llvm.memmove intrinsic.
Definition: IntrinsicInst.h:949
minimum
Should compile r2 movcc movcs str strb mov lr r1 movcs movcc mov lr r1 str mov mov cmp r1 movlo r2 str bx lr r0 mov mov cmp r0 movhs r2 mov r1 bx lr Some of the NEON intrinsics may be appropriate for more general either as target independent intrinsics or perhaps elsewhere in the ARM backend Some of them may also be lowered to target independent and perhaps some new SDNodes could be added For minimum
Definition: README.txt:489
llvm::VPReductionIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:467
llvm::AtomicMemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:814
llvm::AnyMemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1021
llvm::AtomicMemIntrinsic::getRawElementSizeInBytes
Value * getRawElementSizeInBytes() const
Definition: IntrinsicInst.h:786
llvm::BinaryOpIntrinsic::getRHS
Value * getRHS() const
Definition: IntrinsicInst.h:576
llvm::MemIntrinsicBase::getDestAddressSpace
unsigned getDestAddressSpace() const
Definition: IntrinsicInst.h:654
llvm::BinaryOpIntrinsic::getLHS
Value * getLHS() const
Definition: IntrinsicInst.h:575
llvm::InstrProfIncrementInstStep::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1159
llvm::VACopyInst::getSrc
Value * getSrc() const
Definition: IntrinsicInst.h:1124
llvm::VPIntrinsic::setVectorLengthParam
void setVectorLengthParam(Value *)
Definition: IntrinsicInst.cpp:313
llvm::VAStartInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1093
llvm::GlobalVariable
Definition: GlobalVariable.h:40
llvm::BinaryOpIntrinsic
This class represents an intrinsic that is based on a binary operation.
Definition: IntrinsicInst.h:552
llvm::MemIntrinsic::getVolatileCst
ConstantInt * getVolatileCst() const
Definition: IntrinsicInst.h:879
llvm::VPReductionIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: IntrinsicInst.h:464
llvm::MemMoveInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:952
llvm::DbgVariableIntrinsic::replaceVariableLocationOp
void replaceVariableLocationOp(Value *OldValue, Value *NewValue)
Definition: IntrinsicInst.cpp:82
llvm::VPIntrinsic::canIgnoreVectorLengthParam
bool canIgnoreVectorLengthParam() const
Definition: IntrinsicInst.cpp:429
llvm::DbgVariableIntrinsic::location_op_iterator::operator==
bool operator==(const location_op_iterator &RHS) const
Definition: IntrinsicInst.h:167
llvm::ConstrainedFPIntrinsic::isDefaultFPEnvironment
bool isDefaultFPEnvironment() const
Definition: IntrinsicInst.cpp:213
llvm::CallBase::getArgOperandUse
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
Definition: InstrTypes.h:1339
llvm::NoAliasScopeDeclInst::getScopeList
MDNode * getScopeList() const
Definition: IntrinsicInst.h:1237
llvm::AtomicMemIntrinsic::getElementSizeInBytesCst
ConstantInt * getElementSizeInBytesCst() const
Definition: IntrinsicInst.h:790
NewExpr
Definition: ItaniumDemangle.h:1928
llvm::AssumeInst
This represents the llvm.assume intrinsic.
Definition: IntrinsicInst.h:1319
llvm::GCProjectionInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1261
llvm::AnyMemIntrinsic::isVolatile
bool isVolatile() const
Definition: IntrinsicInst.h:981
llvm::MemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:899
llvm::VPIntrinsic::getMemoryDataParam
Value * getMemoryDataParam() const
Definition: IntrinsicInst.cpp:371
llvm::GCRelocateInst::getBasePtrIndex
unsigned getBasePtrIndex() const
The index into the associate statepoint's argument list which contains the base pointer of the pointe...
Definition: IntrinsicInst.h:1291
llvm::DbgVariableIntrinsic::getVariable
DILocalVariable * getVariable() const
Definition: IntrinsicInst.h:253
llvm::MemIntrinsic
This is the common base class for memset/memcpy/memmove.
Definition: IntrinsicInst.h:874
llvm::VPIntrinsic::getFunctionalOpcodeForVP
static Optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)
Definition: IntrinsicInst.cpp:404
llvm::Optional< uint64_t >
llvm::SmallPtrSet< Value *, 4 >
llvm::MemIntrinsicBase::setDestAlignment
void setDestAlignment(MaybeAlign Alignment)
Definition: IntrinsicInst.h:679
llvm::ConstrainedFPIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.cpp:273
llvm::InstrProfIncrementInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1133
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2586
llvm::DbgLabelInst::getRawLabel
Metadata * getRawLabel() const
Definition: IntrinsicInst.h:374
llvm::WithOverflowInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:604
llvm::AnyMemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1012
llvm::CallBase::addParamAttr
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
Definition: InstrTypes.h:1510
llvm::Type::getInt8Ty
static IntegerType * getInt8Ty(LLVMContext &C)
Definition: Type.cpp:239
llvm::DbgVariableIntrinsic::getRawVariable
Metadata * getRawVariable() const
Definition: IntrinsicInst.h:265
llvm::DbgVariableIntrinsic::getVariableLocationOp
Value * getVariableLocationOp(unsigned OpIdx) const
Definition: IntrinsicInst.cpp:60
llvm::APIntOps::umin
const APInt & umin(const APInt &A, const APInt &B)
Determine the smaller of two APInts considered to be unsigned.
Definition: APInt.h:2128
llvm::InstrProfIncrementInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1130
llvm::MemSetBase::getValue
Value * getValue() const
Definition: IntrinsicInst.h:766
llvm::VPIntrinsic::setMaskParam
void setMaskParam(Value *)
Definition: IntrinsicInst.cpp:302
llvm::GCResultInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1312
llvm::DbgVariableIntrinsic::setVariable
void setVariable(DILocalVariable *NewVar)
Definition: IntrinsicInst.h:213
llvm::GCRelocateInst::getDerivedPtrIndex
unsigned getDerivedPtrIndex() const
The index into the associate statepoint's argument list which contains the pointer whose relocation t...
Definition: IntrinsicInst.h:1297
llvm::InstrProfValueProfileInst::getValueKind
ConstantInt * getValueKind() const
Definition: IntrinsicInst.h:1190
llvm::VAStartInst
This represents the llvm.va_start intrinsic.
Definition: IntrinsicInst.h:1088
llvm::GCStatepointInst
Represents a gc.statepoint intrinsic call.
Definition: Statepoint.h:63
llvm::DbgVariableIntrinsic::location_op_iterator::operator=
location_op_iterator & operator=(const location_op_iterator &R)
Definition: IntrinsicInst.h:163
llvm::MemIntrinsicBase::setDestAlignment
void setDestAlignment(Align Alignment)
Definition: IntrinsicInst.h:685
llvm::VPReductionIntrinsic::isVPReduction
static bool isVPReduction(Intrinsic::ID ID)
Definition: IntrinsicInst.cpp:516
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
llvm::MemCpyInlineInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:967
llvm::Intrinsic::getType
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
Definition: Function.cpp:1335
llvm::CallBase::removeParamAttr
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
Definition: InstrTypes.h:1552
llvm::GCProjectionInst
Common base class for representing values projected from a statepoint.
Definition: IntrinsicInst.h:1254
llvm::MemTransferBase::getSourceAddressSpace
unsigned getSourceAddressSpace() const
Definition: IntrinsicInst.h:719
llvm::DbgVariableIntrinsic::addVariableLocationOps
void addVariableLocationOps(ArrayRef< Value * > NewValues, DIExpression *NewExpr)
Adding a new location operand will always result in this intrinsic using an ArgList,...
Definition: IntrinsicInst.cpp:121
Constants.h
llvm::RegState::Undef
@ Undef
Value of the register doesn't matter.
Definition: MachineInstrBuilder.h:52
llvm::DbgValueInst
This represents the llvm.dbg.value instruction.
Definition: IntrinsicInst.h:347
BaseCL
llvm::MemSetBase::getValueUse
const Use & getValueUse() const
Definition: IntrinsicInst.h:769
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3097
llvm::DbgVariableIntrinsic::isAddressOfVariable
bool isAddressOfVariable() const
Does this describe the address of a local variable.
Definition: IntrinsicInst.h:231
llvm::VPReductionIntrinsic
This represents vector predication reduction intrinsics.
Definition: IntrinsicInst.h:452
Intrinsics.h
llvm::ConstrainedFPIntrinsic
This is the common base class for constrained floating point intrinsics.
Definition: IntrinsicInst.h:474
llvm::MemSetBase::setValue
void setValue(Value *Val)
Definition: IntrinsicInst.h:772
llvm::AtomicMemTransferInst
Definition: IntrinsicInst.h:833
llvm::CallBase::getCalledFunction
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
Definition: InstrTypes.h:1383
llvm::PseudoProbeInst::getFactor
ConstantInt * getFactor() const
Definition: IntrinsicInst.h:1222
llvm::InstrProfValueProfileInst::getTargetValue
Value * getTargetValue() const
Definition: IntrinsicInst.h:1186
llvm::MemTransferBase::getRawSourceUse
Use & getRawSourceUse()
Definition: IntrinsicInst.h:712
llvm::AnyMemMoveInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1073
llvm::MemTransferBase::getRawSource
Value * getRawSource() const
Return the arguments to the instruction.
Definition: IntrinsicInst.h:706
llvm::DbgDeclareInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:318
llvm::MemCpyInlineInst
This class wraps the llvm.memcpy.inline intrinsic.
Definition: IntrinsicInst.h:961
llvm::VACopyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1119
llvm::MemCpyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:939
llvm::BinaryOpIntrinsic::getNoWrapKind
unsigned getNoWrapKind() const
Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
Definition: IntrinsicInst.cpp:591
llvm::DbgInfoIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:141
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:109
llvm::MinMaxIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:523
llvm::DbgVariableIntrinsic::setExpression
void setExpression(DIExpression *NewExpr)
Definition: IntrinsicInst.h:217
llvm::SaturatingInst
Represents a saturating add/sub intrinsic.
Definition: IntrinsicInst.h:610
llvm::InstrProfIncrementInstStep
Definition: IntrinsicInst.h:1157
llvm::UndefValue::get
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Definition: Constants.cpp:1796
llvm::VPIntrinsic::getForOpcode
static Intrinsic::ID getForOpcode(unsigned OC)
The llvm.vp.* intrinsics for this instruction Opcode.
Definition: IntrinsicInst.cpp:418
llvm::IntrinsicInst::operator=
IntrinsicInst & operator=(const IntrinsicInst &)=delete
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(MaybeAlign Alignment)
Definition: IntrinsicInst.h:746
llvm::InstrProfValueProfileInst::getIndex
ConstantInt * getIndex() const
Definition: IntrinsicInst.h:1195
llvm::DbgVariableIntrinsic::hasArgList
bool hasArgList() const
Definition: IntrinsicInst.h:227
llvm::DbgInfoIntrinsic
This is the common base class for debug info intrinsics.
Definition: IntrinsicInst.h:134
llvm::VPIntrinsic::getDeclarationForParams
static Function * getDeclarationForParams(Module *M, Intrinsic::ID, ArrayRef< Value * > Params)
Declares a llvm.vp.
Definition: IntrinsicInst.cpp:471
llvm::AtomicMemCpyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:856
llvm::AnyMemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:988
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::AtomicMemCpyInst
This class represents the atomic memcpy intrinsic i.e.
Definition: IntrinsicInst.h:851
llvm::MemTransferBase::getSourceAlign
MaybeAlign getSourceAlign() const
Definition: IntrinsicInst.h:731
llvm::MemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:920
llvm::DbgVariableIntrinsic::getNumVariableLocationOps
unsigned getNumVariableLocationOps() const
Definition: IntrinsicInst.h:221
llvm::MemSetInst
This class wraps the llvm.memset intrinsic.
Definition: IntrinsicInst.h:905
llvm::AnyMemTransferInst
Definition: IntrinsicInst.h:1029
llvm::maxnum
LLVM_READONLY APFloat maxnum(const APFloat &A, const APFloat &B)
Implements IEEE maxNum semantics.
Definition: APFloat.h:1307
llvm::VPIntrinsic::getMemoryPointerParamPos
static Optional< unsigned > getMemoryPointerParamPos(Intrinsic::ID)
Definition: IntrinsicInst.cpp:358
llvm::AtomicMemSetInst
This class represents atomic memset intrinsic.
Definition: IntrinsicInst.h:821
llvm::VAEndInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1106
llvm::VPIntrinsic::getVectorLengthParam
Value * getVectorLengthParam() const
Definition: IntrinsicInst.cpp:307
llvm::NoAliasScopeDeclInst::setScopeList
void setScopeList(MDNode *ScopeList)
Definition: IntrinsicInst.h:1243
llvm::VPIntrinsic::getFunctionalOpcode
Optional< unsigned > getFunctionalOpcode() const
Definition: IntrinsicInst.h:443
llvm::Value::Value
Value(Type *Ty, unsigned scid)
Definition: Value.cpp:53
llvm::DbgVariableIntrinsic::location_op_iterator::operator*
const Value * operator*() const
Definition: IntrinsicInst.h:170
llvm::BinaryOpIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:554
llvm::PseudoProbeInst::getFuncGuid
ConstantInt * getFuncGuid() const
Definition: IntrinsicInst.h:1210
llvm::DbgVariableIntrinsic
This is the common base class for debug info intrinsics for variables.
Definition: IntrinsicInst.h:148
llvm::VPIntrinsic::getStaticVectorLength
ElementCount getStaticVectorLength() const
Definition: IntrinsicInst.cpp:284
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::DbgVariableIntrinsic::location_op_iterator::location_op_iterator
location_op_iterator(ValueAsMetadata **MultiIter)
Definition: IntrinsicInst.h:160
llvm::VPIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:438
llvm::GCRelocateInst
Represents calls to the gc.relocate intrinsic.
Definition: IntrinsicInst.h:1278
llvm::DbgVariableIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:286
llvm::InstrProfValueProfileInst
This represents the llvm.instrprof_value_profile intrinsic.
Definition: IntrinsicInst.h:1168
llvm::BinaryOpIntrinsic::isSigned
bool isSigned() const
Whether the intrinsic is signed or unsigned.
Definition: IntrinsicInst.cpp:578
llvm::DbgVariableIntrinsic::setUndef
void setUndef()
Definition: IntrinsicInst.h:235
llvm::AtomicMemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:823
llvm::DbgDeclareInst
This represents the llvm.dbg.declare instruction.
Definition: IntrinsicInst.h:308
llvm::VPIntrinsic::getPointerAlignment
MaybeAlign getPointerAlignment() const
Definition: IntrinsicInst.cpp:345
llvm::DbgLabelInst
This represents the llvm.dbg.label instruction.
Definition: IntrinsicInst.h:370
llvm::GCRelocateInst::getDerivedPtr
Value * getDerivedPtr() const
Definition: IntrinsicInst.cpp:623
llvm::MemTransferBase::setSource
void setSource(Value *Ptr)
Definition: IntrinsicInst.h:735
llvm::DbgLabelInst::getLabel
DILabel * getLabel() const
Definition: IntrinsicInst.h:372
llvm::ConstrainedFPIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:484
llvm::AssumeInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1321
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:66
llvm::IntrinsicInst::classof
static bool classof(const CallInst *I)
Definition: IntrinsicInst.h:110
llvm::InstrProfIncrementInst::getIndex
ConstantInt * getIndex() const
Definition: IntrinsicInst.h:1150
llvm::VPIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:435
llvm::VPIntrinsic::isVPIntrinsic
static bool isVPIntrinsic(Intrinsic::ID)
Definition: IntrinsicInst.cpp:390
llvm::GCProjectionInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1256
llvm::MemTransferBase
Common base class for all memory transfer intrinsics.
Definition: IntrinsicInst.h:700
llvm::AtomicMemCpyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:853
maximum
Should compile r2 movcc movcs str strb mov lr r1 movcs movcc mov lr r1 str mov mov cmp r1 movlo r2 str bx lr r0 mov mov cmp r0 movhs r2 mov r1 bx lr Some of the NEON intrinsics may be appropriate for more general either as target independent intrinsics or perhaps elsewhere in the ARM backend Some of them may also be lowered to target independent and perhaps some new SDNodes could be added For maximum
Definition: README.txt:489
llvm::MemCpyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:943
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MemIntrinsicBase::setDest
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
Definition: IntrinsicInst.h:668
llvm::MinMaxIntrinsic::isSigned
bool isSigned() const
Whether the intrinsic is signed or unsigned.
Definition: IntrinsicInst.h:547
memcpy
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
llvm::AssumeInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1324
llvm::DbgVariableIntrinsic::location_op_iterator::operator++
location_op_iterator & operator++()
Definition: IntrinsicInst.h:182
llvm::SystemZISD::OC
@ OC
Definition: SystemZISelLowering.h:122
llvm::MemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:930
llvm::DbgVariableIntrinsic::location_op_iterator::location_op_iterator
location_op_iterator(ValueAsMetadata *SingleIter)
Definition: IntrinsicInst.h:159
llvm::MinMaxIntrinsic::getPredicate
ICmpInst::Predicate getPredicate() const
Returns the comparison predicate underlying the intrinsic.
Definition: IntrinsicInst.h:531
llvm::MemIntrinsicBase::getLengthUse
Use & getLengthUse()
Definition: IntrinsicInst.h:647
llvm::ValueAsMetadata::getValue
Value * getValue() const
Definition: Metadata.h:384
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MDNode
Metadata node.
Definition: Metadata.h:906
llvm::InstrProfIncrementInst::getNumCounters
ConstantInt * getNumCounters() const
Definition: IntrinsicInst.h:1146
llvm::MemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:911
llvm::MinMaxIntrinsic::getLHS
Value * getLHS() const
Definition: IntrinsicInst.h:527
llvm::MemIntrinsicBase::setLength
void setLength(Value *L)
Definition: IntrinsicInst.h:691
llvm::AnyMemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1031
llvm::VPIntrinsic::getMemoryDataParamPos
static Optional< unsigned > getMemoryDataParamPos(Intrinsic::ID)
Definition: IntrinsicInst.cpp:378
llvm::VACopyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1116
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(Align Alignment)
Definition: IntrinsicInst.h:752
llvm::User::setOperand
void setOperand(unsigned i, Value *Val)
Definition: User.h:174
llvm::AtomicMemMoveInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:865
llvm::Intrinsic::NoAliasScopeDeclScopeArg
static const int NoAliasScopeDeclScopeArg
Definition: Intrinsics.h:38
llvm::ConstrainedFPCmpIntrinsic::getPredicate
FCmpInst::Predicate getPredicate() const
Definition: IntrinsicInst.cpp:229
llvm::Function::getIntrinsicID
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
Definition: Function.h:207
llvm::APIntOps::smin
const APInt & smin(const APInt &A, const APInt &B)
Determine the smaller of two APInts considered to be signed.
Definition: APInt.h:2118
llvm::NoAliasScopeDeclInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1233
llvm::InstrProfIncrementInst::getHash
ConstantInt * getHash() const
Definition: IntrinsicInst.h:1142
llvm::MemSetBase
Common base class for all memset intrinsics.
Definition: IntrinsicInst.h:761
llvm::MemIntrinsicBase::getDest
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions (including addrspacecast) that ...
Definition: IntrinsicInst.h:652
llvm::AnyMemMoveInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1082
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::ConstrainedFPIntrinsic::getExceptionBehavior
Optional< fp::ExceptionBehavior > getExceptionBehavior() const
Definition: IntrinsicInst.cpp:202
llvm::VAEndInst
This represents the llvm.va_end intrinsic.
Definition: IntrinsicInst.h:1101
llvm::AnyMemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1002
llvm::any_of
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1558
llvm::CallBase::getParamAlign
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Definition: InstrTypes.h:1714
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(unsigned Alignment)
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:743
llvm::PseudoProbeInst::getIndex
ConstantInt * getIndex() const
Definition: IntrinsicInst.h:1214
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::Value::getType
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:255
llvm::GCResultInst
Represents calls to the gc.result intrinsic.
Definition: IntrinsicInst.h:1306
llvm::ConstantInt::isZero
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
Definition: Constants.h:194
llvm::PseudoProbeInst::getAttributes
ConstantInt * getAttributes() const
Definition: IntrinsicInst.h:1218
llvm::DbgVariableIntrinsic::getRawLocation
Metadata * getRawLocation() const
Definition: IntrinsicInst.h:261
uint32_t
llvm::Value::getContext
LLVMContext & getContext() const
All values hold a context through their type.
Definition: Value.cpp:990
llvm::InstrProfValueProfileInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1173
llvm::AtomicMemIntrinsic::setElementSizeInBytes
void setElementSizeInBytes(Constant *V)
Definition: IntrinsicInst.h:798
llvm::DbgVariableIntrinsic::getFragmentSizeInBits
Optional< uint64_t > getFragmentSizeInBits() const
Get the size (in bits) of the variable, or fragment of the variable that is described.
Definition: IntrinsicInst.cpp:138
llvm::WithOverflowInst
Represents an op.with.overflow intrinsic.
Definition: IntrinsicInst.h:589
llvm::VPReductionIntrinsic::getStartParamPos
unsigned getStartParamPos() const
Definition: IntrinsicInst.cpp:532
llvm::MemMoveInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:955
llvm::CallBase::setArgOperand
void setArgOperand(unsigned i, Value *v)
Definition: InstrTypes.h:1333
llvm::PointerUnion
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition: PointerUnion.h:120
llvm::Value::stripPointerCasts
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Definition: Value.cpp:687
llvm::VAEndInst::getArgList
Value * getArgList() const
Definition: IntrinsicInst.h:1110
llvm::AtomicMemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:835
llvm::ConstantInt::getZExtValue
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
Definition: Constants.h:142
llvm::MDNode::getContext
LLVMContext & getContext() const
Definition: Metadata.h:967
llvm::Attribute::getWithAlignment
static Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
Definition: Attributes.cpp:166
llvm::IntrinsicInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:115
llvm::APIntOps::umax
const APInt & umax(const APInt &A, const APInt &B)
Determine the larger of two APInts considered to be unsigned.
Definition: APInt.h:2133
llvm::GCResultInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1308
llvm::GCRelocateInst::getBasePtr
Value * getBasePtr() const
Definition: IntrinsicInst.cpp:617
llvm::MemIntrinsicBase::getRawDestUse
Use & getRawDestUse()
Definition: IntrinsicInst.h:641
llvm::minnum
LLVM_READONLY APFloat minnum(const APFloat &A, const APFloat &B)
Implements IEEE minNum semantics.
Definition: APFloat.h:1296
FPEnv.h
llvm::AtomicMemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:844
llvm::InstrProfValueProfileInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1170
llvm::GCRelocateInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1284
llvm::MemIntrinsicBase::getLength
Value * getLength() const
Definition: IntrinsicInst.h:643
llvm::ConstrainedFPIntrinsic::isUnaryOp
bool isUnaryOp() const
Definition: IntrinsicInst.cpp:251
llvm::AnyMemSetInst
This class represents any memset intrinsic.
Definition: IntrinsicInst.h:1010
llvm::VPIntrinsic::getMemoryPointerParam
Value * getMemoryPointerParam() const
Definition: IntrinsicInst.cpp:352
llvm::MetadataAsValue::get
static MetadataAsValue * get(LLVMContext &Context, Metadata *MD)
Definition: Metadata.cpp:106
llvm::SaturatingInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:623
llvm::VACopyInst
This represents the llvm.va_copy intrinsic.
Definition: IntrinsicInst.h:1114
llvm::VAStartInst::getArgList
Value * getArgList() const
Definition: IntrinsicInst.h:1097
llvm::VPIntrinsic
This is the common base class for vector predication intrinsics.
Definition: IntrinsicInst.h:390
GlobalVariable.h
llvm::MemIntrinsicBase
Common base class for all memory intrinsics.
Definition: IntrinsicInst.h:632
llvm::VPReductionIntrinsic::getVectorParamPos
unsigned getVectorParamPos() const
Definition: IntrinsicInst.cpp:528
llvm::MemIntrinsicBase::setDestAlignment
void setDestAlignment(unsigned Alignment)
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:676
Casting.h
Function.h
llvm::NoAliasScopeDeclInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1229
llvm::isDbgInfoIntrinsic
static bool isDbgInfoIntrinsic(Intrinsic::ID ID)
Check if ID corresponds to a debug info intrinsic.
Definition: IntrinsicInst.h:121
llvm::MemTransferBase::getSourceAlignment
unsigned getSourceAlignment() const
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:725
llvm::CmpInst::isSigned
bool isSigned() const
Definition: InstrTypes.h:934
llvm::VACopyInst::getDest
Value * getDest() const
Definition: IntrinsicInst.h:1123
llvm::MemIntrinsicBase::getLengthUse
const Use & getLengthUse() const
Definition: IntrinsicInst.h:646
llvm::ConstrainedFPIntrinsic::isTernaryOp
bool isTernaryOp() const
Definition: IntrinsicInst.cpp:262
llvm::VAEndInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1103
llvm::VPIntrinsic::getMaskParamPos
static Optional< unsigned > getMaskParamPos(Intrinsic::ID IntrinsicID)
Definition: IntrinsicInst.cpp:318
llvm::AnyMemMoveInst
This class represents any memmove intrinsic i.e.
Definition: IntrinsicInst.h:1071
llvm::IntrinsicInst
A wrapper class for inspecting calls to intrinsic functions.
Definition: IntrinsicInst.h:45
llvm::InstrProfIncrementInst
This represents the llvm.instrprof_increment intrinsic.
Definition: IntrinsicInst.h:1128
llvm::AtomicMemIntrinsic
Definition: IntrinsicInst.h:781
llvm::Instruction::BinaryOps
BinaryOps
Definition: Instruction.h:785
llvm::MemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:888
llvm::AtomicMemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:826
Instructions.h
llvm::MemCpyInst
This class wraps the llvm.memcpy intrinsic.
Definition: IntrinsicInst.h:936
llvm::MemIntrinsicBase::getRawDestUse
const Use & getRawDestUse() const
Definition: IntrinsicInst.h:640
llvm::MinMaxIntrinsic
This class represents min/max intrinsics.
Definition: IntrinsicInst.h:510
llvm::PseudoProbeInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1202
llvm::MemIntrinsic::isVolatile
bool isVolatile() const
Definition: IntrinsicInst.h:883
llvm::DbgVariableIntrinsic::location_op_iterator
Definition: IntrinsicInst.h:153
llvm::DbgValueInst::getValue
Value * getValue(unsigned OpIdx=0) const
Definition: IntrinsicInst.h:351
llvm::CallBase::getArgOperand
Value * getArgOperand(unsigned i) const
Definition: InstrTypes.h:1328
llvm::DbgAddrIntrinsic::getAddress
Value * getAddress() const
Definition: IntrinsicInst.h:330
llvm::IntrinsicInst::isCommutative
bool isCommutative() const
Return true if swapping the first two arguments to the intrinsic produces the same result.
Definition: IntrinsicInst.h:58
llvm::DbgAddrIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:341
llvm::DbgVariableIntrinsic::location_ops
iterator_range< location_op_iterator > location_ops() const
Get the locations corresponding to the variable referenced by the debug info intrinsic.
Definition: IntrinsicInst.cpp:43
llvm::DbgVariableIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:296
llvm::InstrProfValueProfileInst::getName
GlobalVariable * getName() const
Definition: IntrinsicInst.h:1177
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::AtomicMemMoveInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:868
llvm::IntrinsicInst::isAssumeLikeIntrinsic
bool isAssumeLikeIntrinsic() const
Definition: IntrinsicInst.h:87
llvm::MemIntrinsicBase::getRawDest
Value * getRawDest() const
Definition: IntrinsicInst.h:637
llvm::ConstrainedFPCmpIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:495
llvm::MemIntrinsic::setVolatile
void setVolatile(Constant *V)
Definition: IntrinsicInst.h:885
llvm::AtomicMemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:804
llvm::ValueAsMetadata
Value wrapper in the Metadata hierarchy.
Definition: Metadata.h:344
llvm::BinaryOpIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:571
llvm::ConstrainedFPIntrinsic::getRoundingMode
Optional< RoundingMode > getRoundingMode() const
Definition: IntrinsicInst.cpp:190
DerivedTypes.h
llvm::IntrinsicInst::IntrinsicInst
IntrinsicInst()=delete
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1475
llvm::GCProjectionInst::isTiedToInvoke
bool isTiedToInvoke() const
Return true if this relocate is tied to the invoke statepoint.
Definition: IntrinsicInst.h:1267
llvm::VPIntrinsic::getMaskParam
Value * getMaskParam() const
Definition: IntrinsicInst.cpp:296
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3185
llvm::MemTransferBase::getRawSourceUse
const Use & getRawSourceUse() const
Definition: IntrinsicInst.h:709
llvm::AnyMemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1043
llvm::User::getOperand
Value * getOperand(unsigned i) const
Definition: User.h:169
llvm::InstrProfIncrementInst::getName
GlobalVariable * getName() const
Definition: IntrinsicInst.h:1137
llvm::AtomicMemMoveInst
This class represents the atomic memmove intrinsic i.e.
Definition: IntrinsicInst.h:863
llvm::DbgLabelInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:383
llvm::DbgVariableIntrinsic::location_op_iterator::location_op_iterator
location_op_iterator(const location_op_iterator &R)
Definition: IntrinsicInst.h:162
llvm::PseudoProbeInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1206
llvm::DbgVariableIntrinsic::location_op_iterator::operator--
location_op_iterator & operator--()
Definition: IntrinsicInst.h:189
Value.h
llvm::AnyMemIntrinsic
Definition: IntrinsicInst.h:979
llvm::MemSetBase::getValueUse
Use & getValueUse()
Definition: IntrinsicInst.h:770
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::DbgAddrIntrinsic
This represents the llvm.dbg.addr instruction.
Definition: IntrinsicInst.h:328
llvm::APIntOps::smax
const APInt & smax(const APInt &A, const APInt &B)
Determine the larger of two APInts considered to be signed.
Definition: APInt.h:2123
llvm::DbgValueInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:363
llvm::DbgLabelInst::classof
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: IntrinsicInst.h:380
llvm::DbgValueInst::getValues
iterator_range< location_op_iterator > getValues() const
Definition: IntrinsicInst.h:354
llvm::AnyMemCpyInst
This class represents any memcpy intrinsic i.e.
Definition: IntrinsicInst.h:1051
llvm::GCProjectionInst::getStatepoint
const GCStatepointInst * getStatepoint() const
The statepoint with which this gc.relocate is associated.
Definition: IntrinsicInst.cpp:598
llvm::MinMaxIntrinsic::getRHS
Value * getRHS() const
Definition: IntrinsicInst.h:528
llvm::Use
A Use represents the edge between a Value definition and its users.
Definition: Use.h:44
llvm::AnyMemCpyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1053
llvm::AnyMemCpyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1063
llvm::MemTransferBase::getSource
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it,...
Definition: IntrinsicInst.h:717
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:364
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::DbgVariableIntrinsic::isUndef
bool isUndef() const
Definition: IntrinsicInst.h:247
llvm::VAStartInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1090