LLVM 20.0.0git
Macros | Functions
IntrinsicInst.cpp File Reference
#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>
#include "llvm/IR/VPIntrinsics.def"

Go to the source code of this file.

Macros

#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS)
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS)
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_MEMOP(POINTERPOS, ...)   return POINTERPOS;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_MEMOP(POINTERPOS, DATAPOS)   return DATAPOS;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS)
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_FUNCTIONAL_OPC(OPC)   return Instruction::OPC;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_FUNCTIONAL_INTRINSIC(INTRIN)   return Intrinsic::INTRIN;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_NO_FUNCTIONAL   return true;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_CONSTRAINEDFP(HASRND, HASEXCEPT, CID)   return Intrinsic::CID;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   break;
 
#define VP_PROPERTY_FUNCTIONAL_OPC(OPC)   case Instruction::OPC:
 
#define END_REGISTER_VP_INTRINSIC(VPID)   return Intrinsic::VPID;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   break;
 
#define VP_PROPERTY_FUNCTIONAL_INTRINSIC(INTRIN)   case Intrinsic::INTRIN:
 
#define END_REGISTER_VP_INTRINSIC(VPID)   return Intrinsic::VPID;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_REDUCTION(STARTPOS, ...)   return true;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_CASTOP   return true;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_CMP(CCPOS, ...)   return true;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_BINARYOP   return true;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_CMP(CCPOS, ISFP)
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_REDUCTION(STARTPOS, VECTORPOS)   return VECTORPOS;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...)   case Intrinsic::VPID:
 
#define VP_PROPERTY_REDUCTION(STARTPOS, VECTORPOS)   return STARTPOS;
 
#define END_REGISTER_VP_INTRINSIC(VPID)   break;
 

Functions

static ValueAsMetadatagetAsMetadata (Value *V)
 
static FCmpInst::Predicate getFPPredicateFromMD (const Value *Op)
 
constexpr bool isVPIntrinsic (Intrinsic::ID ID)
 
static constexpr std::optional< unsignedgetFunctionalOpcodeForVP (Intrinsic::ID ID)
 
static constexpr std::optional< Intrinsic::IDgetFunctionalIntrinsicIDForVP (Intrinsic::ID ID)
 
static constexpr bool doesVPHaveNoFunctionalEquivalent (Intrinsic::ID ID)
 
static constexpr Intrinsic::ID getForIntrinsic (Intrinsic::ID Id)
 
static ICmpInst::Predicate getIntPredicateFromMD (const Value *Op)
 

Macro Definition Documentation

◆ BEGIN_REGISTER_VP_INTRINSIC [1/19]

#define BEGIN_REGISTER_VP_INTRINSIC (   VPID,
  MASKPOS,
  VLENPOS 
)
Value:
case Intrinsic::VPID: \
return MASKPOS;

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [2/19]

#define BEGIN_REGISTER_VP_INTRINSIC (   VPID,
  MASKPOS,
  VLENPOS 
)
Value:
case Intrinsic::VPID: \
return VLENPOS;

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [3/19]

#define BEGIN_REGISTER_VP_INTRINSIC (   VPID,
  MASKPOS,
  VLENPOS 
)
Value:
case Intrinsic::VPID: \
return true;

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [4/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [5/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [6/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [7/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [8/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [9/19]

#define BEGIN_REGISTER_VP_INTRINSIC (   VPID,
  ... 
)
Value:
static_assert(doesVPHaveNoFunctionalEquivalent(Intrinsic::VPID) || \
getFunctionalOpcodeForVP(Intrinsic::VPID) || \
getFunctionalIntrinsicIDForVP(Intrinsic::VPID));
static constexpr bool doesVPHaveNoFunctionalEquivalent(Intrinsic::ID ID)

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [10/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [11/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [12/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [13/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [14/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [15/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [16/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [17/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [18/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ BEGIN_REGISTER_VP_INTRINSIC [19/19]

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

Definition at line 569 of file IntrinsicInst.cpp.

◆ END_REGISTER_VP_INTRINSIC [1/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [2/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [3/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [4/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [5/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [6/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [7/15]

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

◆ END_REGISTER_VP_INTRINSIC [8/15]

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

◆ END_REGISTER_VP_INTRINSIC [9/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [10/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [11/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [12/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [13/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [14/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ END_REGISTER_VP_INTRINSIC [15/15]

#define END_REGISTER_VP_INTRINSIC (   VPID)    break;

◆ VP_PROPERTY_BINARYOP

#define VP_PROPERTY_BINARYOP   return true;

◆ VP_PROPERTY_CASTOP

#define VP_PROPERTY_CASTOP   return true;

◆ VP_PROPERTY_CMP [1/2]

#define VP_PROPERTY_CMP (   CCPOS,
  ISFP 
)
Value:
CCArgIdx = CCPOS; \
IsFP = ISFP; \
break;

◆ VP_PROPERTY_CMP [2/2]

#define VP_PROPERTY_CMP (   CCPOS,
  ... 
)    return true;

◆ VP_PROPERTY_CONSTRAINEDFP

#define VP_PROPERTY_CONSTRAINEDFP (   HASRND,
  HASEXCEPT,
  CID 
)    return Intrinsic::CID;

◆ VP_PROPERTY_FUNCTIONAL_INTRINSIC [1/2]

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

◆ VP_PROPERTY_FUNCTIONAL_INTRINSIC [2/2]

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

◆ VP_PROPERTY_FUNCTIONAL_OPC [1/2]

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

◆ VP_PROPERTY_FUNCTIONAL_OPC [2/2]

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

◆ VP_PROPERTY_MEMOP [1/2]

#define VP_PROPERTY_MEMOP (   POINTERPOS,
  DATAPOS 
)    return DATAPOS;

◆ VP_PROPERTY_MEMOP [2/2]

#define VP_PROPERTY_MEMOP (   POINTERPOS,
  ... 
)    return POINTERPOS;

◆ VP_PROPERTY_NO_FUNCTIONAL

#define VP_PROPERTY_NO_FUNCTIONAL   return true;

◆ VP_PROPERTY_REDUCTION [1/3]

#define VP_PROPERTY_REDUCTION (   STARTPOS,
  VECTORPOS 
)    return VECTORPOS;

◆ VP_PROPERTY_REDUCTION [2/3]

#define VP_PROPERTY_REDUCTION (   STARTPOS,
  VECTORPOS 
)    return STARTPOS;

◆ VP_PROPERTY_REDUCTION [3/3]

#define VP_PROPERTY_REDUCTION (   STARTPOS,
  ... 
)    return true;

Function Documentation

◆ doesVPHaveNoFunctionalEquivalent()

static constexpr bool doesVPHaveNoFunctionalEquivalent ( Intrinsic::ID  ID)
staticconstexpr

Definition at line 555 of file IntrinsicInst.cpp.

◆ getAsMetadata()

static ValueAsMetadata * getAsMetadata ( Value V)
static

Definition at line 115 of file IntrinsicInst.cpp.

References llvm::ValueAsMetadata::get().

◆ getForIntrinsic()

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

Definition at line 602 of file IntrinsicInst.cpp.

References isVPIntrinsic(), and llvm::Intrinsic::not_intrinsic.

◆ getFPPredicateFromMD()

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

◆ getFunctionalIntrinsicIDForVP()

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

Definition at line 538 of file IntrinsicInst.cpp.

◆ getFunctionalOpcodeForVP()

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

Definition at line 519 of file IntrinsicInst.cpp.

◆ getIntPredicateFromMD()

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

◆ isVPIntrinsic()

constexpr bool isVPIntrinsic ( Intrinsic::ID  ID)
constexpr

Definition at line 501 of file IntrinsicInst.cpp.

Referenced by getForIntrinsic().