41 if (AllowNullOp && !Op)
45 if (
auto *V = dyn_cast<ValueAsMetadata>(MD))
55 return Fragment->SizeInBits;
71 const char *
const *Low = NameTable.
begin();
72 const char *
const *
High = NameTable.
end();
73 const char *
const *LastLow = Low;
74 while (CmpEnd < Name.
size() && High - Low > 0) {
75 size_t CmpStart = CmpEnd;
76 CmpEnd = Name.
find(
'.', CmpStart + 1);
78 auto Cmp = [CmpStart, CmpEnd](
const char *LHS,
const char *RHS) {
79 return strncmp(LHS + CmpStart, RHS + CmpStart, CmpEnd - CmpStart) < 0;
82 std::tie(Low, High) = std::equal_range(Low, High, Name.
data(), Cmp);
87 if (LastLow == NameTable.
end())
90 if (Name == NameFound ||
92 return LastLow - NameTable.
begin();
109 if (!MD || !isa<MDString>(MD))
119 if (!MD || !isa<MDString>(MD))
128 if (!MD || !isa<MDString>(MD))
152 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 153 case Intrinsic::INTRINSIC: \ 155 #include "llvm/IR/ConstrainedOps.def" 163 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 164 case Intrinsic::INTRINSIC: \ 166 #include "llvm/IR/ConstrainedOps.def" 172 #define INSTRUCTION(NAME, NARGS, ROUND_MODE, INTRINSIC, DAGN) \ 173 case Intrinsic::INTRINSIC: 174 #include "llvm/IR/ConstrainedOps.def" 183 case Intrinsic::uadd_with_overflow:
184 case Intrinsic::sadd_with_overflow:
185 case Intrinsic::uadd_sat:
186 case Intrinsic::sadd_sat:
188 case Intrinsic::usub_with_overflow:
189 case Intrinsic::ssub_with_overflow:
190 case Intrinsic::usub_sat:
191 case Intrinsic::ssub_sat:
192 return Instruction::Sub;
193 case Intrinsic::umul_with_overflow:
194 case Intrinsic::smul_with_overflow:
195 return Instruction::Mul;
203 case Intrinsic::sadd_with_overflow:
204 case Intrinsic::ssub_with_overflow:
205 case Intrinsic::smul_with_overflow:
206 case Intrinsic::sadd_sat:
207 case Intrinsic::ssub_sat:
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
0 1 0 0 True if ordered and less than
1 1 1 0 True if unordered or not equal
static IntegerType * getInt64Ty(LLVMContext &C)
unsigned getNoWrapKind() const
Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
FCmpInst::Predicate getPredicate() const
StringSwitch & Case(StringLiteral S, T Value)
Optional< uint64_t > getFragmentSizeInBits() const
Get the size (in bits) of the variable, or fragment of the variable that is described.
Value * getArgOperand(unsigned i) const
1 0 0 1 True if unordered or equal
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
LLVMContext & getContext() const
Get the global data context.
LLVM_NODISCARD R Default(T Value)
0 1 0 1 True if ordered and less than or equal
Optional< fp::RoundingMode > StrToRoundingMode(StringRef)
Returns a valid RoundingMode enumerator when given a string that is valid as input in constrained int...
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_NODISCARD size_t size() const
size - Get the string size.
A switch()-like statement whose cases are string literals.
Optional< fp::ExceptionBehavior > getExceptionBehavior() const
Optional< fp::ExceptionBehavior > StrToExceptionBehavior(StringRef)
Returns a valid ExceptionBehavior enumerator when given a string valid as input in constrained intrin...
This is an important class for using LLVM in a threaded context.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isSigned() const
Whether the intrinsic is signed or unsigned.
DIExpression * getExpression() const
LLVM_NODISCARD size_t find(char C, size_t From=0) const
Search for the first character C in the string.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
0 1 1 1 True if ordered (no nans)
static bool classof(const IntrinsicInst *I)
1 1 0 1 True if unordered, less than, or equal
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
0 0 1 0 True if ordered and greater than
unsigned getNumOperands() const
Optional< uint64_t > getSizeInBits() const
Determines the size of the variable's type.
1 1 0 0 True if unordered or less than
Module.h This file contains the declarations for the Module class.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Optional< fp::RoundingMode > getRoundingMode() const
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
Value * getVariableLocation(bool AllowNullOp=true) const
Get the location corresponding to the variable referenced by the debug info intrinsic.
unsigned getNumArgOperands() const
Instruction::BinaryOps getBinaryOp() const
Returns the binary operation underlying the intrinsic.
0 1 1 0 True if ordered and operands are unequal
DILocalVariable * getVariable() const
1 0 1 0 True if unordered or greater than
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
0 0 0 1 True if ordered and equal
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
static bool classof(const IntrinsicInst *I)
StringRef - Represent a constant reference to a string, i.e.
int lookupLLVMIntrinsicByName(ArrayRef< const char *> NameTable, StringRef Name)
Looks up Name in NameTable via binary search.
0 0 1 1 True if ordered and greater than or equal
A wrapper class for inspecting calls to intrinsic functions.