LLVM: lib/IR/IntrinsicInst.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

32#include

33

34using namespace llvm;

35

37 switch (IID) {

38 case Intrinsic::objc_autorelease:

39 case Intrinsic::objc_autoreleasePoolPop:

40 case Intrinsic::objc_autoreleasePoolPush:

41 case Intrinsic::objc_autoreleaseReturnValue:

42 case Intrinsic::objc_copyWeak:

43 case Intrinsic::objc_destroyWeak:

44 case Intrinsic::objc_initWeak:

45 case Intrinsic::objc_loadWeak:

46 case Intrinsic::objc_loadWeakRetained:

47 case Intrinsic::objc_moveWeak:

48 case Intrinsic::objc_release:

49 case Intrinsic::objc_retain:

50 case Intrinsic::objc_retainAutorelease:

51 case Intrinsic::objc_retainAutoreleaseReturnValue:

52 case Intrinsic::objc_retainAutoreleasedReturnValue:

53 case Intrinsic::objc_retainBlock:

54 case Intrinsic::objc_storeStrong:

55 case Intrinsic::objc_storeWeak:

56 case Intrinsic::objc_unsafeClaimAutoreleasedReturnValue:

57 case Intrinsic::objc_retainedObject:

58 case Intrinsic::objc_unretainedObject:

59 case Intrinsic::objc_unretainedPointer:

60 case Intrinsic::objc_retain_autorelease:

61 case Intrinsic::objc_sync_enter:

62 case Intrinsic::objc_sync_exit:

63 return true;

64 default:

65 return false;

66 }

67}

68

69

70

71

72

73

76 assert(MD && "First operand of DbgVariableIntrinsic should be non-null.");

77

78 if (auto *VAM = dyn_cast(MD)) {

80 }

81

82 if (auto *AL = dyn_cast(MD))

85

88}

89

93}

94

97}

98

101 assert(MD && "First operand of DbgVariableIntrinsic should be non-null.");

102 if (auto *AL = dyn_cast(MD))

103 return AL->getArgs()[OpIdx]->getValue();

104 if (isa(MD))

105 return nullptr;

107 isa(MD) &&

108 "Attempted to get location operand from DbgVariableIntrinsic with none.");

109 auto *V = cast(MD);

110 assert(OpIdx == 0 && "Operand Index must be 0 for a debug intrinsic with a "

111 "single location operand.");

112 return V->getValue();

113}

114

116 return isa(V) ? dyn_cast(

117 cast(V)->getMetadata())

119}

120

123 bool AllowEmpty) {

124

125

126 auto ReplaceDbgAssignAddress = [this, OldValue, NewValue]() -> bool {

127 auto *DAI = dyn_cast(this);

128 if (!DAI || OldValue != DAI->getAddress())

129 return false;

130 DAI->setAddress(NewValue);

131 return true;

132 };

133 bool DbgAssignAddrReplaced = ReplaceDbgAssignAddress();

134 (void)DbgAssignAddrReplaced;

135

136 assert(NewValue && "Values must be non-null");

138 auto OldIt = find(Locations, OldValue);

139 if (OldIt == Locations.end()) {

140 if (AllowEmpty || DbgAssignAddrReplaced)

141 return;

142 assert(DbgAssignAddrReplaced &&

143 "OldValue must be dbg.assign addr if unused in DIArgList");

144 return;

145 }

146

147 assert(OldIt != Locations.end() && "OldValue must be a current location");

149 Value *NewOperand = isa(NewValue)

150 ? NewValue

154 }

157 for (auto *VMD : Locations)

161}

163 Value *NewValue) {

166 Value *NewOperand = isa(NewValue)

167 ? NewValue

171 }

179}

180

184 NewValues.size()) &&

185 "NewExpr for debug variable intrinsic does not reference every "

186 "location operand.");

187 assert(is\_contained(NewValues, nullptr) && "New values must be non-null");

192 for (auto *VMD : NewValues)

196}

197

199 if (auto Fragment = getExpression()->getFragmentInfo())

200 return Fragment->SizeInBits;

202}

203

206 if (auto *V = dyn_cast(MD))

207 return V->getValue();

208

209

211 return nullptr;

212}

213

216}

217

221}

222

225 return;

227}

228

231 return Addr || isa(Addr);

232}

233

237}

238

241 llvm_unreachable("InstrProfValueProfileInst does not have counters!");

243}

244

247 llvm_unreachable("Please use InstrProfValueProfileInst::getIndex()");

249}

250

252 assert(isa(this));

254}

255

259 }

263}

264

266 if (isa(this))

268 return nullptr;

269}

270

272 assert(isa(this));

274}

275

277 unsigned NumOperands = arg_size();

279 auto *MAV = dyn_cast(getArgOperand(NumOperands - 2));

280 if (MAV)

281 MD = MAV->getMetadata();

282 if (!MD || !isa(MD))

283 return std::nullopt;

285}

286

287std::optionalfp::ExceptionBehavior

289 unsigned NumOperands = arg_size();

291 auto *MAV = dyn_cast(getArgOperand(NumOperands - 1));

292 if (MAV)

293 MD = MAV->getMetadata();

294 if (!MD || !isa(MD))

295 return std::nullopt;

297}

298

301 if (Except) {

303 return false;

304 }

305

306 std::optional Rounding = getRoundingMode();

307 if (Rounding) {

309 return false;

310 }

311

312 return true;

313}

314

316 Metadata *MD = cast(Op)->getMetadata();

317 if (!MD || !isa(MD))

335}

336

339}

340

342

343 unsigned NumArgs = arg_size() - 1;

344

345

347 NumArgs -= 1;

348

349

350 if (isa(this))

351 NumArgs -= 1;

352

353 return NumArgs;

354}

355

358}

359

362 const auto *VT = cast(T);

363 auto ElemCount = VT->getElementCount();

364 return ElemCount;

365 };

366

368 if (!VPMask) {

371 "Unexpected VP intrinsic without mask operand");

372 return GetVectorLengthOfType(getType());

373 }

374 return GetVectorLengthOfType(VPMask->getType());

375}

376

380 return nullptr;

381}

382

386}

387

391 return nullptr;

392}

393

397}

398

399std::optional

401 switch (IntrinsicID) {

402 default:

403 return std::nullopt;

404

405#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \

406 case Intrinsic::VPID: \

407 return MASKPOS;

408#include "llvm/IR/VPIntrinsics.def"

409 }

410}

411

412std::optional

414 switch (IntrinsicID) {

415 default:

416 return std::nullopt;

417

418#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \

419 case Intrinsic::VPID: \

420 return VLENPOS;

421#include "llvm/IR/VPIntrinsics.def"

422 }

423}

424

425

426

428 std::optional PtrParamOpt =

430 assert(PtrParamOpt && "no pointer argument!");

432}

433

434

438 return nullptr;

439}

440

441std::optional

443 switch (VPID) {

444 default:

445 return std::nullopt;

446 case Intrinsic::vp_store:

447 case Intrinsic::vp_scatter:

448 case Intrinsic::experimental_vp_strided_store:

449 return 1;

450 case Intrinsic::vp_load:

451 case Intrinsic::vp_gather:

452 case Intrinsic::experimental_vp_strided_load:

453 return 0;

454 }

455}

456

457

460 if (!DataParamOpt)

461 return nullptr;

463}

464

466 switch (VPID) {

467 default:

468 return std::nullopt;

469 case Intrinsic::vp_store:

470 case Intrinsic::vp_scatter:

471 case Intrinsic::experimental_vp_strided_store:

472 return 0;

473 }

474}

475

477 switch (ID) {

478 default:

479 break;

480#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \

481 case Intrinsic::VPID: \

482 return true;

483#include "llvm/IR/VPIntrinsics.def"

484 }

485 return false;

486}

487

489 return ::isVPIntrinsic(ID);

490}

491

492

493constexpr static std::optional

495 switch (ID) {

496 default:

497 break;

498#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:

499#define VP_PROPERTY_FUNCTIONAL_OPC(OPC) return Instruction::OPC;

500#define END_REGISTER_VP_INTRINSIC(VPID) break;

501#include "llvm/IR/VPIntrinsics.def"

502 }

503 return std::nullopt;

504}

505

506std::optional

508 return ::getFunctionalOpcodeForVP(ID);

509}

510

511

512constexpr static std::optionalIntrinsic::ID

514 switch (ID) {

515 default:

516 break;

517#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:

518#define VP_PROPERTY_FUNCTIONAL_INTRINSIC(INTRIN) return Intrinsic::INTRIN;

519#define END_REGISTER_VP_INTRINSIC(VPID) break;

520#include "llvm/IR/VPIntrinsics.def"

521 }

522 return std::nullopt;

523}

524

525std::optionalIntrinsic::ID

527 return ::getFunctionalIntrinsicIDForVP(ID);

528}

529

531 switch (ID) {

532 default:

533 break;

534#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:

535#define VP_PROPERTY_NO_FUNCTIONAL return true;

536#define END_REGISTER_VP_INTRINSIC(VPID) break;

537#include "llvm/IR/VPIntrinsics.def"

538 }

539 return false;

540}

541

542

543

544#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) \

545 static_assert(doesVPHaveNoFunctionalEquivalent(Intrinsic::VPID) || \

546 getFunctionalOpcodeForVP(Intrinsic::VPID) || \

547 getFunctionalIntrinsicIDForVP(Intrinsic::VPID));

548#include "llvm/IR/VPIntrinsics.def"

549

550

551std::optionalIntrinsic::ID

553 switch (ID) {

554 default:

555 break;

556#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:

557#define VP_PROPERTY_CONSTRAINEDFP(CID) return Intrinsic::CID;

558#define END_REGISTER_VP_INTRINSIC(VPID) break;

559#include "llvm/IR/VPIntrinsics.def"

560 }

561 return std::nullopt;

562}

563

565 switch (IROPC) {

566 default:

567 break;

568

569#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) break;

570#define VP_PROPERTY_FUNCTIONAL_OPC(OPC) case Instruction::OPC:

571#define END_REGISTER_VP_INTRINSIC(VPID) return Intrinsic::VPID;

572#include "llvm/IR/VPIntrinsics.def"

573 }

575}

576

579 return Id;

580

581 switch (Id) {

582 default:

583 break;

584#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) break;

585#define VP_PROPERTY_FUNCTIONAL_INTRINSIC(INTRIN) case Intrinsic::INTRIN:

586#define END_REGISTER_VP_INTRINSIC(VPID) return Intrinsic::VPID;

587#include "llvm/IR/VPIntrinsics.def"

588 }

590}

591

593 return ::getForIntrinsic(Id);

594}

595

597 using namespace PatternMatch;

598

600

601

603 if (!VLParam)

604 return true;

605

606

607

608

609

610

611

612 if (EC.isScalable()) {

613

616 return VScaleFactor >= EC.getKnownMinValue();

617 return (EC.getKnownMinValue() == 1) && match(VLParam, m_VScale());

618 }

619

620

621 const auto *VLConst = dyn_cast(VLParam);

622 if (!VLConst)

623 return false;

624

625 uint64_t VLNum = VLConst->getZExtValue();

626 if (VLNum >= EC.getKnownMinValue())

627 return true;

628

629 return false;

630}

631

636 switch (VPID) {

637 default: {

638 Type *OverloadTy = Params[0]->getType();

640 OverloadTy =

642

644 break;

645 }

646 case Intrinsic::vp_trunc:

647 case Intrinsic::vp_sext:

648 case Intrinsic::vp_zext:

649 case Intrinsic::vp_fptoui:

650 case Intrinsic::vp_fptosi:

651 case Intrinsic::vp_uitofp:

652 case Intrinsic::vp_sitofp:

653 case Intrinsic::vp_fptrunc:

654 case Intrinsic::vp_fpext:

655 case Intrinsic::vp_ptrtoint:

656 case Intrinsic::vp_inttoptr:

657 case Intrinsic::vp_lrint:

658 case Intrinsic::vp_llrint:

659 case Intrinsic::vp_cttz_elts:

661 M, VPID, {ReturnType, Params[0]->getType()});

662 break;

663 case Intrinsic::vp_is_fpclass:

665 break;

666 case Intrinsic::vp_merge:

667 case Intrinsic::vp_select:

669 break;

670 case Intrinsic::vp_load:

672 M, VPID, {ReturnType, Params[0]->getType()});

673 break;

674 case Intrinsic::experimental_vp_strided_load:

676 M, VPID, {ReturnType, Params[0]->getType(), Params[1]->getType()});

677 break;

678 case Intrinsic::vp_gather:

680 M, VPID, {ReturnType, Params[0]->getType()});

681 break;

682 case Intrinsic::vp_store:

684 M, VPID, {Params[0]->getType(), Params[1]->getType()});

685 break;

686 case Intrinsic::experimental_vp_strided_store:

688 M, VPID,

689 {Params[0]->getType(), Params[1]->getType(), Params[2]->getType()});

690 break;

691 case Intrinsic::vp_scatter:

693 M, VPID, {Params[0]->getType(), Params[1]->getType()});

694 break;

695 case Intrinsic::experimental_vp_splat:

697 break;

698 }

699 assert(VPFunc && "Could not declare VP intrinsic");

700 return VPFunc;

701}

702

704 switch (ID) {

705 case Intrinsic::vp_reduce_add:

706 case Intrinsic::vp_reduce_mul:

707 case Intrinsic::vp_reduce_and:

708 case Intrinsic::vp_reduce_or:

709 case Intrinsic::vp_reduce_xor:

710 case Intrinsic::vp_reduce_smax:

711 case Intrinsic::vp_reduce_smin:

712 case Intrinsic::vp_reduce_umax:

713 case Intrinsic::vp_reduce_umin:

714 case Intrinsic::vp_reduce_fmax:

715 case Intrinsic::vp_reduce_fmin:

716 case Intrinsic::vp_reduce_fmaximum:

717 case Intrinsic::vp_reduce_fminimum:

718 case Intrinsic::vp_reduce_fadd:

719 case Intrinsic::vp_reduce_fmul:

720 return true;

721 default:

722 return false;

723 }

724}

725

727

730 return false;

731}

732

734 switch (ID) {

735 default:

736 return false;

737 case Intrinsic::vp_fcmp:

738 case Intrinsic::vp_icmp:

739 return true;

740 }

741}

742

744 switch (ID) {

745 default:

746 break;

747#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:

748#define VP_PROPERTY_BINARYOP return true;

749#define END_REGISTER_VP_INTRINSIC(VPID) break;

750#include "llvm/IR/VPIntrinsics.def"

751 }

752 return false;

753}

754

756 Metadata *MD = cast(Op)->getMetadata();

757 if (!MD || !isa(MD))

771}

772

778}

779

782}

783

786}

787

788std::optional

791 return 1;

792 return std::nullopt;

793}

794

795std::optional

798 return 0;

799 return std::nullopt;

800}

801

804 case Intrinsic::uadd_with_overflow:

805 case Intrinsic::sadd_with_overflow:

806 case Intrinsic::uadd_sat:

807 case Intrinsic::sadd_sat:

808 return Instruction::Add;

809 case Intrinsic::usub_with_overflow:

810 case Intrinsic::ssub_with_overflow:

811 case Intrinsic::usub_sat:

812 case Intrinsic::ssub_sat:

813 return Instruction::Sub;

814 case Intrinsic::umul_with_overflow:

815 case Intrinsic::smul_with_overflow:

816 return Instruction::Mul;

817 default:

819 }

820}

821

824 case Intrinsic::sadd_with_overflow:

825 case Intrinsic::ssub_with_overflow:

826 case Intrinsic::smul_with_overflow:

827 case Intrinsic::sadd_sat:

828 case Intrinsic::ssub_sat:

829 return true;

830 default:

831 return false;

832 }

833}

834

838 else

840}

841

844 if (isa(Token))

845 return Token;

846

847

848 if (isa(Token))

850

851

852

853 if (!isa(Token))

854 return cast(Token);

855

856

858 cast(Token)->getParent()->getUniquePredecessor();

859

860 assert(InvokeBB && "safepoints should have unique landingpads");

862 "safepoint block should be well formed");

863

864 return cast(InvokeBB->getTerminator());

865}

866

869 if (isa(Statepoint))

871

872 auto *GCInst = cast(Statepoint);

876}

877

880 if (isa(Statepoint))

882

883 auto *GCInst = cast(Statepoint);

887}

This file contains the declarations for the subclasses of Constant, which represent the different fla...

Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx

Module.h This file contains the declarations for the Module class.

static constexpr std::optional< Intrinsic::ID > getFunctionalIntrinsicIDForVP(Intrinsic::ID ID)

static constexpr std::optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)

static ICmpInst::Predicate getIntPredicateFromMD(const Value *Op)

static constexpr bool doesVPHaveNoFunctionalEquivalent(Intrinsic::ID ID)

constexpr bool isVPIntrinsic(Intrinsic::ID ID)

static constexpr Intrinsic::ID getForIntrinsic(Intrinsic::ID Id)

static FCmpInst::Predicate getFPPredicateFromMD(const Value *Op)

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

size_t size() const

size - Get the array size.

LLVM Basic Block Representation.

const Function * getParent() const

Return the enclosing method, or null if none.

const Instruction * getTerminator() const LLVM_READONLY

Returns the terminator instruction if the block is well formed or null if the block is not well forme...

unsigned getNoWrapKind() const

Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.

bool isSigned() const

Whether the intrinsic is signed or unsigned.

Instruction::BinaryOps getBinaryOp() const

Returns the binary operation underlying the intrinsic.

MaybeAlign getParamAlign(unsigned ArgNo) const

Extract the alignment for a call or parameter (0=unknown).

Value * getArgOperand(unsigned i) const

void setArgOperand(unsigned i, Value *v)

unsigned arg_size() const

Predicate

This enumeration lists the possible predicates for CmpInst subclasses.

@ FCMP_OEQ

0 0 0 1 True if ordered and equal

@ ICMP_SLT

signed less than

@ ICMP_SLE

signed less or equal

@ FCMP_OLT

0 1 0 0 True if ordered and less than

@ FCMP_ULE

1 1 0 1 True if unordered, less than, or equal

@ FCMP_OGT

0 0 1 0 True if ordered and greater than

@ FCMP_OGE

0 0 1 1 True if ordered and greater than or equal

@ ICMP_UGE

unsigned greater or equal

@ ICMP_UGT

unsigned greater than

@ ICMP_SGT

signed greater than

@ FCMP_ULT

1 1 0 0 True if unordered or less than

@ FCMP_ONE

0 1 1 0 True if ordered and operands are unequal

@ FCMP_UEQ

1 0 0 1 True if unordered or equal

@ ICMP_ULT

unsigned less than

@ FCMP_UGT

1 0 1 0 True if unordered or greater than

@ FCMP_OLE

0 1 0 1 True if ordered and less than or equal

@ FCMP_ORD

0 1 1 1 True if ordered (no nans)

@ ICMP_SGE

signed greater or equal

@ FCMP_UNE

1 1 1 0 True if unordered or not equal

@ ICMP_ULE

unsigned less or equal

@ FCMP_UGE

1 0 1 1 True if unordered, greater than, or equal

@ FCMP_UNO

1 0 0 0 True if unordered: isnan(X) | isnan(Y)

This is the shared class of boolean and integer constants.

FCmpInst::Predicate getPredicate() const

std::optional< fp::ExceptionBehavior > getExceptionBehavior() const

std::optional< RoundingMode > getRoundingMode() const

unsigned getNonMetadataArgCount() const

static bool classof(const IntrinsicInst *I)

bool isDefaultFPEnvironment() const

static DIArgList * get(LLVMContext &Context, ArrayRef< ValueAsMetadata * > Args)

std::optional< uint64_t > getSizeInBits() const

Determines the size of the variable's type.

This class represents an Operation in the Expression.

void setAssignId(DIAssignID *New)

void setKillAddress()

Kill the address component.

bool isKillAddress() const

Check whether this kills the address component.

Metadata * getRawAddress() const

Value * getAddress() const

void setAddress(Value *V)

iterator_range< location_op_iterator > location_ops() const

Get the locations corresponding to the variable referenced by the debug info intrinsic.

void addVariableLocationOps(ArrayRef< Value * > NewValues, DIExpression *NewExpr)

Adding a new location operand will always result in this intrinsic using an ArgList,...

void replaceVariableLocationOp(Value *OldValue, Value *NewValue, bool AllowEmpty=false)

Value * getVariableLocationOp(unsigned OpIdx) const

DILocalVariable * getVariable() const

unsigned getNumVariableLocationOps() const

void setOperand(unsigned i, Value *v)

std::optional< uint64_t > getFragmentSizeInBits() const

Get the size (in bits) of the variable, or fragment of the variable that is described.

DIExpression * getExpression() const

void setArgOperand(unsigned i, Value *v)

RawLocationWrapper getWrappedLocation() const

const Value * getStatepoint() const

The statepoint with which this gc.relocate is associated.

Value * getBasePtr() const

unsigned getBasePtrIndex() const

The index into the associate statepoint's argument list which contains the base pointer of the pointe...

Value * getDerivedPtr() const

unsigned getDerivedPtrIndex() const

The index into the associate statepoint's argument list which contains the pointer whose relocation t...

void setCallee(Value *Callee)

Value * getCallee() const

ConstantInt * getIndex() const

void setIndex(uint32_t Idx)

ConstantInt * getNumCounters() const

static bool classof(const IntrinsicInst *I)

static bool classof(const IntrinsicInst *I)

const Module * getModule() const

Return the module owning the function this instruction belongs to or nullptr it the function does not...

A wrapper class for inspecting calls to intrinsic functions.

static bool mayLowerToFunctionCall(Intrinsic::ID IID)

Check if the intrinsic might lower into a regular function call in the course of IR transformations.

Intrinsic::ID getIntrinsicID() const

Return the intrinsic ID of this intrinsic.

This is an important class for using LLVM in a threaded context.

A Module instance is used to store all the information related to an LLVM module.

static PoisonValue * get(Type *T)

Static factory methods - Return an 'poison' object of the specified type.

Metadata * getRawLocation() const

iterator_range< location_op_iterator > location_ops() const

Get the locations corresponding to the variable referenced by the debug info intrinsic.

Value * getVariableLocationOp(unsigned OpIdx) const

void push_back(const T &Elt)

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

A switch()-like statement whose cases are string literals.

StringSwitch & Case(StringLiteral S, T Value)

The instances of the Type class are immutable: once they are created, they are never changed.

static IntegerType * getInt32Ty(LLVMContext &C)

static IntegerType * getInt64Ty(LLVMContext &C)

static UndefValue * get(Type *T)

Static factory methods - Return an 'undef' object of the specified type.

unsigned getNumOperands() const

static bool isVPBinOp(Intrinsic::ID ID)

static bool isVPCast(Intrinsic::ID ID)

static bool isVPCmp(Intrinsic::ID ID)

CmpInst::Predicate getPredicate() const

static std::optional< unsigned > getMaskParamPos(Intrinsic::ID IntrinsicID)

bool canIgnoreVectorLengthParam() const

void setMaskParam(Value *)

static std::optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)

static std::optional< unsigned > getMemoryDataParamPos(Intrinsic::ID)

Value * getVectorLengthParam() const

static std::optional< Intrinsic::ID > getFunctionalIntrinsicIDForVP(Intrinsic::ID ID)

void setVectorLengthParam(Value *)

static std::optional< unsigned > getVectorLengthParamPos(Intrinsic::ID IntrinsicID)

static Intrinsic::ID getForOpcode(unsigned OC)

The llvm.vp.* intrinsics for this instruction Opcode.

static Function * getOrInsertDeclarationForParams(Module *M, Intrinsic::ID, Type *ReturnType, ArrayRef< Value * > Params)

Declares a llvm.vp.

static std::optional< unsigned > getMemoryPointerParamPos(Intrinsic::ID)

static bool isVPIntrinsic(Intrinsic::ID)

Value * getMemoryDataParam() const

static Intrinsic::ID getForIntrinsic(Intrinsic::ID Id)

The llvm.vp.

Value * getMemoryPointerParam() const

MaybeAlign getPointerAlignment() const

Value * getMaskParam() const

ElementCount getStaticVectorLength() const

static std::optional< Intrinsic::ID > getConstrainedIntrinsicIDForVP(Intrinsic::ID ID)

static bool isVPReduction(Intrinsic::ID ID)

unsigned getStartParamPos() const

unsigned getVectorParamPos() const

LLVM Value Representation.

Type * getType() const

All values are typed, get the type of this value.

LLVMContext & getContext() const

All values hold a context through their type.

A range adaptor for a pair of iterators.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})

Look up the Function declaration of the intrinsic id in the Module M.

bool hasConstrainedFPRoundingModeOperand(ID QID)

Returns true if the intrinsic ID is for one of the "Constrained Floating-Point Intrinsics" that take ...

bool isConstrainedFPIntrinsic(ID QID)

Returns true if the intrinsic ID is for one of the "Constrained Floating-Point Intrinsics".

bool match(Val *V, const Pattern &P)

class_match< ConstantInt > m_ConstantInt()

Match an arbitrary ConstantInt and ignore it.

BinaryOp_match< LHS, RHS, Instruction::Mul > m_Mul(const LHS &L, const RHS &R)

VScaleVal_match m_VScale()

@ ebIgnore

This corresponds to "fpexcept.ignore".

This is an optimization pass for GlobalISel generic memory operations.

auto find(R &&Range, const T &Val)

Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.

static ValueAsMetadata * getAsMetadata(Value *V)

std::optional< fp::ExceptionBehavior > convertStrToExceptionBehavior(StringRef)

Returns a valid ExceptionBehavior enumerator when given a string valid as input in constrained intrin...

@ NearestTiesToEven

roundTiesToEven.

std::optional< RoundingMode > convertStrToRoundingMode(StringRef)

Returns a valid RoundingMode enumerator when given a string that is valid as input in constrained int...

bool is_contained(R &&Range, const E &Element)

Returns true if Element is found in Range.

This struct is a compact representation of a valid (power of two) or undefined (0) alignment.