llvm::StringRef Proc) {
25 autoProcKind =
T.isAMDGCN() ? llvm::AMDGPU::parseArchAMDGCN(Proc)
26: llvm::AMDGPU::parseArchR600(Proc);
27 if(ProcKind == llvm::AMDGPU::GK_NONE)
29 autoFeatures =
T.isAMDGCN() ? llvm::AMDGPU::getArchAttrAMDGCN(ProcKind)
30: llvm::AMDGPU::getArchAttrR600(ProcKind);
31 if(Features & llvm::AMDGPU::FEATURE_SRAMECC)
32Ret.push_back(
"sramecc");
33 if(Features & llvm::AMDGPU::FEATURE_XNACK)
34Ret.push_back(
"xnack");
40llvm::StringRef Processor) {
49llvm::StringRef Processor) {
51 returnllvm::AMDGPU::getCanonicalArchName(
T, Processor);
56llvm::StringRef TargetID) {
57 autoSplit = TargetID.split(
':');
67staticstd::optional<llvm::StringRef>
69llvm::StringMap<bool> *FeatureMap) {
70llvm::StringRef Processor;
73 returnllvm::StringRef();
75 autoSplit = TargetID.split(
':');
76Processor = Split.first;
77 if(Processor.empty())
80 autoFeatures = Split.second;
84llvm::StringMap<bool> LocalFeatureMap;
86FeatureMap = &LocalFeatureMap;
88 while(!Features.empty()) {
89 autoSplits = Features.split(
':');
90 autoSign = Splits.first.back();
91 autoFeature = Splits.first.drop_back();
92 if(Sign !=
'+'&& Sign !=
'-')
94 boolIsOn = Sign ==
'+';
96 if(!FeatureMap->try_emplace(Feature, IsOn).second)
98Features = Splits.second;
103std::optional<llvm::StringRef>
105llvm::StringMap<bool> *FeatureMap) {
106 autoOptionalProcessor =
109 if(!OptionalProcessor)
113 if(Processor.empty())
116llvm::SmallSet<llvm::StringRef, 4> AllFeatures;
118AllFeatures.insert(F);
120 for(
auto&&F : *FeatureMap)
121 if(!AllFeatures.count(F.first()))
130 constllvm::StringMap<bool> &Features) {
131std::string TargetID = Processor.str();
132std::map<const llvm::StringRef, bool> OrderedMap;
133 for(
const auto&F : Features)
134OrderedMap[F.first()] = F.second;
135 for(
const auto&F : OrderedMap)
136TargetID = TargetID +
':'+ F.first.str() + (F.second ?
"+":
"-");
143std::optional<std::pair<llvm::StringRef, llvm::StringRef>>
146llvm::StringRef TargetID;
147llvm::StringMap<bool> Features;
148Info(llvm::StringRef TargetID,
constllvm::StringMap<bool> &Features)
149: TargetID(TargetID), Features(Features) {}
151llvm::StringMap<Info> FeatureMap;
152 for(
auto&&
ID: TargetIDs) {
153llvm::StringMap<bool> Features;
155 auto[
Loc, Inserted] = FeatureMap.try_emplace(Proc,
ID, Features);
157 auto&ExistingFeatures =
Loc->second.Features;
158 if(llvm::any_of(Features, [&](
auto&F) {
159 returnExistingFeatures.count(F.first()) == 0;
161 returnstd::make_pair(
Loc->second.TargetID,
ID);
168llvm::StringMap<bool> ProvidedFeatures, RequestedFeatures;
169llvm::StringRef ProvidedProc =
171llvm::StringRef RequestedProc =
173 if(ProvidedProc != RequestedProc)
175 for(
const auto&F : ProvidedFeatures) {
176 auto Loc= RequestedFeatures.find(F.first());
179 if(
Loc== RequestedFeatures.end())
182 if(
Loc->second != F.second)
The JSON file list parser is used to communicate input to InstallAPI.
static llvm::SmallVector< llvm::StringRef, 4 > getAllPossibleAMDGPUTargetIDFeatures(const llvm::Triple &T, llvm::StringRef Proc)
std::optional< llvm::StringRef > parseTargetID(const llvm::Triple &T, llvm::StringRef OffloadArch, llvm::StringMap< bool > *FeatureMap)
Parse a target ID to get processor and feature map.
static std::optional< llvm::StringRef > parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID, llvm::StringMap< bool > *FeatureMap)
llvm::StringRef getProcessorFromTargetID(const llvm::Triple &T, llvm::StringRef OffloadArch)
Get processor name from target ID.
std::optional< std::pair< llvm::StringRef, llvm::StringRef > > getConflictTargetIDCombination(const std::set< llvm::StringRef > &TargetIDs)
Get the conflicted pair of target IDs for a compilation or a bundled code object, assuming TargetIDs ...
static llvm::StringRef getCanonicalProcessorName(const llvm::Triple &T, llvm::StringRef Processor)
Returns canonical processor name or empty string if Processor is invalid.
bool isCompatibleTargetID(llvm::StringRef Provided, llvm::StringRef Requested)
Check whether the provided target ID is compatible with the requested target ID.
llvm::SmallVector< llvm::StringRef, 4 > getAllPossibleTargetIDFeatures(const llvm::Triple &T, llvm::StringRef Processor)
Get all feature strings that can be used in target ID for Processor.
const FunctionProtoType * T
std::string getCanonicalTargetID(llvm::StringRef Processor, const llvm::StringMap< bool > &Features)
Returns canonical target ID, assuming Processor is canonical and all entries in Features are valid.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4