Go to the documentation of this file.
14 #ifndef LLVM_LIB_IR_LLVMCONTEXTIMPL_H
15 #define LLVM_LIB_IR_LLVMCONTEXTIMPL_H
57 class AttributeListImpl;
58 class AttributeSetNode;
60 struct DiagnosticHandler;
66 class LLVMRemarkStreamer;
71 template <
typename T>
class StringMapEntry;
73 class ValueHandleBase;
88 return LHS.bitwiseIsEqual(
RHS);
203 template <
class NodeTy>
205 : Ops(
N->op_begin() + Offset,
N->op_end()), Hash(
N->
getHash()) {}
207 template <
class NodeTy>
222 if (Ops.
size() !=
RHS->getNumOperands() - Offset)
274 Metadata *InlinedAt,
bool ImplicitCode)
275 : Line(Line), Column(Column),
Scope(
Scope), InlinedAt(InlinedAt),
276 ImplicitCode(ImplicitCode) {}
278 : Line(L->getLine()), Column(L->getColumn()),
Scope(L->getRawScope()),
279 InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {}
282 return Line ==
RHS->getLine() && Column ==
RHS->getColumn() &&
283 Scope ==
RHS->getRawScope() && InlinedAt ==
RHS->getRawInlinedAt() &&
284 ImplicitCode ==
RHS->isImplicitCode();
303 return Tag ==
RHS->getTag() && Header ==
RHS->getRawHeader() &&
322 : CountNode(CountNode), LowerBound(LowerBound), UpperBound(UpperBound),
325 : CountNode(
N->getRawCountNode()), LowerBound(
N->getRawLowerBound()),
326 UpperBound(
N->getRawUpperBound()), Stride(
N->getRawStride()) {}
344 return BoundsEqual(CountNode,
RHS->getRawCountNode()) &&
345 BoundsEqual(LowerBound,
RHS->getRawLowerBound()) &&
346 BoundsEqual(UpperBound,
RHS->getRawUpperBound()) &&
347 BoundsEqual(Stride,
RHS->getRawStride());
352 if (
auto *MD = dyn_cast<ConstantAsMetadata>(CountNode))
353 return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
354 LowerBound, UpperBound, Stride);
355 return hash_combine(CountNode, LowerBound, UpperBound, Stride);
367 : CountNode(CountNode), LowerBound(LowerBound), UpperBound(UpperBound),
370 : CountNode(
N->getRawCountNode()), LowerBound(
N->getRawLowerBound()),
371 UpperBound(
N->getRawUpperBound()), Stride(
N->getRawStride()) {}
374 return (CountNode ==
RHS->getRawCountNode()) &&
375 (LowerBound ==
RHS->getRawLowerBound()) &&
376 (UpperBound ==
RHS->getRawUpperBound()) &&
377 (Stride ==
RHS->getRawStride());
381 auto *MD = dyn_cast_or_null<ConstantAsMetadata>(CountNode);
383 return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
384 LowerBound, UpperBound, Stride);
385 return hash_combine(CountNode, LowerBound, UpperBound, Stride);
398 IsUnsigned(IsUnsigned) {}
401 IsUnsigned(
N->isUnsigned()) {}
404 return Value.getBitWidth() ==
RHS->getValue().getBitWidth() &&
405 Value ==
RHS->getValue() && IsUnsigned ==
RHS->isUnsigned() &&
421 uint32_t AlignInBits,
unsigned Encoding,
unsigned Flags)
422 :
Tag(
Tag),
Name(
Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
423 Encoding(Encoding), Flags(Flags) {}
426 AlignInBits(
N->getAlignInBits()), Encoding(
N->getEncoding()),
431 SizeInBits ==
RHS->getSizeInBits() &&
432 AlignInBits ==
RHS->getAlignInBits() &&
433 Encoding ==
RHS->getEncoding() && Flags ==
RHS->getFlags();
455 StringLengthExp(StringLengthExp), StringLocationExp(StringLocationExp),
456 SizeInBits(SizeInBits), AlignInBits(AlignInBits), Encoding(Encoding) {}
459 StringLength(
N->getRawStringLength()),
460 StringLengthExp(
N->getRawStringLengthExp()),
461 StringLocationExp(
N->getRawStringLocationExp()),
462 SizeInBits(
N->getSizeInBits()), AlignInBits(
N->getAlignInBits()),
463 Encoding(
N->getEncoding()) {}
467 SizeInBits ==
RHS->getSizeInBits() &&
468 AlignInBits ==
RHS->getAlignInBits() &&
469 Encoding ==
RHS->getEncoding();
496 AlignInBits(AlignInBits), DWARFAddressSpace(DWARFAddressSpace),
500 Line(
N->getLine()),
Scope(
N->getRawScope()),
501 BaseType(
N->getRawBaseType()), SizeInBits(
N->getSizeInBits()),
502 OffsetInBits(
N->getOffsetInBits()), AlignInBits(
N->getAlignInBits()),
503 DWARFAddressSpace(
N->getDWARFAddressSpace()), Flags(
N->
getFlags()),
504 ExtraData(
N->getRawExtraData()),
Annotations(
N->getRawAnnotations()) {}
508 File ==
RHS->getRawFile() && Line ==
RHS->getLine() &&
510 SizeInBits ==
RHS->getSizeInBits() &&
511 AlignInBits ==
RHS->getAlignInBits() &&
512 OffsetInBits ==
RHS->getOffsetInBits() &&
513 DWARFAddressSpace ==
RHS->getDWARFAddressSpace() &&
514 Flags ==
RHS->getFlags() && ExtraData ==
RHS->getRawExtraData() &&
522 if (
Tag == dwarf::DW_TAG_member &&
Name)
523 if (
auto *CT = dyn_cast_or_null<DICompositeType>(
Scope))
524 if (CT->getRawIdentifier())
544 return isODRMember(
LHS->getTag(),
LHS->getRawScope(),
LHS->getRawName(),
553 if (
Tag != dwarf::DW_TAG_member || !
Name)
556 auto *CT = dyn_cast_or_null<DICompositeType>(
Scope);
557 if (!CT || !CT->getRawIdentifier())
592 Metadata *Elements,
unsigned RuntimeLang,
599 AlignInBits(AlignInBits), Flags(Flags), Elements(Elements),
600 RuntimeLang(RuntimeLang), VTableHolder(VTableHolder),
601 TemplateParams(TemplateParams), Identifier(Identifier),
602 Discriminator(Discriminator), DataLocation(DataLocation),
603 Associated(Associated), Allocated(Allocated), Rank(Rank),
607 Line(
N->getLine()),
Scope(
N->getRawScope()),
608 BaseType(
N->getRawBaseType()), SizeInBits(
N->getSizeInBits()),
609 OffsetInBits(
N->getOffsetInBits()), AlignInBits(
N->getAlignInBits()),
610 Flags(
N->
getFlags()), Elements(
N->getRawElements()),
611 RuntimeLang(
N->getRuntimeLang()), VTableHolder(
N->getRawVTableHolder()),
612 TemplateParams(
N->getRawTemplateParams()),
613 Identifier(
N->getRawIdentifier()),
614 Discriminator(
N->getRawDiscriminator()),
615 DataLocation(
N->getRawDataLocation()),
616 Associated(
N->getRawAssociated()), Allocated(
N->getRawAllocated()),
617 Rank(
N->getRawRank()),
Annotations(
N->getRawAnnotations()) {}
621 File ==
RHS->getRawFile() && Line ==
RHS->getLine() &&
623 SizeInBits ==
RHS->getSizeInBits() &&
624 AlignInBits ==
RHS->getAlignInBits() &&
625 OffsetInBits ==
RHS->getOffsetInBits() && Flags ==
RHS->getFlags() &&
626 Elements ==
RHS->getRawElements() &&
627 RuntimeLang ==
RHS->getRuntimeLang() &&
628 VTableHolder ==
RHS->getRawVTableHolder() &&
629 TemplateParams ==
RHS->getRawTemplateParams() &&
630 Identifier ==
RHS->getRawIdentifier() &&
631 Discriminator ==
RHS->getRawDiscriminator() &&
632 DataLocation ==
RHS->getRawDataLocation() &&
633 Associated ==
RHS->getRawAssociated() &&
634 Allocated ==
RHS->getRawAllocated() && Rank ==
RHS->getRawRank() &&
654 : Flags(Flags), CC(CC), TypeArray(TypeArray) {}
656 : Flags(
N->
getFlags()), CC(
N->getCC()), TypeArray(
N->getRawTypeArray()) {}
659 return Flags ==
RHS->getFlags() && CC ==
RHS->getCC() &&
660 TypeArray ==
RHS->getRawTypeArray();
675 : Filename(Filename), Directory(Directory), Checksum(Checksum),
678 : Filename(
N->getRawFilename()), Directory(
N->getRawDirectory()),
679 Checksum(
N->getRawChecksum()),
Source(
N->getRawSource()) {}
682 return Filename ==
RHS->getRawFilename() &&
683 Directory ==
RHS->getRawDirectory() &&
684 Checksum ==
RHS->getRawChecksum() &&
Source ==
RHS->getRawSource();
688 return hash_combine(Filename, Directory, Checksum ? Checksum->Kind : 0,
689 Checksum ? Checksum->Value :
nullptr,
690 Source.value_or(
nullptr));
717 unsigned ScopeLine,
Metadata *ContainingType,
718 unsigned VirtualIndex,
int ThisAdjustment,
unsigned Flags,
724 Line(Line),
Type(
Type), ScopeLine(ScopeLine),
725 ContainingType(ContainingType), VirtualIndex(VirtualIndex),
726 ThisAdjustment(ThisAdjustment), Flags(Flags), SPFlags(SPFlags),
727 Unit(Unit), TemplateParams(TemplateParams), Declaration(Declaration),
728 RetainedNodes(RetainedNodes), ThrownTypes(ThrownTypes),
733 Line(
N->getLine()),
Type(
N->getRawType()), ScopeLine(
N->getScopeLine()),
734 ContainingType(
N->getRawContainingType()),
735 VirtualIndex(
N->getVirtualIndex()),
736 ThisAdjustment(
N->getThisAdjustment()), Flags(
N->
getFlags()),
737 SPFlags(
N->getSPFlags()), Unit(
N->getRawUnit()),
738 TemplateParams(
N->getRawTemplateParams()),
739 Declaration(
N->getRawDeclaration()),
740 RetainedNodes(
N->getRawRetainedNodes()),
741 ThrownTypes(
N->getRawThrownTypes()),
743 TargetFuncName(
N->getRawTargetFuncName()) {}
748 File ==
RHS->getRawFile() && Line ==
RHS->getLine() &&
749 Type ==
RHS->getRawType() && ScopeLine ==
RHS->getScopeLine() &&
750 ContainingType ==
RHS->getRawContainingType() &&
751 VirtualIndex ==
RHS->getVirtualIndex() &&
752 ThisAdjustment ==
RHS->getThisAdjustment() &&
753 Flags ==
RHS->getFlags() && SPFlags ==
RHS->getSPFlags() &&
754 Unit ==
RHS->getUnit() &&
755 TemplateParams ==
RHS->getRawTemplateParams() &&
756 Declaration ==
RHS->getRawDeclaration() &&
757 RetainedNodes ==
RHS->getRawRetainedNodes() &&
758 ThrownTypes ==
RHS->getRawThrownTypes() &&
760 TargetFuncName ==
RHS->getRawTargetFuncName();
763 bool isDefinition()
const {
return SPFlags & DISubprogram::SPFlagDefinition; }
770 if (
auto *CT = dyn_cast_or_null<DICompositeType>(
Scope))
771 if (CT->getRawIdentifier())
786 return isDeclarationOfODRMember(
LHS.isDefinition(),
LHS.Scope,
787 LHS.LinkageName,
LHS.TemplateParams,
RHS);
791 return isDeclarationOfODRMember(
LHS->isDefinition(),
LHS->getRawScope(),
792 LHS->getRawLinkageName(),
793 LHS->getRawTemplateParams(),
RHS);
806 auto *CT = dyn_cast_or_null<DICompositeType>(
Scope);
807 if (!CT || !CT->getRawIdentifier())
816 return IsDefinition ==
RHS->isDefinition() &&
Scope ==
RHS->getRawScope() &&
818 TemplateParams ==
RHS->getRawTemplateParams();
829 :
Scope(
Scope), File(File), Line(Line), Column(Column) {}
831 :
Scope(
N->getRawScope()), File(
N->getRawFile()), Line(
N->getLine()),
832 Column(
N->getColumn()) {}
835 return Scope ==
RHS->getRawScope() && File ==
RHS->getRawFile() &&
836 Line ==
RHS->getLine() && Column ==
RHS->getColumn();
850 :
Scope(
Scope), File(File), Discriminator(Discriminator) {}
852 :
Scope(
N->getRawScope()), File(
N->getRawFile()),
853 Discriminator(
N->getDiscriminator()) {}
856 return Scope ==
RHS->getRawScope() && File ==
RHS->getRawFile() &&
857 Discriminator ==
RHS->getDiscriminator();
874 ExportSymbols(
N->getExportSymbols()) {}
878 ExportSymbols ==
RHS->getExportSymbols();
895 :
Scope(
N->getRawScope()), Decl(
N->getRawDecl()),
Name(
N->getRawName()),
896 File(
N->getRawFile()), LineNo(
N->getLineNo()) {}
899 return Scope ==
RHS->getRawScope() && Decl ==
RHS->getRawDecl() &&
900 Name ==
RHS->getRawName() && File ==
RHS->getRawFile() &&
901 LineNo ==
RHS->getLineNo();
921 MDString *APINotesFile,
unsigned LineNo,
bool IsDecl)
923 ConfigurationMacros(ConfigurationMacros), IncludePath(IncludePath),
924 APINotesFile(APINotesFile), LineNo(LineNo), IsDecl(IsDecl) {}
926 : File(
N->getRawFile()),
Scope(
N->getRawScope()),
Name(
N->getRawName()),
927 ConfigurationMacros(
N->getRawConfigurationMacros()),
928 IncludePath(
N->getRawIncludePath()),
929 APINotesFile(
N->getRawAPINotesFile()), LineNo(
N->getLineNo()),
930 IsDecl(
N->getIsDecl()) {}
934 ConfigurationMacros ==
RHS->getRawConfigurationMacros() &&
935 IncludePath ==
RHS->getRawIncludePath() &&
936 APINotesFile ==
RHS->getRawAPINotesFile() &&
937 File ==
RHS->getRawFile() && LineNo ==
RHS->getLineNo() &&
938 IsDecl ==
RHS->getIsDecl();
954 :
Name(
N->getRawName()),
Type(
N->getRawType()),
955 IsDefault(
N->isDefault()) {}
959 IsDefault ==
RHS->isDefault();
977 IsDefault(
N->isDefault()),
Value(
N->getValue()) {}
981 Type ==
RHS->getRawType() && IsDefault ==
RHS->isDefault() &&
1006 bool IsLocalToUnit,
bool IsDefinition,
1010 Line(Line),
Type(
Type), IsLocalToUnit(IsLocalToUnit),
1011 IsDefinition(IsDefinition),
1012 StaticDataMemberDeclaration(StaticDataMemberDeclaration),
1013 TemplateParams(TemplateParams), AlignInBits(AlignInBits),
1018 Line(
N->getLine()),
Type(
N->getRawType()),
1019 IsLocalToUnit(
N->isLocalToUnit()), IsDefinition(
N->isDefinition()),
1020 StaticDataMemberDeclaration(
N->getRawStaticDataMemberDeclaration()),
1021 TemplateParams(
N->getRawTemplateParams()),
1022 AlignInBits(
N->getAlignInBits()),
Annotations(
N->getRawAnnotations()) {}
1027 File ==
RHS->getRawFile() && Line ==
RHS->getLine() &&
1028 Type ==
RHS->getRawType() && IsLocalToUnit ==
RHS->isLocalToUnit() &&
1029 IsDefinition ==
RHS->isDefinition() &&
1030 StaticDataMemberDeclaration ==
1031 RHS->getRawStaticDataMemberDeclaration() &&
1032 TemplateParams ==
RHS->getRawTemplateParams() &&
1033 AlignInBits ==
RHS->getAlignInBits() &&
1046 IsLocalToUnit, IsDefinition,
1068 :
Scope(
N->getRawScope()),
Name(
N->getRawName()), File(
N->getRawFile()),
1069 Line(
N->getLine()),
Type(
N->getRawType()),
Arg(
N->getArg()),
1070 Flags(
N->
getFlags()), AlignInBits(
N->getAlignInBits()),
1075 File ==
RHS->getRawFile() && Line ==
RHS->getLine() &&
1077 Flags ==
RHS->getFlags() && AlignInBits ==
RHS->getAlignInBits() &&
1102 :
Scope(
N->getRawScope()),
Name(
N->getRawName()), File(
N->getRawFile()),
1103 Line(
N->getLine()) {}
1107 File ==
RHS->getRawFile() && Line ==
RHS->getLine();
1121 return Elements ==
RHS->getElements();
1136 : Variable(
N->getRawVariable()),
Expression(
N->getRawExpression()) {}
1139 return Variable ==
RHS->getRawVariable() &&
1158 :
Name(
Name), File(File), Line(Line), GetterName(GetterName),
1161 :
Name(
N->getRawName()), File(
N->getRawFile()), Line(
N->getLine()),
1162 GetterName(
N->getRawGetterName()), SetterName(
N->getRawSetterName()),
1166 return Name ==
RHS->getRawName() && File ==
RHS->getRawFile() &&
1167 Line ==
RHS->getLine() && GetterName ==
RHS->getRawGetterName() &&
1168 SetterName ==
RHS->getRawSetterName() &&
1193 File(
N->getRawFile()), Line(
N->getLine()),
Name(
N->getRawName()),
1194 Elements(
N->getRawElements()) {}
1198 Entity ==
RHS->getRawEntity() && File ==
RHS->getFile() &&
1199 Line ==
RHS->getLine() &&
Name ==
RHS->getRawName() &&
1200 Elements ==
RHS->getRawElements();
1217 : MIType(
N->getMacinfoType()), Line(
N->getLine()),
Name(
N->getRawName()),
1218 Value(
N->getRawValue()) {}
1221 return MIType ==
RHS->getMacinfoType() && Line ==
RHS->getLine() &&
1238 : MIType(MIType), Line(Line), File(File), Elements(Elements) {}
1240 : MIType(
N->getMacinfoType()), Line(
N->getLine()), File(
N->getRawFile()),
1241 Elements(
N->getRawElements()) {}
1244 return MIType ==
RHS->getMacinfoType() && Line ==
RHS->getLine() &&
1245 File ==
RHS->getRawFile() && Elements ==
RHS->getRawElements();
1282 return KeyTy(
N).getHashValue();
1300 #define HANDLE_MDNODE_LEAF(CLASS) using CLASS##Info = MDNodeInfo<CLASS>;
1301 #include "llvm/IR/Metadata.def"
1315 bool empty()
const {
return Attachments.empty(); }
1316 size_t size()
const {
return Attachments.size(); }
1349 template <
class PredTy>
void remove_if(PredTy shouldRemove) {
1417 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
1418 DenseSet<CLASS *, CLASS##Info> CLASS##s;
1419 #include "llvm/IR/Metadata.def"
1582 #endif // LLVM_LIB_IR_LLVMCONTEXTIMPL_H
bool isDefinition() const
MDNodeKeyImpl(ArrayRef< Metadata * > Ops)
bool isKeyOf(const DITemplateValueParameter *RHS) const
static FunctionType * getTombstoneKey()
DenseMap< unsigned, IntegerType * > IntegerTypes
Metadata * TemplateParams
static unsigned getHashValue(const APFloat &Key)
ConstantUniqueMap< InlineAsm > InlineAsms
MDNodeKeyImpl(unsigned Tag, Metadata *Scope, Metadata *Entity, Metadata *File, unsigned Line, MDString *Name, Metadata *Elements)
unsigned getHashValue() const
static bool isEqual(const StructType *LHS, const StructType *RHS)
unsigned getHashValue() const
List of ValueAsMetadata, to be used as an argument to a dbg.value intrinsic.
unsigned getHashValue() const
This is an optimization pass for GlobalISel generic memory operations.
Metadata * StringLengthExp
DenseMap< std::pair< const Function *, const BasicBlock * >, BlockAddress * > BlockAddresses
bool isKeyOf(const DISubroutineType *RHS) const
unsigned getHashValue() const
unsigned getHashValue() const
static unsigned getHashValue(const FunctionType *FT)
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Line, unsigned Column)
MDNodeKeyImpl(const DISubprogram *N)
MDNodeKeyImpl(const DIArgList *N)
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
static unsigned calculateHash(MDTuple *N)
Optional< uint64_t > DiagnosticsMisExpectTolerance
The percentage of difference between profiling branch weights and.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
DenseMap< Type *, std::unique_ptr< UndefValue > > UVConstants
MDNodeKeyImpl(MDString *Name, Metadata *Type, bool IsDefault)
DenseMap< std::pair< Type *, uint64_t >, ArrayType * > ArrayTypes
bool isKeyOf(const DIImportedEntity *RHS) const
static bool isEqual(const NodeTy *LHS, const NodeTy *RHS)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MDNodeKeyImpl(const DIEnumerator *N)
void set(unsigned ID, MDNode *MD)
Set an attachment to a particular node.
String type, Fortran CHARACTER(n)
static NodeTy * getEmptyKey()
A single checksum, represented by a Kind and a Value (a string).
MDNodeKeyImpl(const DINamespace *N)
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
ArrayRef< Type * > Params
ConstantUniqueMap< ConstantExpr > ExprConstants
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, uint32_t AlignInBits, Metadata *Annotations)
static unsigned getHashValue(const KeyTy &Key)
Configuration point for MDNodeInfo::isEqual().
bool erase(unsigned ID)
Remove attachments with the given ID.
MDNodeKeyImpl(unsigned Flags, uint8_t CC, Metadata *TypeArray)
bool isKeyOf(const DIGlobalVariableExpression *RHS) const
unsigned getHashValue() const
MDNodeKeyImpl(MDString *Filename, MDString *Directory, Optional< DIFile::ChecksumInfo< MDString * >> Checksum, Optional< MDString * > Source)
MDNodeKeyImpl(unsigned Tag, MDString *Header, ArrayRef< Metadata * > DwarfOps)
bool isKeyOf(const DIBasicType *RHS) const
MDNodeKeyImpl(const DILabel *N)
MDNodeKeyImpl(const DILexicalBlock *N)
The instances of the Type class are immutable: once they are created, they are never changed.
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *StringLength, Metadata *StringLengthExp, Metadata *StringLocationExp, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding)
MDNodeKeyImpl< NodeTy > KeyTy
MDNodeKeyImpl(const DIStringType *N)
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
unsigned getHashValue() const
MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
bool isKeyOf(const DILexicalBlockFile *RHS) const
MDNodeKeyImpl(Metadata *Variable, Metadata *Expression)
bool DiagnosticsHotnessRequested
unsigned getHashValue() const
Metadata * ContainingType
AttributeList getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
DenseMap< const Value *, ValueName * > ValueNames
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams, MDString *Identifier, Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated, Metadata *Allocated, Metadata *Rank, Metadata *Annotations)
MDNodeKeyImpl(const DIMacro *N)
unsigned getHashValue() const
DenseMap< Value *, ValueAsMetadata * > ValuesAsMetadata
Class to represent array types.
MDNodeKeyImpl(const DITemplateTypeParameter *N)
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same we currently get code like const It could be done with a smaller encoding like local tee $pop5 local $pop6 WebAssembly registers are implicitly initialized to zero Explicit zeroing is therefore often redundant and could be optimized away Small indices may use smaller encodings than large indices WebAssemblyRegColoring and or WebAssemblyRegRenumbering should sort registers according to their usage frequency to maximize the usage of smaller encodings Many cases of irreducible control flow could be transformed more optimally than via the transform in WebAssemblyFixIrreducibleControlFlow cpp It may also be worthwhile to do transforms before register particularly when duplicating to allow register coloring to be aware of the duplication WebAssemblyRegStackify could use AliasAnalysis to reorder loads and stores more aggressively WebAssemblyRegStackify is currently a greedy algorithm This means that
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, Optional< unsigned > DWARFAddressSpace, unsigned Flags, Metadata *ExtraData, Metadata *Annotations)
DenseMapInfo for MDNode subclasses.
static Optional< unsigned > getTag(const TargetRegisterInfo *TRI, const MachineInstr &MI, const LoadInfo &LI)
DenseMap< const GlobalValue *, DSOLocalEquivalent * > DSOLocalEquivalents
StructTypeSet AnonStructTypes
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line)
MDString * TargetFuncName
DenseMap< const GlobalValue *, StringRef > GlobalValuePartitions
Collection of per-GlobalValue partitions used in this context.
FoldingSet< AttributeImpl > AttrsSet
bool empty() const
empty - Check if the array is empty.
MDNodeKeyImpl(const DIGenericSubrange *N)
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
std::unique_ptr< ConstantTokenNone > TheNoneToken
Annotations lets you mark points and ranges inside source code, for tests:
ArrayConstantsTy ArrayConstants
unsigned getHashValue() const
static FunctionType * getEmptyKey()
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
static bool isSubsetEqual(const DIDerivedType *LHS, const DIDerivedType *RHS)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
This is the shared class of boolean and integer constants.
An information struct used to provide DenseMap with the various necessary components for a given valu...
bool isKeyOf(const DIGenericSubrange *RHS) const
ArrayRef< ValueAsMetadata * > Args
Metadata * StaticDataMemberDeclaration
void dropTriviallyDeadConstantArrays()
Destroy the ConstantArrays if they are not used.
DenseMap< std::pair< const char *, unsigned >, unsigned > DiscriminatorTable
DiscriminatorTable - This table maps file:line locations to an integer representing the next DWARF pa...
unsigned getHashValue() const
bool isKeyOf(const DIGlobalVariable *RHS) const
bool isKeyOf(const DILexicalBlock *RHS) const
KeyTy(const ArrayRef< Type * > &E, bool P)
ValueHandlesTy ValueHandles
DenseMap< const GlobalValue *, GlobalValue::SanitizerMetadata > GlobalValueSanitizerMetadata
static bool isEqual(const FunctionType *LHS, const FunctionType *RHS)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
uint32_t getOperandBundleTagID(StringRef Tag) const
bool isKeyOf(const DIExpression *RHS) const
static bool isEqual(const KeyTy &LHS, const NodeTy *RHS)
MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride)
MDNodeKeyImpl(APInt Value, bool IsUnsigned, MDString *Name)
static NodeTy * getTombstoneKey()
(vector float) vec_cmpeq(*A, *B) C
DenseMap< Type *, std::unique_ptr< ConstantAggregateZero > > CAZConstants
unsigned getHashValue() const
Using name and line to get hash value. It should already be mostly unique.
static bool isSubsetEqual(const KeyTy &LHS, const DISubprogram *RHS)
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
MDNodeKeyImpl(const DIObjCProperty *N)
DenseMap< Type *, PointerType * > PointerTypes
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
static const fltSemantics & Bogus() LLVM_READNONE
A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.
unsigned getHashValue() const
MDNode * lookup(unsigned ID) const
Returns the first attachment with the given ID or nullptr if no such attachment exists.
DenseMap< std::pair< Type *, ElementCount >, VectorType * > VectorTypes
MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride)
Class to represent integer types.
MDNodeKeyImpl(const DIGlobalVariableExpression *N)
bool isKeyOf(const GenericDINode *RHS) const
bool isKeyOf(const DIFile *RHS) const
unsigned getHashValue() const
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
MDNodeKeyImpl(const DILocation *L)
MDNodeKeyImpl(const DICommonBlock *N)
static bool isSubsetEqual(const NodeTy *LHS, const NodeTy *RHS)
MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
MDNodeKeyImpl(const DIFile *N)
MDNodeKeyImpl(const DIBasicType *N)
bool isKeyOf(const DIDerivedType *RHS) const
bool isKeyOf(const DIMacro *RHS) const
MDNodeKeyImpl(const DIExpression *N)
Metadata * TemplateParams
StringMap< std::unique_ptr< ConstantDataSequential > > CDSConstants
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool isKeyOf(const MDTuple *RHS) const
MDNodeKeyImpl(unsigned MIType, unsigned Line, Metadata *File, Metadata *Elements)
bool RespectDiagnosticFilters
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
MDNodeKeyImpl(const DISubrange *N)
unsigned getHashValue() const
StringMap< uint32_t > BundleTagCache
A set of interned tags for operand bundles.
Base class of all SIMD vector types.
DenseMap< const Value *, MDAttachments > ValueMetadata
Collection of metadata used in this context.
static unsigned getHashValue(const NodeTy *N)
unsigned getHashValue() const
static StructType * getEmptyKey()
unsigned getHashValue() const
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Metadata * TemplateParams
void setOpaquePointers(bool OP)
DenseMap< PointerType *, std::unique_ptr< ConstantPointerNull > > CPNConstants
llvm::Any TargetDataStorage
ConstantInt * TheFalseVal
MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt, bool ImplicitCode)
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Discriminator)
Allocate memory in an ever growing pool, as if by bump-pointer.
This is an important class for using LLVM in a threaded context.
static bool isEqual(const KeyTy &LHS, const FunctionType *RHS)
MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, unsigned Flags)
unsigned NamedStructTypesUniqueID
Multimap-like storage for metadata attachments.
Optional< MDString * > Source
DenseMap< const GlobalObject *, StringRef > GlobalObjectSections
Collection of per-GlobalObject sections used in this context.
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *Type, bool IsDefault, Metadata *Value)
An imported module (C++ using directive or similar).
Class to represent pointers.
MDNodeKeyImpl(const DIModule *N)
unsigned getHashValue() const
static StructType * getTombstoneKey()
Optional< DIFile::ChecksumInfo< MDString * > > Checksum
Structure for hashing arbitrary MDNode operands.
unsigned getHashValue() const
bool hasOpaquePointersValue()
static bool isEqual(const KeyTy &LHS, const StructType *RHS)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::unique_ptr< DiagnosticHandler > DiagHandler
MDNodeKeyImpl(const DICompositeType *N)
FoldingSet< AttributeListImpl > AttrsLists
@ BasicBlock
Various leaf nodes.
unsigned getHashValue() const
LLVMContext::YieldCallbackTy YieldCallback
KeyTy(const FunctionType *FT)
Basic type, like 'int' or 'float'.
static bool isODRMember(unsigned Tag, const Metadata *Scope, const MDString *Name, const DIDerivedType *RHS)
Subprograms compare equal if they declare the same function in an ODR type.
Class for arbitrary precision integers.
Type array for a subprogram.
void insert(unsigned ID, MDNode &MD)
Adds an attachment to a particular node.
Class representing an expression and its matching format.
The address of a basic block.
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
void remove_if(PredTy shouldRemove)
Erase matching attachments.
MDNodeKeyImpl(const DIImportedEntity *N)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
StringMap< MDString, BumpPtrAllocator > MDStringCache
This compiles xmm1 mulss xmm1 xorps xmm0 movss xmm0 ret Because mulss doesn t modify the top elements
bool isKeyOf(const DICompositeType *RHS) const
Class to represent struct types.
StringRef - Represent a constant reference to a string, i.e.
MDNodeKeyImpl(const DISubroutineType *N)
bool isKeyOf(const DIMacroFile *RHS) const
MDNodeKeyImpl(ArrayRef< uint64_t > Elements)
bool operator==(const KeyTy &that) const
StructConstantsTy StructConstants
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
bool isKeyOf(const DILabel *RHS) const
MDNodeOpsKey(ArrayRef< Metadata * > Ops)
DenseMap< Type *, std::unique_ptr< PoisonValue > > PVConstants
Generic tagged DWARF-like metadata node.
MDNodeKeyImpl(const DIDerivedType *N)
int64_t getSExtValue() const
Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the ...
unsigned getHashValue() const
bool operator!=(const KeyTy &that) const
MDNodeKeyImpl(const DILexicalBlockFile *N)
MDNodeOpsKey(const NodeTy *N, unsigned Offset=0)
unsigned getHashValue() const
unsigned getHashValue() const
MDNodeKeyImpl(const DIMacroFile *N)
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
bool isKeyOf(const DIObjCProperty *RHS) const
MDNodeKeyImpl(const DITemplateValueParameter *N)
bool MisExpectWarningRequested
bool isKeyOf(const DICommonBlock *RHS) const
static uint32_t getFlags(const Symbol *Sym)
KeyTy(const StructType *ST)
MDNodeKeyImpl(const DILocalVariable *N)
bool operator==(const KeyTy &that) const
bool isKeyOf(const DIArgList *RHS) const
static APFloat getEmptyKey()
unsigned getHashValue() const
static APFloat getTombstoneKey()
bool operator!=(const KeyTy &that) const
Optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
FoldingSet< AttributeSetNode > AttrsSetNodes
unsigned getHashValue() const
static unsigned calculateHash(GenericDINode *N)
DenseMap< std::pair< Type *, unsigned >, PointerType * > ASPointerTypes
static unsigned getHashValue(const KeyTy &Key)
MDNodeKeyImpl(Metadata *File, Metadata *Scope, MDString *Name, MDString *ConfigurationMacros, MDString *IncludePath, MDString *APINotesFile, unsigned LineNo, bool IsDecl)
bool isKeyOf(const DILocation *RHS) const
A pair of DIGlobalVariable and DIExpression.
static unsigned getHashValue(const StructType *ST)
DenseMap< Metadata *, MetadataAsValue * > MetadataAsValues
static bool isSubsetEqual(const KeyTy &LHS, const NodeTy *RHS)
Metadata * StringLocationExp
ArrayRef< Type * > ETypes
Optional< unsigned > DWARFAddressSpace
KeyTy(const Type *R, const ArrayRef< Type * > &P, bool V)
void getAll(SmallVectorImpl< std::pair< unsigned, MDNode * >> &Result) const
Appends all attachments for the global to Result, sorting by attachment ID.
static bool isSubsetEqual(const DISubprogram *LHS, const DISubprogram *RHS)
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
bool isKeyOf(const DIStringType *RHS) const
MDNodeKeyImpl(const GenericDINode *N)
bool isKeyOf(const DISubrange *RHS) const
bool isKeyOf(const DITemplateTypeParameter *RHS) const
static bool isSubsetEqual(const KeyTy &LHS, const DIDerivedType *RHS)
MDNodeKeyImpl(const DIGlobalVariable *N)
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
static bool isDeclarationOfODRMember(bool IsDefinition, const Metadata *Scope, const MDString *LinkageName, const Metadata *TemplateParams, const DISubprogram *RHS)
Subprograms compare equal if they declare the same function in an ODR type.
size_t size() const
size - Get the array size.
unsigned getHashValue() const
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
StringMap< SyncScope::ID > SSC
A set of interned synchronization scopes.
unsigned getHashValue() const
bool isKeyOf(const DILocalVariable *RHS) const
VectorConstantsTy VectorConstants
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool compareOps(const NodeTy *RHS, unsigned Offset=0) const
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
ArrayRef< uint64_t > Elements
static unsigned calculateHash(MDNode *N, unsigned Offset=0)
unsigned getHashValue() const
MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
MDNodeKeyImpl(ArrayRef< ValueAsMetadata * > Args)
bool isKeyOf(const DISubprogram *RHS) const
std::vector< MDNode * > DistinctMDNodes
bool isKeyOf(const DINamespace *RHS) const
MDNodeKeyImpl(const MDTuple *N)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
unsigned getHashValue() const
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, unsigned ScopeLine, Metadata *ContainingType, unsigned VirtualIndex, int ThisAdjustment, unsigned Flags, unsigned SPFlags, Metadata *Unit, Metadata *TemplateParams, Metadata *Declaration, Metadata *RetainedNodes, Metadata *ThrownTypes, Metadata *Annotations, MDString *TargetFuncName)
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
static unsigned getHashValue(const KeyTy &Key)
DenseMap< const GlobalValue *, NoCFIValue * > NoCFIValues
MDNodeKeyImpl(Metadata *Scope, Metadata *Decl, MDString *Name, Metadata *File, unsigned LineNo)
bool isKeyOf(const DIEnumerator *RHS) const
StringMap< StructType * > NamedStructTypes
MDString * ConfigurationMacros
unsigned getHashValue() const
void get(unsigned ID, SmallVectorImpl< MDNode * > &Result) const
Appends all attachments with the given ID to Result in insertion order.
LLVM Value Representation.
bool isKeyOf(const DIModule *RHS) const
LLVMContextImpl(LLVMContext &C)
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition, Metadata *StaticDataMemberDeclaration, Metadata *TemplateParams, uint32_t AlignInBits, Metadata *Annotations)
FunctionTypeSet FunctionTypes
MDNodeKeyImpl(MDString *Name, Metadata *File, unsigned Line, MDString *GetterName, MDString *SetterName, unsigned Attributes, Metadata *Type)
Class to represent function types.
static bool isEqual(const APFloat &LHS, const APFloat &RHS)