LLVM  13.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 
208  void setVariable(DILocalVariable *NewVar) {
209  setArgOperand(1, MetadataAsValue::get(NewVar->getContext(), NewVar));
210  }
211 
213  setArgOperand(2, MetadataAsValue::get(NewExpr->getContext(), NewExpr));
214  }
215 
216  unsigned getNumVariableLocationOps() const {
217  if (hasArgList())
218  return cast<DIArgList>(getRawLocation())->getArgs().size();
219  return 1;
220  }
221 
222  bool hasArgList() const { return isa<DIArgList>(getRawLocation()); }
223 
224  /// Does this describe the address of a local variable. True for dbg.addr
225  /// and dbg.declare, but not dbg.value, which describes its value.
226  bool isAddressOfVariable() const {
227  return getIntrinsicID() != Intrinsic::dbg_value;
228  }
229 
230  void setUndef() {
231  // TODO: When/if we remove duplicate values from DIArgLists, we don't need
232  // this set anymore.
233  SmallPtrSet<Value *, 4> RemovedValues;
234  for (Value *OldValue : location_ops()) {
235  if (!RemovedValues.insert(OldValue).second)
236  continue;
237  Value *Undef = UndefValue::get(OldValue->getType());
238  replaceVariableLocationOp(OldValue, Undef);
239  }
240  }
241 
242  bool isUndef() const {
243  return (getNumVariableLocationOps() == 0 &&
244  !getExpression()->isComplex()) ||
245  any_of(location_ops(), [](Value *V) { return isa<UndefValue>(V); });
246  }
247 
249  return cast<DILocalVariable>(getRawVariable());
250  }
251 
253  return cast<DIExpression>(getRawExpression());
254  }
255 
257  return cast<MetadataAsValue>(getArgOperand(0))->getMetadata();
258  }
259 
261  return cast<MetadataAsValue>(getArgOperand(1))->getMetadata();
262  }
263 
265  return cast<MetadataAsValue>(getArgOperand(2))->getMetadata();
266  }
267 
268  /// Use of this should generally be avoided; instead,
269  /// replaceVariableLocationOp and addVariableLocationOps should be used where
270  /// possible to avoid creating invalid state.
271  void setRawLocation(Metadata *Location) {
272  return setArgOperand(0, MetadataAsValue::get(getContext(), Location));
273  }
274 
275  /// Get the size (in bits) of the variable, or fragment of the variable that
276  /// is described.
278 
279  /// \name Casting methods
280  /// @{
281  static bool classof(const IntrinsicInst *I) {
282  switch (I->getIntrinsicID()) {
283  case Intrinsic::dbg_declare:
284  case Intrinsic::dbg_value:
285  case Intrinsic::dbg_addr:
286  return true;
287  default:
288  return false;
289  }
290  }
291  static bool classof(const Value *V) {
292  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
293  }
294  /// @}
295 private:
296  void setArgOperand(unsigned i, Value *v) {
298  }
299  void setOperand(unsigned i, Value *v) { DbgInfoIntrinsic::setOperand(i, v); }
300 };
301 
302 /// This represents the llvm.dbg.declare instruction.
304 public:
305  Value *getAddress() const {
307  "dbg.declare must have exactly 1 location operand.");
308  return getVariableLocationOp(0);
309  }
310 
311  /// \name Casting methods
312  /// @{
313  static bool classof(const IntrinsicInst *I) {
314  return I->getIntrinsicID() == Intrinsic::dbg_declare;
315  }
316  static bool classof(const Value *V) {
317  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
318  }
319  /// @}
320 };
321 
322 /// This represents the llvm.dbg.addr instruction.
324 public:
325  Value *getAddress() const {
327  "dbg.addr must have exactly 1 location operand.");
328  return getVariableLocationOp(0);
329  }
330 
331  /// \name Casting methods
332  /// @{
333  static bool classof(const IntrinsicInst *I) {
334  return I->getIntrinsicID() == Intrinsic::dbg_addr;
335  }
336  static bool classof(const Value *V) {
337  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
338  }
339 };
340 
341 /// This represents the llvm.dbg.value instruction.
343 public:
344  // The default argument should only be used in ISel, and the default option
345  // should be removed once ISel support for multiple location ops is complete.
346  Value *getValue(unsigned OpIdx = 0) const {
347  return getVariableLocationOp(OpIdx);
348  }
350  return location_ops();
351  }
352 
353  /// \name Casting methods
354  /// @{
355  static bool classof(const IntrinsicInst *I) {
356  return I->getIntrinsicID() == Intrinsic::dbg_value;
357  }
358  static bool classof(const Value *V) {
359  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
360  }
361  /// @}
362 };
363 
364 /// This represents the llvm.dbg.label instruction.
366 public:
367  DILabel *getLabel() const { return cast<DILabel>(getRawLabel()); }
368 
370  return cast<MetadataAsValue>(getArgOperand(0))->getMetadata();
371  }
372 
373  /// Methods for support type inquiry through isa, cast, and dyn_cast:
374  /// @{
375  static bool classof(const IntrinsicInst *I) {
376  return I->getIntrinsicID() == Intrinsic::dbg_label;
377  }
378  static bool classof(const Value *V) {
379  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
380  }
381  /// @}
382 };
383 
384 /// This is the common base class for vector predication intrinsics.
385 class VPIntrinsic : public IntrinsicInst {
386 public:
387  static Optional<int> GetMaskParamPos(Intrinsic::ID IntrinsicID);
389 
390  /// The llvm.vp.* intrinsics for this instruction Opcode
391  static Intrinsic::ID GetForOpcode(unsigned OC);
392 
393  // Whether \p ID is a VP intrinsic ID.
394  static bool IsVPIntrinsic(Intrinsic::ID);
395 
396  /// \return the mask parameter or nullptr.
397  Value *getMaskParam() const;
398 
399  /// \return the vector length parameter or nullptr.
400  Value *getVectorLengthParam() const;
401 
402  /// \return whether the vector length param can be ignored.
403  bool canIgnoreVectorLengthParam() const;
404 
405  /// \return the static element count (vector number of elements) the vector
406  /// length parameter applies to.
408 
409  // Methods for support type inquiry through isa, cast, and dyn_cast:
410  static bool classof(const IntrinsicInst *I) {
411  return IsVPIntrinsic(I->getIntrinsicID());
412  }
413  static bool classof(const Value *V) {
414  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
415  }
416 
417  // Equivalent non-predicated opcode
418  unsigned getFunctionalOpcode() const {
420  }
421 
422  // Equivalent non-predicated opcode
423  static unsigned GetFunctionalOpcodeForVP(Intrinsic::ID ID);
424 };
425 
426 /// This is the common base class for constrained floating point intrinsics.
428 public:
429  bool isUnaryOp() const;
430  bool isTernaryOp() const;
433 
434  // Methods for support type inquiry through isa, cast, and dyn_cast:
435  static bool classof(const IntrinsicInst *I);
436  static bool classof(const Value *V) {
437  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
438  }
439 };
440 
441 /// Constrained floating point compare intrinsics.
443 public:
445 
446  // Methods for support type inquiry through isa, cast, and dyn_cast:
447  static bool classof(const IntrinsicInst *I) {
448  switch (I->getIntrinsicID()) {
449  case Intrinsic::experimental_constrained_fcmp:
450  case Intrinsic::experimental_constrained_fcmps:
451  return true;
452  default:
453  return false;
454  }
455  }
456  static bool classof(const Value *V) {
457  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
458  }
459 };
460 
461 /// This class represents min/max intrinsics.
463 public:
464  static bool classof(const IntrinsicInst *I) {
465  switch (I->getIntrinsicID()) {
466  case Intrinsic::umin:
467  case Intrinsic::umax:
468  case Intrinsic::smin:
469  case Intrinsic::smax:
470  return true;
471  default:
472  return false;
473  }
474  }
475  static bool classof(const Value *V) {
476  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
477  }
478 
479  Value *getLHS() const { return const_cast<Value *>(getArgOperand(0)); }
480  Value *getRHS() const { return const_cast<Value *>(getArgOperand(1)); }
481 
482  /// Returns the comparison predicate underlying the intrinsic.
484  switch (getIntrinsicID()) {
485  case Intrinsic::umin:
486  return ICmpInst::Predicate::ICMP_ULT;
487  case Intrinsic::umax:
488  return ICmpInst::Predicate::ICMP_UGT;
489  case Intrinsic::smin:
490  return ICmpInst::Predicate::ICMP_SLT;
491  case Intrinsic::smax:
492  return ICmpInst::Predicate::ICMP_SGT;
493  default:
494  llvm_unreachable("Invalid intrinsic");
495  }
496  }
497 
498  /// Whether the intrinsic is signed or unsigned.
499  bool isSigned() const { return ICmpInst::isSigned(getPredicate()); };
500 };
501 
502 /// This class represents an intrinsic that is based on a binary operation.
503 /// This includes op.with.overflow and saturating add/sub intrinsics.
505 public:
506  static bool classof(const IntrinsicInst *I) {
507  switch (I->getIntrinsicID()) {
508  case Intrinsic::uadd_with_overflow:
509  case Intrinsic::sadd_with_overflow:
510  case Intrinsic::usub_with_overflow:
511  case Intrinsic::ssub_with_overflow:
512  case Intrinsic::umul_with_overflow:
513  case Intrinsic::smul_with_overflow:
514  case Intrinsic::uadd_sat:
515  case Intrinsic::sadd_sat:
516  case Intrinsic::usub_sat:
517  case Intrinsic::ssub_sat:
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 binary operation underlying the intrinsic.
532 
533  /// Whether the intrinsic is signed or unsigned.
534  bool isSigned() const;
535 
536  /// Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
537  unsigned getNoWrapKind() const;
538 };
539 
540 /// Represents an op.with.overflow intrinsic.
542 public:
543  static bool classof(const IntrinsicInst *I) {
544  switch (I->getIntrinsicID()) {
545  case Intrinsic::uadd_with_overflow:
546  case Intrinsic::sadd_with_overflow:
547  case Intrinsic::usub_with_overflow:
548  case Intrinsic::ssub_with_overflow:
549  case Intrinsic::umul_with_overflow:
550  case Intrinsic::smul_with_overflow:
551  return true;
552  default:
553  return false;
554  }
555  }
556  static bool classof(const Value *V) {
557  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
558  }
559 };
560 
561 /// Represents a saturating add/sub intrinsic.
563 public:
564  static bool classof(const IntrinsicInst *I) {
565  switch (I->getIntrinsicID()) {
566  case Intrinsic::uadd_sat:
567  case Intrinsic::sadd_sat:
568  case Intrinsic::usub_sat:
569  case Intrinsic::ssub_sat:
570  return true;
571  default:
572  return false;
573  }
574  }
575  static bool classof(const Value *V) {
576  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
577  }
578 };
579 
580 /// Common base class for all memory intrinsics. Simply provides
581 /// common methods.
582 /// Written as CRTP to avoid a common base class amongst the
583 /// three atomicity hierarchies.
584 template <typename Derived> class MemIntrinsicBase : public IntrinsicInst {
585 private:
586  enum { ARG_DEST = 0, ARG_LENGTH = 2 };
587 
588 public:
589  Value *getRawDest() const {
590  return const_cast<Value *>(getArgOperand(ARG_DEST));
591  }
592  const Use &getRawDestUse() const { return getArgOperandUse(ARG_DEST); }
593  Use &getRawDestUse() { return getArgOperandUse(ARG_DEST); }
594 
595  Value *getLength() const {
596  return const_cast<Value *>(getArgOperand(ARG_LENGTH));
597  }
598  const Use &getLengthUse() const { return getArgOperandUse(ARG_LENGTH); }
599  Use &getLengthUse() { return getArgOperandUse(ARG_LENGTH); }
600 
601  /// This is just like getRawDest, but it strips off any cast
602  /// instructions (including addrspacecast) that feed it, giving the
603  /// original input. The returned value is guaranteed to be a pointer.
604  Value *getDest() const { return getRawDest()->stripPointerCasts(); }
605 
606  unsigned getDestAddressSpace() const {
607  return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
608  }
609 
610  /// FIXME: Remove this function once transition to Align is over.
611  /// Use getDestAlign() instead.
612  unsigned getDestAlignment() const {
613  if (auto MA = getParamAlign(ARG_DEST))
614  return MA->value();
615  return 0;
616  }
617  MaybeAlign getDestAlign() const { return getParamAlign(ARG_DEST); }
618 
619  /// Set the specified arguments of the instruction.
620  void setDest(Value *Ptr) {
621  assert(getRawDest()->getType() == Ptr->getType() &&
622  "setDest called with pointer of wrong type!");
623  setArgOperand(ARG_DEST, Ptr);
624  }
625 
626  /// FIXME: Remove this function once transition to Align is over.
627  /// Use the version that takes MaybeAlign instead of this one.
628  void setDestAlignment(unsigned Alignment) {
629  setDestAlignment(MaybeAlign(Alignment));
630  }
631  void setDestAlignment(MaybeAlign Alignment) {
632  removeParamAttr(ARG_DEST, Attribute::Alignment);
633  if (Alignment)
634  addParamAttr(ARG_DEST,
635  Attribute::getWithAlignment(getContext(), *Alignment));
636  }
637  void setDestAlignment(Align Alignment) {
638  removeParamAttr(ARG_DEST, Attribute::Alignment);
639  addParamAttr(ARG_DEST,
641  }
642 
643  void setLength(Value *L) {
644  assert(getLength()->getType() == L->getType() &&
645  "setLength called with value of wrong type!");
646  setArgOperand(ARG_LENGTH, L);
647  }
648 };
649 
650 /// Common base class for all memory transfer intrinsics. Simply provides
651 /// common methods.
652 template <class BaseCL> class MemTransferBase : public BaseCL {
653 private:
654  enum { ARG_SOURCE = 1 };
655 
656 public:
657  /// Return the arguments to the instruction.
658  Value *getRawSource() const {
659  return const_cast<Value *>(BaseCL::getArgOperand(ARG_SOURCE));
660  }
661  const Use &getRawSourceUse() const {
662  return BaseCL::getArgOperandUse(ARG_SOURCE);
663  }
664  Use &getRawSourceUse() { return BaseCL::getArgOperandUse(ARG_SOURCE); }
665 
666  /// This is just like getRawSource, but it strips off any cast
667  /// instructions that feed it, giving the original input. The returned
668  /// value is guaranteed to be a pointer.
669  Value *getSource() const { return getRawSource()->stripPointerCasts(); }
670 
671  unsigned getSourceAddressSpace() const {
672  return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
673  }
674 
675  /// FIXME: Remove this function once transition to Align is over.
676  /// Use getSourceAlign() instead.
677  unsigned getSourceAlignment() const {
678  if (auto MA = BaseCL::getParamAlign(ARG_SOURCE))
679  return MA->value();
680  return 0;
681  }
682 
684  return BaseCL::getParamAlign(ARG_SOURCE);
685  }
686 
687  void setSource(Value *Ptr) {
688  assert(getRawSource()->getType() == Ptr->getType() &&
689  "setSource called with pointer of wrong type!");
690  BaseCL::setArgOperand(ARG_SOURCE, Ptr);
691  }
692 
693  /// FIXME: Remove this function once transition to Align is over.
694  /// Use the version that takes MaybeAlign instead of this one.
695  void setSourceAlignment(unsigned Alignment) {
696  setSourceAlignment(MaybeAlign(Alignment));
697  }
698  void setSourceAlignment(MaybeAlign Alignment) {
699  BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
700  if (Alignment)
701  BaseCL::addParamAttr(ARG_SOURCE, Attribute::getWithAlignment(
702  BaseCL::getContext(), *Alignment));
703  }
704  void setSourceAlignment(Align Alignment) {
705  BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
706  BaseCL::addParamAttr(ARG_SOURCE, Attribute::getWithAlignment(
707  BaseCL::getContext(), Alignment));
708  }
709 };
710 
711 /// Common base class for all memset intrinsics. Simply provides
712 /// common methods.
713 template <class BaseCL> class MemSetBase : public BaseCL {
714 private:
715  enum { ARG_VALUE = 1 };
716 
717 public:
718  Value *getValue() const {
719  return const_cast<Value *>(BaseCL::getArgOperand(ARG_VALUE));
720  }
721  const Use &getValueUse() const { return BaseCL::getArgOperandUse(ARG_VALUE); }
722  Use &getValueUse() { return BaseCL::getArgOperandUse(ARG_VALUE); }
723 
724  void setValue(Value *Val) {
725  assert(getValue()->getType() == Val->getType() &&
726  "setValue called with value of wrong type!");
727  BaseCL::setArgOperand(ARG_VALUE, Val);
728  }
729 };
730 
731 // The common base class for the atomic memset/memmove/memcpy intrinsics
732 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
733 class AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
734 private:
735  enum { ARG_ELEMENTSIZE = 3 };
736 
737 public:
739  return const_cast<Value *>(getArgOperand(ARG_ELEMENTSIZE));
740  }
741 
743  return cast<ConstantInt>(getRawElementSizeInBytes());
744  }
745 
748  }
749 
752  "setElementSizeInBytes called with value of wrong type!");
753  setArgOperand(ARG_ELEMENTSIZE, V);
754  }
755 
756  static bool classof(const IntrinsicInst *I) {
757  switch (I->getIntrinsicID()) {
758  case Intrinsic::memcpy_element_unordered_atomic:
759  case Intrinsic::memmove_element_unordered_atomic:
760  case Intrinsic::memset_element_unordered_atomic:
761  return true;
762  default:
763  return false;
764  }
765  }
766  static bool classof(const Value *V) {
767  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
768  }
769 };
770 
771 /// This class represents atomic memset intrinsic
772 // i.e. llvm.element.unordered.atomic.memset
773 class AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
774 public:
775  static bool classof(const IntrinsicInst *I) {
776  return I->getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
777  }
778  static bool classof(const Value *V) {
779  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
780  }
781 };
782 
783 // This class wraps the atomic memcpy/memmove intrinsics
784 // i.e. llvm.element.unordered.atomic.memcpy/memmove
785 class AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
786 public:
787  static bool classof(const IntrinsicInst *I) {
788  switch (I->getIntrinsicID()) {
789  case Intrinsic::memcpy_element_unordered_atomic:
790  case Intrinsic::memmove_element_unordered_atomic:
791  return true;
792  default:
793  return false;
794  }
795  }
796  static bool classof(const Value *V) {
797  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
798  }
799 };
800 
801 /// This class represents the atomic memcpy intrinsic
802 /// i.e. llvm.element.unordered.atomic.memcpy
804 public:
805  static bool classof(const IntrinsicInst *I) {
806  return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
807  }
808  static bool classof(const Value *V) {
809  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
810  }
811 };
812 
813 /// This class represents the atomic memmove intrinsic
814 /// i.e. llvm.element.unordered.atomic.memmove
816 public:
817  static bool classof(const IntrinsicInst *I) {
818  return I->getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
819  }
820  static bool classof(const Value *V) {
821  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
822  }
823 };
824 
825 /// This is the common base class for memset/memcpy/memmove.
826 class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
827 private:
828  enum { ARG_VOLATILE = 3 };
829 
830 public:
832  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(ARG_VOLATILE)));
833  }
834 
835  bool isVolatile() const { return !getVolatileCst()->isZero(); }
836 
837  void setVolatile(Constant *V) { setArgOperand(ARG_VOLATILE, V); }
838 
839  // Methods for support type inquiry through isa, cast, and dyn_cast:
840  static bool classof(const IntrinsicInst *I) {
841  switch (I->getIntrinsicID()) {
842  case Intrinsic::memcpy:
843  case Intrinsic::memmove:
844  case Intrinsic::memset:
845  case Intrinsic::memcpy_inline:
846  return true;
847  default:
848  return false;
849  }
850  }
851  static bool classof(const Value *V) {
852  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
853  }
854 };
855 
856 /// This class wraps the llvm.memset intrinsic.
857 class MemSetInst : public MemSetBase<MemIntrinsic> {
858 public:
859  // Methods for support type inquiry through isa, cast, and dyn_cast:
860  static bool classof(const IntrinsicInst *I) {
861  return I->getIntrinsicID() == Intrinsic::memset;
862  }
863  static bool classof(const Value *V) {
864  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
865  }
866 };
867 
868 /// This class wraps the llvm.memcpy/memmove intrinsics.
869 class MemTransferInst : public MemTransferBase<MemIntrinsic> {
870 public:
871  // Methods for support type inquiry through isa, cast, and dyn_cast:
872  static bool classof(const IntrinsicInst *I) {
873  switch (I->getIntrinsicID()) {
874  case Intrinsic::memcpy:
875  case Intrinsic::memmove:
876  case Intrinsic::memcpy_inline:
877  return true;
878  default:
879  return false;
880  }
881  }
882  static bool classof(const Value *V) {
883  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
884  }
885 };
886 
887 /// This class wraps the llvm.memcpy intrinsic.
888 class MemCpyInst : public MemTransferInst {
889 public:
890  // Methods for support type inquiry through isa, cast, and dyn_cast:
891  static bool classof(const IntrinsicInst *I) {
892  return I->getIntrinsicID() == Intrinsic::memcpy;
893  }
894  static bool classof(const Value *V) {
895  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
896  }
897 };
898 
899 /// This class wraps the llvm.memmove intrinsic.
900 class MemMoveInst : public MemTransferInst {
901 public:
902  // Methods for support type inquiry through isa, cast, and dyn_cast:
903  static bool classof(const IntrinsicInst *I) {
904  return I->getIntrinsicID() == Intrinsic::memmove;
905  }
906  static bool classof(const Value *V) {
907  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
908  }
909 };
910 
911 /// This class wraps the llvm.memcpy.inline intrinsic.
913 public:
915  return cast<ConstantInt>(MemTransferInst::getLength());
916  }
917  // Methods for support type inquiry through isa, cast, and dyn_cast:
918  static bool classof(const IntrinsicInst *I) {
919  return I->getIntrinsicID() == Intrinsic::memcpy_inline;
920  }
921  static bool classof(const Value *V) {
922  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
923  }
924 };
925 
926 // The common base class for any memset/memmove/memcpy intrinsics;
927 // whether they be atomic or non-atomic.
928 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
929 // and llvm.memset/memcpy/memmove
930 class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
931 public:
932  bool isVolatile() const {
933  // Only the non-atomic intrinsics can be volatile
934  if (auto *MI = dyn_cast<MemIntrinsic>(this))
935  return MI->isVolatile();
936  return false;
937  }
938 
939  static bool classof(const IntrinsicInst *I) {
940  switch (I->getIntrinsicID()) {
941  case Intrinsic::memcpy:
942  case Intrinsic::memcpy_inline:
943  case Intrinsic::memmove:
944  case Intrinsic::memset:
945  case Intrinsic::memcpy_element_unordered_atomic:
946  case Intrinsic::memmove_element_unordered_atomic:
947  case Intrinsic::memset_element_unordered_atomic:
948  return true;
949  default:
950  return false;
951  }
952  }
953  static bool classof(const Value *V) {
954  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
955  }
956 };
957 
958 /// This class represents any memset intrinsic
959 // i.e. llvm.element.unordered.atomic.memset
960 // and llvm.memset
961 class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
962 public:
963  static bool classof(const IntrinsicInst *I) {
964  switch (I->getIntrinsicID()) {
965  case Intrinsic::memset:
966  case Intrinsic::memset_element_unordered_atomic:
967  return true;
968  default:
969  return false;
970  }
971  }
972  static bool classof(const Value *V) {
973  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
974  }
975 };
976 
977 // This class wraps any memcpy/memmove intrinsics
978 // i.e. llvm.element.unordered.atomic.memcpy/memmove
979 // and llvm.memcpy/memmove
980 class AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
981 public:
982  static bool classof(const IntrinsicInst *I) {
983  switch (I->getIntrinsicID()) {
984  case Intrinsic::memcpy:
985  case Intrinsic::memcpy_inline:
986  case Intrinsic::memmove:
987  case Intrinsic::memcpy_element_unordered_atomic:
988  case Intrinsic::memmove_element_unordered_atomic:
989  return true;
990  default:
991  return false;
992  }
993  }
994  static bool classof(const Value *V) {
995  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
996  }
997 };
998 
999 /// This class represents any memcpy intrinsic
1000 /// i.e. llvm.element.unordered.atomic.memcpy
1001 /// and llvm.memcpy
1003 public:
1004  static bool classof(const IntrinsicInst *I) {
1005  switch (I->getIntrinsicID()) {
1006  case Intrinsic::memcpy:
1007  case Intrinsic::memcpy_inline:
1008  case Intrinsic::memcpy_element_unordered_atomic:
1009  return true;
1010  default:
1011  return false;
1012  }
1013  }
1014  static bool classof(const Value *V) {
1015  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1016  }
1017 };
1018 
1019 /// This class represents any memmove intrinsic
1020 /// i.e. llvm.element.unordered.atomic.memmove
1021 /// and llvm.memmove
1023 public:
1024  static bool classof(const IntrinsicInst *I) {
1025  switch (I->getIntrinsicID()) {
1026  case Intrinsic::memmove:
1027  case Intrinsic::memmove_element_unordered_atomic:
1028  return true;
1029  default:
1030  return false;
1031  }
1032  }
1033  static bool classof(const Value *V) {
1034  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1035  }
1036 };
1037 
1038 /// This represents the llvm.va_start intrinsic.
1039 class VAStartInst : public IntrinsicInst {
1040 public:
1041  static bool classof(const IntrinsicInst *I) {
1042  return I->getIntrinsicID() == Intrinsic::vastart;
1043  }
1044  static bool classof(const Value *V) {
1045  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1046  }
1047 
1048  Value *getArgList() const { return const_cast<Value *>(getArgOperand(0)); }
1049 };
1050 
1051 /// This represents the llvm.va_end intrinsic.
1052 class VAEndInst : public IntrinsicInst {
1053 public:
1054  static bool classof(const IntrinsicInst *I) {
1055  return I->getIntrinsicID() == Intrinsic::vaend;
1056  }
1057  static bool classof(const Value *V) {
1058  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1059  }
1060 
1061  Value *getArgList() const { return const_cast<Value *>(getArgOperand(0)); }
1062 };
1063 
1064 /// This represents the llvm.va_copy intrinsic.
1065 class VACopyInst : public IntrinsicInst {
1066 public:
1067  static bool classof(const IntrinsicInst *I) {
1068  return I->getIntrinsicID() == Intrinsic::vacopy;
1069  }
1070  static bool classof(const Value *V) {
1071  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1072  }
1073 
1074  Value *getDest() const { return const_cast<Value *>(getArgOperand(0)); }
1075  Value *getSrc() const { return const_cast<Value *>(getArgOperand(1)); }
1076 };
1077 
1078 /// This represents the llvm.instrprof_increment intrinsic.
1080 public:
1081  static bool classof(const IntrinsicInst *I) {
1082  return I->getIntrinsicID() == Intrinsic::instrprof_increment;
1083  }
1084  static bool classof(const Value *V) {
1085  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1086  }
1087 
1089  return cast<GlobalVariable>(
1090  const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
1091  }
1092 
1094  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1095  }
1096 
1098  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
1099  }
1100 
1102  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1103  }
1104 
1105  Value *getStep() const;
1106 };
1107 
1109 public:
1110  static bool classof(const IntrinsicInst *I) {
1111  return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1112  }
1113  static bool classof(const Value *V) {
1114  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1115  }
1116 };
1117 
1118 /// This represents the llvm.instrprof_value_profile intrinsic.
1120 public:
1121  static bool classof(const IntrinsicInst *I) {
1122  return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
1123  }
1124  static bool classof(const Value *V) {
1125  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1126  }
1127 
1129  return cast<GlobalVariable>(
1130  const_cast<Value *>(getArgOperand(0))->stripPointerCasts());
1131  }
1132 
1134  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1135  }
1136 
1138  return cast<Value>(const_cast<Value *>(getArgOperand(2)));
1139  }
1140 
1142  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1143  }
1144 
1145  // Returns the value site index.
1147  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(4)));
1148  }
1149 };
1150 
1152 public:
1153  static bool classof(const IntrinsicInst *I) {
1154  return I->getIntrinsicID() == Intrinsic::pseudoprobe;
1155  }
1156 
1157  static bool classof(const Value *V) {
1158  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1159  }
1160 
1162  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(0)));
1163  }
1164 
1166  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(1)));
1167  }
1168 
1170  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
1171  }
1172 
1174  return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
1175  }
1176 };
1177 
1179 public:
1180  static bool classof(const IntrinsicInst *I) {
1181  return I->getIntrinsicID() == Intrinsic::experimental_noalias_scope_decl;
1182  }
1183 
1184  static bool classof(const Value *V) {
1185  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1186  }
1187 
1189  auto *MV =
1190  cast<MetadataAsValue>(getOperand(Intrinsic::NoAliasScopeDeclScopeArg));
1191  return cast<MDNode>(MV->getMetadata());
1192  }
1193 
1194  void setScopeList(MDNode *ScopeList) {
1196  MetadataAsValue::get(getContext(), ScopeList));
1197  }
1198 };
1199 
1200 // Defined in Statepoint.h -- NOT a subclass of IntrinsicInst
1201 class GCStatepointInst;
1202 
1203 /// Common base class for representing values projected from a statepoint.
1204 /// Currently, the only projections available are gc.result and gc.relocate.
1206 public:
1207  static bool classof(const IntrinsicInst *I) {
1208  return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
1209  I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1210  }
1211 
1212  static bool classof(const Value *V) {
1213  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1214  }
1215 
1216  /// Return true if this relocate is tied to the invoke statepoint.
1217  /// This includes relocates which are on the unwinding path.
1218  bool isTiedToInvoke() const {
1219  const Value *Token = getArgOperand(0);
1220 
1221  return isa<LandingPadInst>(Token) || isa<InvokeInst>(Token);
1222  }
1223 
1224  /// The statepoint with which this gc.relocate is associated.
1225  const GCStatepointInst *getStatepoint() const;
1226 };
1227 
1228 /// Represents calls to the gc.relocate intrinsic.
1230 public:
1231  static bool classof(const IntrinsicInst *I) {
1232  return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
1233  }
1234 
1235  static bool classof(const Value *V) {
1236  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1237  }
1238 
1239  /// The index into the associate statepoint's argument list
1240  /// which contains the base pointer of the pointer whose
1241  /// relocation this gc.relocate describes.
1242  unsigned getBasePtrIndex() const {
1243  return cast<ConstantInt>(getArgOperand(1))->getZExtValue();
1244  }
1245 
1246  /// The index into the associate statepoint's argument list which
1247  /// contains the pointer whose relocation this gc.relocate describes.
1248  unsigned getDerivedPtrIndex() const {
1249  return cast<ConstantInt>(getArgOperand(2))->getZExtValue();
1250  }
1251 
1252  Value *getBasePtr() const;
1253  Value *getDerivedPtr() const;
1254 };
1255 
1256 /// Represents calls to the gc.result intrinsic.
1258 public:
1259  static bool classof(const IntrinsicInst *I) {
1260  return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1261  }
1262 
1263  static bool classof(const Value *V) {
1264  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1265  }
1266 };
1267 
1268 
1269 /// This represents the llvm.assume intrinsic.
1270 class AssumeInst : public IntrinsicInst {
1271 public:
1272  static bool classof(const IntrinsicInst *I) {
1273  return I->getIntrinsicID() == Intrinsic::assume;
1274  }
1275  static bool classof(const Value *V) {
1276  return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
1277  }
1278 };
1279 
1280 } // end namespace llvm
1281 
1282 #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:271
llvm::NoAliasScopeDeclInst
Definition: IntrinsicInst.h:1178
i
i
Definition: README.txt:29
llvm::DbgDeclareInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:316
llvm::DbgVariableIntrinsic::getExpression
DIExpression * getExpression() const
Definition: IntrinsicInst.h:252
llvm::BinaryOpIntrinsic::getBinaryOp
Instruction::BinaryOps getBinaryOp() const
Returns the binary operation underlying the intrinsic.
Definition: IntrinsicInst.cpp:377
llvm::DbgAddrIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:333
llvm::SaturatingInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:564
llvm::MemCpyInlineInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:921
llvm::MemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:860
llvm::DbgInfoIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:138
llvm::MemCpyInlineInst::getLength
ConstantInt * getLength() const
Definition: IntrinsicInst.h:914
llvm::MemIntrinsicBase::getDestAlignment
unsigned getDestAlignment() const
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:612
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:100
llvm::DbgVariableIntrinsic::getRawExpression
Metadata * getRawExpression() const
Definition: IntrinsicInst.h:264
llvm
Definition: AllocatorList.h:23
llvm::DbgDeclareInst::getAddress
Value * getAddress() const
Definition: IntrinsicInst.h:305
llvm::InstrProfIncrementInst::getStep
Value * getStep() const
Definition: IntrinsicInst.cpp:164
llvm::PseudoProbeInst
Definition: IntrinsicInst.h:1151
llvm::DbgValueInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:355
llvm::InstrProfIncrementInstStep::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1113
llvm::MinMaxIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:464
llvm::WithOverflowInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:543
Metadata.h
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:722
llvm::MemIntrinsicBase::getDestAlign
MaybeAlign getDestAlign() const
Definition: IntrinsicInst.h:617
llvm::InstrProfValueProfileInst::getHash
ConstantInt * getHash() const
Definition: IntrinsicInst.h:1133
llvm::ElementCount
Definition: TypeSize.h:386
llvm::ConstrainedFPCmpIntrinsic
Constrained floating point compare intrinsics.
Definition: IntrinsicInst.h:442
DebugInfoMetadata.h
llvm::ConstrainedFPCmpIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:456
llvm::MemTransferInst
This class wraps the llvm.memcpy/memmove intrinsics.
Definition: IntrinsicInst.h:869
llvm::Function
Definition: Function.h:61
llvm::AtomicMemIntrinsic::getElementSizeInBytes
uint32_t getElementSizeInBytes() const
Definition: IntrinsicInst.h:746
llvm::GCRelocateInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1231
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:900
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::AtomicMemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:766
llvm::AnyMemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:972
llvm::AtomicMemIntrinsic::getRawElementSizeInBytes
Value * getRawElementSizeInBytes() const
Definition: IntrinsicInst.h:738
llvm::BinaryOpIntrinsic::getRHS
Value * getRHS() const
Definition: IntrinsicInst.h:528
llvm::MemIntrinsicBase::getDestAddressSpace
unsigned getDestAddressSpace() const
Definition: IntrinsicInst.h:606
llvm::BinaryOpIntrinsic::getLHS
Value * getLHS() const
Definition: IntrinsicInst.h:527
llvm::InstrProfIncrementInstStep::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1110
llvm::VACopyInst::getSrc
Value * getSrc() const
Definition: IntrinsicInst.h:1075
llvm::VAStartInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1044
llvm::GlobalVariable
Definition: GlobalVariable.h:40
llvm::BinaryOpIntrinsic
This class represents an intrinsic that is based on a binary operation.
Definition: IntrinsicInst.h:504
llvm::MemIntrinsic::getVolatileCst
ConstantInt * getVolatileCst() const
Definition: IntrinsicInst.h:831
llvm::MemMoveInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:903
llvm::DbgVariableIntrinsic::replaceVariableLocationOp
void replaceVariableLocationOp(Value *OldValue, Value *NewValue)
Definition: IntrinsicInst.cpp:82
llvm::VPIntrinsic::canIgnoreVectorLengthParam
bool canIgnoreVectorLengthParam() const
Definition: IntrinsicInst.cpp:335
llvm::DbgVariableIntrinsic::location_op_iterator::operator==
bool operator==(const location_op_iterator &RHS) const
Definition: IntrinsicInst.h:167
llvm::CallBase::getArgOperandUse
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
Definition: InstrTypes.h:1352
llvm::NoAliasScopeDeclInst::getScopeList
MDNode * getScopeList() const
Definition: IntrinsicInst.h:1188
llvm::AtomicMemIntrinsic::getElementSizeInBytesCst
ConstantInt * getElementSizeInBytesCst() const
Definition: IntrinsicInst.h:742
NewExpr
Definition: ItaniumDemangle.h:1773
llvm::AssumeInst
This represents the llvm.assume intrinsic.
Definition: IntrinsicInst.h:1270
llvm::GCProjectionInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1212
llvm::AnyMemIntrinsic::isVolatile
bool isVolatile() const
Definition: IntrinsicInst.h:932
llvm::MemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:851
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:1242
llvm::DbgVariableIntrinsic::getVariable
DILocalVariable * getVariable() const
Definition: IntrinsicInst.h:248
llvm::MemIntrinsic
This is the common base class for memset/memcpy/memmove.
Definition: IntrinsicInst.h:826
llvm::Optional< uint64_t >
llvm::SmallPtrSet< Value *, 4 >
llvm::MemIntrinsicBase::setDestAlignment
void setDestAlignment(MaybeAlign Alignment)
Definition: IntrinsicInst.h:631
llvm::ConstrainedFPIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.cpp:236
llvm::InstrProfIncrementInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1084
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2559
llvm::DbgLabelInst::getRawLabel
Metadata * getRawLabel() const
Definition: IntrinsicInst.h:369
llvm::WithOverflowInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:556
llvm::AnyMemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:963
llvm::CallBase::addParamAttr
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
Definition: InstrTypes.h:1507
llvm::Type::getInt8Ty
static IntegerType * getInt8Ty(LLVMContext &C)
Definition: Type.cpp:202
llvm::DbgVariableIntrinsic::getRawVariable
Metadata * getRawVariable() const
Definition: IntrinsicInst.h:260
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 signed.
Definition: APInt.h:2184
llvm::InstrProfIncrementInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1081
llvm::MemSetBase::getValue
Value * getValue() const
Definition: IntrinsicInst.h:718
llvm::GCResultInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1263
llvm::DbgVariableIntrinsic::setVariable
void setVariable(DILocalVariable *NewVar)
Definition: IntrinsicInst.h:208
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:1248
llvm::InstrProfValueProfileInst::getValueKind
ConstantInt * getValueKind() const
Definition: IntrinsicInst.h:1141
llvm::VAStartInst
This represents the llvm.va_start intrinsic.
Definition: IntrinsicInst.h:1039
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:637
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:77
llvm::MemCpyInlineInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:918
llvm::Intrinsic::getType
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
Definition: Function.cpp:1251
llvm::CallBase::removeParamAttr
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
Definition: InstrTypes.h:1543
llvm::GCProjectionInst
Common base class for representing values projected from a statepoint.
Definition: IntrinsicInst.h:1205
llvm::MemTransferBase::getSourceAddressSpace
unsigned getSourceAddressSpace() const
Definition: IntrinsicInst.h:671
Constants.h
llvm::DbgValueInst
This represents the llvm.dbg.value instruction.
Definition: IntrinsicInst.h:342
BaseCL
llvm::MemSetBase::getValueUse
const Use & getValueUse() const
Definition: IntrinsicInst.h:721
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3041
llvm::DbgVariableIntrinsic::isAddressOfVariable
bool isAddressOfVariable() const
Does this describe the address of a local variable.
Definition: IntrinsicInst.h:226
Intrinsics.h
llvm::ConstrainedFPIntrinsic
This is the common base class for constrained floating point intrinsics.
Definition: IntrinsicInst.h:427
llvm::MemSetBase::setValue
void setValue(Value *Val)
Definition: IntrinsicInst.h:724
llvm::AtomicMemTransferInst
Definition: IntrinsicInst.h:785
llvm::CallBase::getCalledFunction
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
Definition: InstrTypes.h:1396
llvm::PseudoProbeInst::getFactor
ConstantInt * getFactor() const
Definition: IntrinsicInst.h:1173
llvm::InstrProfValueProfileInst::getTargetValue
Value * getTargetValue() const
Definition: IntrinsicInst.h:1137
llvm::MemTransferBase::getRawSourceUse
Use & getRawSourceUse()
Definition: IntrinsicInst.h:664
llvm::VPIntrinsic::GetVectorLengthParamPos
static Optional< int > GetVectorLengthParamPos(Intrinsic::ID IntrinsicID)
Definition: IntrinsicInst.cpp:284
llvm::AnyMemMoveInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1024
llvm::MemTransferBase::getRawSource
Value * getRawSource() const
Return the arguments to the instruction.
Definition: IntrinsicInst.h:658
llvm::DbgDeclareInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:313
llvm::MemCpyInlineInst
This class wraps the llvm.memcpy.inline intrinsic.
Definition: IntrinsicInst.h:912
llvm::VACopyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1070
llvm::MemCpyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:891
llvm::BinaryOpIntrinsic::getNoWrapKind
unsigned getNoWrapKind() const
Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
Definition: IntrinsicInst.cpp:410
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:119
llvm::MinMaxIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:475
llvm::DbgVariableIntrinsic::setExpression
void setExpression(DIExpression *NewExpr)
Definition: IntrinsicInst.h:212
llvm::SaturatingInst
Represents a saturating add/sub intrinsic.
Definition: IntrinsicInst.h:562
llvm::InstrProfIncrementInstStep
Definition: IntrinsicInst.h:1108
llvm::UndefValue::get
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Definition: Constants.cpp:1770
llvm::IntrinsicInst::operator=
IntrinsicInst & operator=(const IntrinsicInst &)=delete
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(MaybeAlign Alignment)
Definition: IntrinsicInst.h:698
llvm::InstrProfValueProfileInst::getIndex
ConstantInt * getIndex() const
Definition: IntrinsicInst.h:1146
llvm::DbgVariableIntrinsic::hasArgList
bool hasArgList() const
Definition: IntrinsicInst.h:222
llvm::DbgInfoIntrinsic
This is the common base class for debug info intrinsics.
Definition: IntrinsicInst.h:134
llvm::VPIntrinsic::GetForOpcode
static Intrinsic::ID GetForOpcode(unsigned OC)
The llvm.vp.* intrinsics for this instruction Opcode.
Definition: IntrinsicInst.cpp:324
llvm::AtomicMemCpyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:808
llvm::AnyMemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:939
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:803
llvm::MemTransferBase::getSourceAlign
MaybeAlign getSourceAlign() const
Definition: IntrinsicInst.h:683
llvm::MemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:872
llvm::DbgVariableIntrinsic::getNumVariableLocationOps
unsigned getNumVariableLocationOps() const
Definition: IntrinsicInst.h:216
llvm::MemSetInst
This class wraps the llvm.memset intrinsic.
Definition: IntrinsicInst.h:857
llvm::AnyMemTransferInst
Definition: IntrinsicInst.h:980
llvm::maxnum
LLVM_READONLY APFloat maxnum(const APFloat &A, const APFloat &B)
Implements IEEE maxNum semantics.
Definition: APFloat.h:1297
llvm::AtomicMemSetInst
This class represents atomic memset intrinsic.
Definition: IntrinsicInst.h:773
llvm::VAEndInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1057
llvm::VPIntrinsic::getVectorLengthParam
Value * getVectorLengthParam() const
Definition: IntrinsicInst.cpp:265
llvm::NoAliasScopeDeclInst::setScopeList
void setScopeList(MDNode *ScopeList)
Definition: IntrinsicInst.h:1194
llvm::Value::Value
Value(Type *Ty, unsigned scid)
Definition: Value.cpp:57
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:506
llvm::PseudoProbeInst::getFuncGuid
ConstantInt * getFuncGuid() const
Definition: IntrinsicInst.h:1161
llvm::DbgVariableIntrinsic
This is the common base class for debug info intrinsics for variables.
Definition: IntrinsicInst.h:148
llvm::VPIntrinsic::GetFunctionalOpcodeForVP
static unsigned GetFunctionalOpcodeForVP(Intrinsic::ID ID)
Definition: IntrinsicInst.cpp:310
llvm::VPIntrinsic::getStaticVectorLength
ElementCount getStaticVectorLength() const
Definition: IntrinsicInst.cpp:247
llvm::VPIntrinsic::GetMaskParamPos
static Optional< int > GetMaskParamPos(Intrinsic::ID IntrinsicID)
Definition: IntrinsicInst.cpp:272
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:413
llvm::GCRelocateInst
Represents calls to the gc.relocate intrinsic.
Definition: IntrinsicInst.h:1229
llvm::DbgVariableIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:281
llvm::InstrProfValueProfileInst
This represents the llvm.instrprof_value_profile intrinsic.
Definition: IntrinsicInst.h:1119
llvm::BinaryOpIntrinsic::isSigned
bool isSigned() const
Whether the intrinsic is signed or unsigned.
Definition: IntrinsicInst.cpp:397
llvm::DbgVariableIntrinsic::setUndef
void setUndef()
Definition: IntrinsicInst.h:230
llvm::AtomicMemSetInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:775
llvm::DbgDeclareInst
This represents the llvm.dbg.declare instruction.
Definition: IntrinsicInst.h:303
llvm::DbgLabelInst
This represents the llvm.dbg.label instruction.
Definition: IntrinsicInst.h:365
llvm::GCRelocateInst::getDerivedPtr
Value * getDerivedPtr() const
Definition: IntrinsicInst.cpp:442
llvm::MemTransferBase::setSource
void setSource(Value *Ptr)
Definition: IntrinsicInst.h:687
llvm::DbgLabelInst::getLabel
DILabel * getLabel() const
Definition: IntrinsicInst.h:367
llvm::ConstrainedFPIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:436
llvm::AssumeInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1272
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:1101
llvm::VPIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:410
llvm::GCProjectionInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1207
llvm::MemTransferBase
Common base class for all memory transfer intrinsics.
Definition: IntrinsicInst.h:652
llvm::AtomicMemCpyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:805
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:894
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:620
llvm::MinMaxIntrinsic::isSigned
bool isSigned() const
Whether the intrinsic is signed or unsigned.
Definition: IntrinsicInst.h:499
llvm::VPIntrinsic::getFunctionalOpcode
unsigned getFunctionalOpcode() const
Definition: IntrinsicInst.h:418
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:1275
llvm::DbgVariableIntrinsic::location_op_iterator::operator++
location_op_iterator & operator++()
Definition: IntrinsicInst.h:182
llvm::VPIntrinsic::IsVPIntrinsic
static bool IsVPIntrinsic(Intrinsic::ID)
Definition: IntrinsicInst.cpp:296
llvm::SystemZISD::OC
@ OC
Definition: SystemZISelLowering.h:128
llvm::MemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:882
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:483
llvm::MemIntrinsicBase::getLengthUse
Use & getLengthUse()
Definition: IntrinsicInst.h:599
llvm::ValueAsMetadata::getValue
Value * getValue() const
Definition: Metadata.h:384
llvm::MDNode
Metadata node.
Definition: Metadata.h:897
llvm::InstrProfIncrementInst::getNumCounters
ConstantInt * getNumCounters() const
Definition: IntrinsicInst.h:1097
llvm::MemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:863
llvm::MinMaxIntrinsic::getLHS
Value * getLHS() const
Definition: IntrinsicInst.h:479
llvm::MemIntrinsicBase::setLength
void setLength(Value *L)
Definition: IntrinsicInst.h:643
llvm::AnyMemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:982
llvm::VACopyInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1067
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(Align Alignment)
Definition: IntrinsicInst.h:704
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:817
llvm::Intrinsic::NoAliasScopeDeclScopeArg
static const int NoAliasScopeDeclScopeArg
Definition: Intrinsics.h:38
llvm::ConstrainedFPCmpIntrinsic::getPredicate
FCmpInst::Predicate getPredicate() const
Definition: IntrinsicInst.cpp:192
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:195
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:2174
llvm::NoAliasScopeDeclInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1184
llvm::InstrProfIncrementInst::getHash
ConstantInt * getHash() const
Definition: IntrinsicInst.h:1093
llvm::MemSetBase
Common base class for all memset intrinsics.
Definition: IntrinsicInst.h:713
llvm::MemIntrinsicBase::getDest
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions (including addrspacecast) that ...
Definition: IntrinsicInst.h:604
llvm::AnyMemMoveInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1033
llvm::ConstrainedFPIntrinsic::getExceptionBehavior
Optional< fp::ExceptionBehavior > getExceptionBehavior() const
Definition: IntrinsicInst.cpp:183
llvm::VAEndInst
This represents the llvm.va_end intrinsic.
Definition: IntrinsicInst.h:1052
llvm::AnyMemIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:953
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:1512
llvm::CallBase::getParamAlign
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Definition: InstrTypes.h:1730
llvm::MemTransferBase::setSourceAlignment
void setSourceAlignment(unsigned Alignment)
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:695
llvm::PseudoProbeInst::getIndex
ConstantInt * getIndex() const
Definition: IntrinsicInst.h:1165
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::Value::getType
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:256
llvm::GCResultInst
Represents calls to the gc.result intrinsic.
Definition: IntrinsicInst.h:1257
llvm::ConstantInt::isZero
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
Definition: Constants.h:192
llvm::PseudoProbeInst::getAttributes
ConstantInt * getAttributes() const
Definition: IntrinsicInst.h:1169
llvm::DbgVariableIntrinsic::getRawLocation
Metadata * getRawLocation() const
Definition: IntrinsicInst.h:256
uint32_t
llvm::Value::getContext
LLVMContext & getContext() const
All values hold a context through their type.
Definition: Value.cpp:940
llvm::InstrProfValueProfileInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1124
llvm::AtomicMemIntrinsic::setElementSizeInBytes
void setElementSizeInBytes(Constant *V)
Definition: IntrinsicInst.h:750
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:121
llvm::WithOverflowInst
Represents an op.with.overflow intrinsic.
Definition: IntrinsicInst.h:541
llvm::MemMoveInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:906
llvm::CallBase::setArgOperand
void setArgOperand(unsigned i, Value *v)
Definition: InstrTypes.h:1346
llvm::PointerUnion
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition: PointerUnion.h:149
llvm::Value::stripPointerCasts
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Definition: Value.cpp:636
llvm::VAEndInst::getArgList
Value * getArgList() const
Definition: IntrinsicInst.h:1061
llvm::AtomicMemTransferInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:787
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:140
llvm::MDNode::getContext
LLVMContext & getContext() const
Definition: Metadata.h:957
llvm::Attribute::getWithAlignment
static Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
Definition: Attributes.cpp:160
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:2189
llvm::GCResultInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1259
llvm::GCRelocateInst::getBasePtr
Value * getBasePtr() const
Definition: IntrinsicInst.cpp:436
llvm::MemIntrinsicBase::getRawDestUse
Use & getRawDestUse()
Definition: IntrinsicInst.h:593
llvm::minnum
LLVM_READONLY APFloat minnum(const APFloat &A, const APFloat &B)
Implements IEEE minNum semantics.
Definition: APFloat.h:1286
FPEnv.h
llvm::AtomicMemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:796
llvm::InstrProfValueProfileInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1121
llvm::GCRelocateInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1235
llvm::MemIntrinsicBase::getLength
Value * getLength() const
Definition: IntrinsicInst.h:595
llvm::ConstrainedFPIntrinsic::isUnaryOp
bool isUnaryOp() const
Definition: IntrinsicInst.cpp:214
llvm::AnyMemSetInst
This class represents any memset intrinsic.
Definition: IntrinsicInst.h:961
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:575
llvm::VACopyInst
This represents the llvm.va_copy intrinsic.
Definition: IntrinsicInst.h:1065
llvm::VAStartInst::getArgList
Value * getArgList() const
Definition: IntrinsicInst.h:1048
llvm::VPIntrinsic
This is the common base class for vector predication intrinsics.
Definition: IntrinsicInst.h:385
llvm::RegState::Undef
@ Undef
Value of the register doesn't matter.
Definition: MachineInstrBuilder.h:53
GlobalVariable.h
llvm::MemIntrinsicBase
Common base class for all memory intrinsics.
Definition: IntrinsicInst.h:584
llvm::MemIntrinsicBase::setDestAlignment
void setDestAlignment(unsigned Alignment)
FIXME: Remove this function once transition to Align is over.
Definition: IntrinsicInst.h:628
Casting.h
Function.h
llvm::NoAliasScopeDeclInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1180
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:677
llvm::CmpInst::isSigned
bool isSigned() const
Definition: InstrTypes.h:937
llvm::VACopyInst::getDest
Value * getDest() const
Definition: IntrinsicInst.h:1074
llvm::MemIntrinsicBase::getLengthUse
const Use & getLengthUse() const
Definition: IntrinsicInst.h:598
llvm::ConstrainedFPIntrinsic::isTernaryOp
bool isTernaryOp() const
Definition: IntrinsicInst.cpp:225
llvm::VAEndInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1054
llvm::AnyMemMoveInst
This class represents any memmove intrinsic i.e.
Definition: IntrinsicInst.h:1022
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:1079
llvm::AtomicMemIntrinsic
Definition: IntrinsicInst.h:733
llvm::Instruction::BinaryOps
BinaryOps
Definition: Instruction.h:768
llvm::MemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:840
llvm::AtomicMemSetInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:778
Instructions.h
llvm::MemCpyInst
This class wraps the llvm.memcpy intrinsic.
Definition: IntrinsicInst.h:888
llvm::MemIntrinsicBase::getRawDestUse
const Use & getRawDestUse() const
Definition: IntrinsicInst.h:592
llvm::MinMaxIntrinsic
This class represents min/max intrinsics.
Definition: IntrinsicInst.h:462
llvm::PseudoProbeInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1153
llvm::MemIntrinsic::isVolatile
bool isVolatile() const
Definition: IntrinsicInst.h:835
llvm::DbgVariableIntrinsic::location_op_iterator
Definition: IntrinsicInst.h:153
llvm::DbgValueInst::getValue
Value * getValue(unsigned OpIdx=0) const
Definition: IntrinsicInst.h:346
llvm::CallBase::getArgOperand
Value * getArgOperand(unsigned i) const
Definition: InstrTypes.h:1341
llvm::DbgAddrIntrinsic::getAddress
Value * getAddress() const
Definition: IntrinsicInst.h:325
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:336
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:291
llvm::InstrProfValueProfileInst::getName
GlobalVariable * getName() const
Definition: IntrinsicInst.h:1128
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:820
llvm::IntrinsicInst::isAssumeLikeIntrinsic
bool isAssumeLikeIntrinsic() const
Definition: IntrinsicInst.h:87
llvm::MemIntrinsicBase::getRawDest
Value * getRawDest() const
Definition: IntrinsicInst.h:589
llvm::ConstrainedFPCmpIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:447
llvm::MemIntrinsic::setVolatile
void setVolatile(Constant *V)
Definition: IntrinsicInst.h:837
llvm::AtomicMemIntrinsic::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:756
llvm::ValueAsMetadata
Value wrapper in the Metadata hierarchy.
Definition: Metadata.h:344
llvm::BinaryOpIntrinsic::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:523
llvm::ConstrainedFPIntrinsic::getRoundingMode
Optional< RoundingMode > getRoundingMode() const
Definition: IntrinsicInst.cpp:173
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:1450
llvm::GCProjectionInst::isTiedToInvoke
bool isTiedToInvoke() const
Return true if this relocate is tied to the invoke statepoint.
Definition: IntrinsicInst.h:1218
llvm::VPIntrinsic::getMaskParam
Value * getMaskParam() const
Definition: IntrinsicInst.cpp:258
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3121
llvm::MemTransferBase::getRawSourceUse
const Use & getRawSourceUse() const
Definition: IntrinsicInst.h:661
llvm::AnyMemTransferInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:994
llvm::User::getOperand
Value * getOperand(unsigned i) const
Definition: User.h:169
llvm::InstrProfIncrementInst::getName
GlobalVariable * getName() const
Definition: IntrinsicInst.h:1088
llvm::AtomicMemMoveInst
This class represents the atomic memmove intrinsic i.e.
Definition: IntrinsicInst.h:815
llvm::DbgLabelInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:378
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:1157
llvm::DbgVariableIntrinsic::location_op_iterator::operator--
location_op_iterator & operator--()
Definition: IntrinsicInst.h:189
Value.h
llvm::AnyMemIntrinsic
Definition: IntrinsicInst.h:930
llvm::MemSetBase::getValueUse
Use & getValueUse()
Definition: IntrinsicInst.h:722
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::DbgAddrIntrinsic
This represents the llvm.dbg.addr instruction.
Definition: IntrinsicInst.h:323
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:2179
llvm::DbgValueInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:358
llvm::DbgLabelInst::classof
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: IntrinsicInst.h:375
llvm::DbgValueInst::getValues
iterator_range< location_op_iterator > getValues() const
Definition: IntrinsicInst.h:349
llvm::AnyMemCpyInst
This class represents any memcpy intrinsic i.e.
Definition: IntrinsicInst.h:1002
llvm::GCProjectionInst::getStatepoint
const GCStatepointInst * getStatepoint() const
The statepoint with which this gc.relocate is associated.
Definition: IntrinsicInst.cpp:417
llvm::MinMaxIntrinsic::getRHS
Value * getRHS() const
Definition: IntrinsicInst.h:480
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:1004
llvm::AnyMemCpyInst::classof
static bool classof(const Value *V)
Definition: IntrinsicInst.h:1014
llvm::MemTransferBase::getSource
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it,...
Definition: IntrinsicInst.h:669
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:38
llvm::DbgVariableIntrinsic::isUndef
bool isUndef() const
Definition: IntrinsicInst.h:242
llvm::VAStartInst::classof
static bool classof(const IntrinsicInst *I)
Definition: IntrinsicInst.h:1041