llvm/llvm/lib/IR/IntrinsicInst.cpp

//===-- IntrinsicInst.cpp - Intrinsic Instruction Wrappers ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements methods that make it really easy to deal with intrinsic
// functions.
//
// All intrinsic function calls are instances of the call instruction, so these
// are all subclasses of the CallInst class.  Note that none of these classes
// has state or virtual methods, which is an important part of this gross/neat
// hack working.
//
// In some cases, arguments to intrinsics need to be generic and are defined as
// type pointer to empty struct { }*.  To access the real item of interest the
// cast instruction needs to be stripped away.
//
//===----------------------------------------------------------------------===//

#include "llvm/IR/IntrinsicInst.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Statepoint.h"
#include <optional>

usingnamespacellvm;

bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID IID) {}

//===----------------------------------------------------------------------===//
/// DbgVariableIntrinsic - This is the common base class for debug info
/// intrinsics for variables.
///

iterator_range<location_op_iterator> RawLocationWrapper::location_ops() const {}

iterator_range<location_op_iterator>
DbgVariableIntrinsic::location_ops() const {}

Value *DbgVariableIntrinsic::getVariableLocationOp(unsigned OpIdx) const {}

Value *RawLocationWrapper::getVariableLocationOp(unsigned OpIdx) const {}

static ValueAsMetadata *getAsMetadata(Value *V) {}

void DbgVariableIntrinsic::replaceVariableLocationOp(Value *OldValue,
                                                     Value *NewValue,
                                                     bool AllowEmpty) {}
void DbgVariableIntrinsic::replaceVariableLocationOp(unsigned OpIdx,
                                                     Value *NewValue) {}

void DbgVariableIntrinsic::addVariableLocationOps(ArrayRef<Value *> NewValues,
                                                  DIExpression *NewExpr) {}

std::optional<uint64_t> DbgVariableIntrinsic::getFragmentSizeInBits() const {}

Value *DbgAssignIntrinsic::getAddress() const {}

void DbgAssignIntrinsic::setAssignId(DIAssignID *New) {}

void DbgAssignIntrinsic::setAddress(Value *V) {}

void DbgAssignIntrinsic::setKillAddress() {}

bool DbgAssignIntrinsic::isKillAddress() const {}

void DbgAssignIntrinsic::setValue(Value *V) {}

ConstantInt *InstrProfCntrInstBase::getNumCounters() const {}

ConstantInt *InstrProfCntrInstBase::getIndex() const {}

void InstrProfCntrInstBase::setIndex(uint32_t Idx) {}

Value *InstrProfIncrementInst::getStep() const {}

Value *InstrProfCallsite::getCallee() const {}

void InstrProfCallsite::setCallee(Value *Callee) {}

std::optional<RoundingMode> ConstrainedFPIntrinsic::getRoundingMode() const {}

std::optional<fp::ExceptionBehavior>
ConstrainedFPIntrinsic::getExceptionBehavior() const {}

bool ConstrainedFPIntrinsic::isDefaultFPEnvironment() const {}

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

FCmpInst::Predicate ConstrainedFPCmpIntrinsic::getPredicate() const {}

unsigned ConstrainedFPIntrinsic::getNonMetadataArgCount() const {}

bool ConstrainedFPIntrinsic::classof(const IntrinsicInst *I) {}

ElementCount VPIntrinsic::getStaticVectorLength() const {}

Value *VPIntrinsic::getMaskParam() const {}

void VPIntrinsic::setMaskParam(Value *NewMask) {}

Value *VPIntrinsic::getVectorLengthParam() const {}

void VPIntrinsic::setVectorLengthParam(Value *NewEVL) {}

std::optional<unsigned>
VPIntrinsic::getMaskParamPos(Intrinsic::ID IntrinsicID) {}

std::optional<unsigned>
VPIntrinsic::getVectorLengthParamPos(Intrinsic::ID IntrinsicID) {}

/// \return the alignment of the pointer used by this load/store/gather or
/// scatter.
MaybeAlign VPIntrinsic::getPointerAlignment() const {}

/// \return The pointer operand of this load,store, gather or scatter.
Value *VPIntrinsic::getMemoryPointerParam() const {}

std::optional<unsigned>
VPIntrinsic::getMemoryPointerParamPos(Intrinsic::ID VPID) {}

/// \return The data (payload) operand of this store or scatter.
Value *VPIntrinsic::getMemoryDataParam() const {}

std::optional<unsigned> VPIntrinsic::getMemoryDataParamPos(Intrinsic::ID VPID) {}

constexpr bool isVPIntrinsic(Intrinsic::ID ID) {}

bool VPIntrinsic::isVPIntrinsic(Intrinsic::ID ID) {}

// Equivalent non-predicated opcode
constexpr static std::optional<unsigned>
getFunctionalOpcodeForVP(Intrinsic::ID ID) {}

std::optional<unsigned>
VPIntrinsic::getFunctionalOpcodeForVP(Intrinsic::ID ID) {}

// Equivalent non-predicated intrinsic ID
constexpr static std::optional<Intrinsic::ID>
getFunctionalIntrinsicIDForVP(Intrinsic::ID ID) {}

std::optional<Intrinsic::ID>
VPIntrinsic::getFunctionalIntrinsicIDForVP(Intrinsic::ID ID) {}

constexpr static bool doesVPHaveNoFunctionalEquivalent(Intrinsic::ID ID) {}

// All VP intrinsics should have an equivalent non-VP opcode or intrinsic
// defined, or be marked that they don't have one.
#define BEGIN_REGISTER_VP_INTRINSIC
#include "llvm/IR/VPIntrinsics.def"

// Equivalent non-predicated constrained intrinsic
std::optional<Intrinsic::ID>
VPIntrinsic::getConstrainedIntrinsicIDForVP(Intrinsic::ID ID) {}

Intrinsic::ID VPIntrinsic::getForOpcode(unsigned IROPC) {}

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

Intrinsic::ID VPIntrinsic::getForIntrinsic(Intrinsic::ID Id) {}

bool VPIntrinsic::canIgnoreVectorLengthParam() const {}

Function *VPIntrinsic::getDeclarationForParams(Module *M, Intrinsic::ID VPID,
                                               Type *ReturnType,
                                               ArrayRef<Value *> Params) {}

bool VPReductionIntrinsic::isVPReduction(Intrinsic::ID ID) {}

bool VPCastIntrinsic::isVPCast(Intrinsic::ID ID) {}

bool VPCmpIntrinsic::isVPCmp(Intrinsic::ID ID) {}

bool VPBinOpIntrinsic::isVPBinOp(Intrinsic::ID ID) {}

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

CmpInst::Predicate VPCmpIntrinsic::getPredicate() const {}

unsigned VPReductionIntrinsic::getVectorParamPos() const {}

unsigned VPReductionIntrinsic::getStartParamPos() const {}

std::optional<unsigned>
VPReductionIntrinsic::getVectorParamPos(Intrinsic::ID ID) {}

std::optional<unsigned>
VPReductionIntrinsic::getStartParamPos(Intrinsic::ID ID) {}

Instruction::BinaryOps BinaryOpIntrinsic::getBinaryOp() const {}

bool BinaryOpIntrinsic::isSigned() const {}

unsigned BinaryOpIntrinsic::getNoWrapKind() const {}

const Value *GCProjectionInst::getStatepoint() const {}

Value *GCRelocateInst::getBasePtr() const {}

Value *GCRelocateInst::getDerivedPtr() const {}