Skip to content

[BOLT] Match blocks with pseudo probes #99891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 65 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5a5991a
[𝘀𝗽𝗿] initial version
shawbyoung Jul 22, 2024
94ffb45
[𝘀𝗽𝗿] changes to main this commit is based on
aaupov Jul 22, 2024
0274f69
Changed assignment of profiles with pseudo probe index
shawbyoung Jul 22, 2024
7e3d8d6
Edit test and assert
shawbyoung Jul 22, 2024
780a07e
Fixed failing asserts, pruned prospective pseudo probes for matching
shawbyoung Jul 23, 2024
1638ac1
Added logging for pseudo probe block matching
shawbyoung Jul 23, 2024
144716b
Changed pseudo probe matching failure logging to v=3
shawbyoung Jul 23, 2024
2934710
More loggin
shawbyoung Jul 23, 2024
b74fc8b
Logging blocks matched with opcodes
shawbyoung Jul 23, 2024
c38fb98
Updated test
shawbyoung Jul 23, 2024
b2a3ca7
Name changes in prep for inlined block pseudo probe block matching
shawbyoung Jul 23, 2024
2eb7bf2
Rm unnecessary Blocks vec in StaleMatcher
shawbyoung Jul 24, 2024
212bd00
Improved matched block counting
shawbyoung Jul 24, 2024
eb6dfb9
Removed comment from test
shawbyoung Jul 24, 2024
16b5cfb
Added comments and check for null YamlBFGUID in StaleMatcher before P…
shawbyoung Jul 24, 2024
799f20c
Omitting braces in one line if
shawbyoung Jul 24, 2024
1e9af7f
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Jul 24, 2024
e3599d4
Pseudo probe matching now is triggered by flag
shawbyoung Jul 24, 2024
33f1b2a
Omit unnecessary braces
shawbyoung Jul 24, 2024
9889f89
Change initialization of index -> probe and probe -> block mappings
shawbyoung Jul 24, 2024
022c517
Formatting
shawbyoung Jul 24, 2024
5109893
Comments
shawbyoung Jul 24, 2024
5bf4220
Changed std ADTs to LLVM
shawbyoung Jul 24, 2024
f1179b1
In matchWithPseudoProbe, hoist BlocksPseudoProbes.size(), added loggi…
shawbyoung Jul 24, 2024
5076bab
A more beautiful helper function for matchWithPseudoProbes
shawbyoung Jul 24, 2024
4f2f642
Added inlined block pseudo probe matching
shawbyoung Jul 25, 2024
327eb81
Added flag to trigger pseudo probe block matching
shawbyoung Jul 25, 2024
37793aa
Added flag for pseudo probe block matching
shawbyoung Jul 25, 2024
ba00b22
Set flag init val, changed std::string to StringRef
shawbyoung Jul 25, 2024
5e47249
[BOLT][NFC] Add timers for MetadataManager invocations
aaupov Aug 1, 2024
3902eff
[MC][NFC] Count pseudo probes and function records
aaupov Aug 26, 2024
d20d4d6
[MC][NFC] Drop unused MCDecodedPseudoProbeInlineTree::ChildrenToProce…
aaupov Jul 25, 2024
a857d32
[profgen][NFC] Pass parameter as const_ref
aaupov Aug 11, 2024
cddea6a
[MC][NFC] Statically allocate storage for decoded pseudo probes and f…
aaupov Aug 26, 2024
9746055
[MC][profgen][NFC] Expand auto for MCDecodedPseudoProbe
aaupov Aug 11, 2024
3dcef48
[MC][NFC] Reduce Address2ProbesMap size
aaupov Aug 26, 2024
ba149d9
[MC][NFC] Use vector for GUIDProbeFunctionMap
aaupov Aug 26, 2024
c35e8ac
buildAddress2ProbeMap timers
aaupov Jul 30, 2024
1c469cf
[BOLT][NFC] Rename profile-use-pseudo-probes
aaupov Aug 27, 2024
97f8101
[BOLT][NFCI] Strip suffix in getLTOCommonName
aaupov Aug 27, 2024
e0a705e
[BOLT] Only parse probes for profiled functions in profile-write-pseu…
aaupov Aug 26, 2024
66fe5d5
[BOLT] Add pseudo probe inline tree to YAML profile
aaupov Aug 31, 2024
36197b1
Reworked block probe matching
aaupov Aug 28, 2024
bfa0afc
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 4, 2024
0f455d0
rebase
aaupov Sep 4, 2024
8fafc04
drop logIf
aaupov Sep 4, 2024
b1be6e6
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 10, 2024
4c5156c
Use new profile probe encoding
aaupov Sep 10, 2024
205c79c
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 10, 2024
544a6ad
Test fix
aaupov Sep 10, 2024
ee214d5
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 11, 2024
0bb4e3a
Memoize top-level GUID->InlineTree mapping, cuts inference time by ~30%
aaupov Sep 11, 2024
880bd37
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 11, 2024
2ba5591
clang-format
aaupov Sep 11, 2024
75d6229
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 12, 2024
3b4e3f4
Update with #107137 changes
aaupov Sep 12, 2024
41e1fa0
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 12, 2024
7ee82b6
Move matchInlineTrees into InlineTreeNodeMapTy
aaupov Sep 12, 2024
648f2bb
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Sep 26, 2024
e8e1cb9
Add test with inline trees, address comments
aaupov Sep 26, 2024
ebd3acf
Allow null block participate in majority vote, improves run-time perf…
aaupov Sep 26, 2024
c84de42
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Nov 8, 2024
e7bce6d
address comments
aaupov Nov 8, 2024
2502434
[𝘀𝗽𝗿] changes introduced through rebase
aaupov Nov 8, 2024
956bcf2
rebase
aaupov Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 136 additions & 13 deletions bolt/lib/Profile/StaleProfileMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace opts {

extern cl::opt<bool> TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
extern cl::opt<unsigned> Verbosity;

cl::opt<bool>
InferStaleProfile("infer-stale-profile",
Expand Down Expand Up @@ -194,7 +195,13 @@ class StaleMatcher {
/// Initialize stale matcher.
void init(const std::vector<FlowBlock *> &Blocks,
const std::vector<BlendedBlockHash> &Hashes,
const std::vector<uint64_t> &CallHashes) {
const std::vector<uint64_t> &CallHashes,
const std::unordered_map<uint64_t,
std::vector<const MCDecodedPseudoProbe *>>
&IndexToBinaryPseudoProbes,
const std::unordered_map<const MCDecodedPseudoProbe *, FlowBlock *>
&BinaryPseudoProbeToBlock,
const uint64_t YamlBFGUID) {
assert(Blocks.size() == Hashes.size() &&
Hashes.size() == CallHashes.size() &&
"incorrect matcher initialization");
Expand All @@ -205,14 +212,21 @@ class StaleMatcher {
if (CallHashes[I])
CallHashToBlocks[CallHashes[I]].push_back(
std::make_pair(Hashes[I], Block));
this->Blocks.push_back(Block);
}
this->IndexToBinaryPseudoProbes = IndexToBinaryPseudoProbes;
this->BinaryPseudoProbeToBlock = BinaryPseudoProbeToBlock;
this->YamlBFGUID = YamlBFGUID;
}

/// Find the most similar block for a given hash.
const FlowBlock *matchBlock(BlendedBlockHash BlendedHash,
uint64_t CallHash) const {
const FlowBlock *matchBlock(
BlendedBlockHash BlendedHash, uint64_t CallHash,
const std::vector<yaml::bolt::PseudoProbeInfo> &PseudoProbes) const {
const FlowBlock *BestBlock = matchWithOpcodes(BlendedHash);
return BestBlock ? BestBlock : matchWithCalls(BlendedHash, CallHash);
BestBlock = BestBlock ? BestBlock : matchWithCalls(BlendedHash, CallHash);
return BestBlock || !YamlBFGUID ? BestBlock
: matchWithPseudoProbes(PseudoProbes);
}

/// Returns true if the two basic blocks (in the binary and in the profile)
Expand All @@ -227,6 +241,14 @@ class StaleMatcher {
using HashBlockPairType = std::pair<BlendedBlockHash, FlowBlock *>;
std::unordered_map<uint16_t, std::vector<HashBlockPairType>> OpHashToBlocks;
std::unordered_map<uint64_t, std::vector<HashBlockPairType>> CallHashToBlocks;
std::unordered_map<uint64_t, std::vector<const MCDecodedPseudoProbe *>>
IndexToBinaryPseudoProbes;
std::unordered_map<const MCDecodedPseudoProbe *, FlowBlock *>
BinaryPseudoProbeToBlock;
std::vector<const FlowBlock *> Blocks;
// If the pseudo probe checksums of the profiled and binary functions are
// equal, then the YamlBF's GUID is defined and used to match blocks.
uint64_t YamlBFGUID;

// Uses OpcodeHash to find the most similar block for a given hash.
const FlowBlock *matchWithOpcodes(BlendedBlockHash BlendedHash) const {
Expand Down Expand Up @@ -266,6 +288,65 @@ class StaleMatcher {
}
return BestBlock;
}
// Uses pseudo probe information to attach the profile to the appropriate
// block.
const FlowBlock *matchWithPseudoProbes(
const std::vector<yaml::bolt::PseudoProbeInfo> &PseudoProbes) const {
// Searches for the pseudo probe attached to the matched function's block,
// ignoring pseudo probes attached to function calls and inlined functions'
// blocks.
if (opts::Verbosity >= 2)
outs() << "BOLT-INFO: attempting to match block with pseudo probes\n";

std::vector<const yaml::bolt::PseudoProbeInfo *> BlockPseudoProbes;
for (const auto &PseudoProbe : PseudoProbes) {
// Ensures that pseudo probe information belongs to the appropriate
// function and not an inlined function.
if (PseudoProbe.GUID != YamlBFGUID)
continue;
// Skips pseudo probes attached to function calls.
if (PseudoProbe.Type != static_cast<uint8_t>(PseudoProbeType::Block))
continue;

BlockPseudoProbes.push_back(&PseudoProbe);
}
// Returns nullptr if there is not a 1:1 mapping of the yaml block pseudo
// probe and binary pseudo probe.
if (BlockPseudoProbes.size() == 0) {
if (opts::Verbosity >= 2)
errs() << "BOLT-WARNING: no pseudo probes in profile block\n";
return nullptr;
}
if (BlockPseudoProbes.size() > 1) {
if (opts::Verbosity >= 2)
errs() << "BOLT-WARNING: more than 1 pseudo probes in profile block\n";
return nullptr;
}
uint64_t Index = BlockPseudoProbes[0]->Index;
if (Index > Blocks.size()) {
if (opts::Verbosity >= 2)
errs() << "BOLT-WARNING: invalid index block pseudo probe index\n";
return nullptr;
}
auto It = IndexToBinaryPseudoProbes.find(Index);
if (It == IndexToBinaryPseudoProbes.end()) {
if (opts::Verbosity >= 2)
errs() << "BOLT-WARNING: no block pseudo probes found within binary "
"block at index\n";
return nullptr;
}
if (It->second.size() > 1) {
if (opts::Verbosity >= 2)
errs() << "BOLT-WARNING: more than 1 block pseudo probes in binary "
"block at index\n";
return nullptr;
}
const MCDecodedPseudoProbe *BinaryPseudoProbe = It->second[0];
auto BinaryPseudoProbeIt = BinaryPseudoProbeToBlock.find(BinaryPseudoProbe);
assert(BinaryPseudoProbeIt != BinaryPseudoProbeToBlock.end() &&
"All binary pseudo probes should belong a binary basic block");
return BinaryPseudoProbeIt->second;
}
};

void BinaryFunction::computeBlockHashes(HashFunction HashFunction) const {
Expand Down Expand Up @@ -447,18 +528,22 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// of the basic blocks in the binary, the count is "matched" to the block.
/// Similarly, if both the source and the target of a count in the profile are
/// matched to a jump in the binary, the count is recorded in CFG.
size_t
matchWeightsByHashes(BinaryContext &BC,
const BinaryFunction::BasicBlockOrderType &BlockOrder,
const yaml::bolt::BinaryFunctionProfile &YamlBF,
FlowFunction &Func, HashFunction HashFunction,
YAMLProfileReader::ProfileLookupMap &IdToYamlBF) {
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
const yaml::bolt::BinaryFunctionProfile &YamlBF, FlowFunction &Func,
HashFunction HashFunction, YAMLProfileReader::ProfileLookupMap &IdToYamlBF,
const BinaryFunction &BF) {

assert(Func.Blocks.size() == BlockOrder.size() + 2);

std::vector<uint64_t> CallHashes;
std::vector<FlowBlock *> Blocks;
std::vector<BlendedBlockHash> BlendedHashes;
std::unordered_map<uint64_t, std::vector<const MCDecodedPseudoProbe *>>
IndexToBinaryPseudoProbes;
std::unordered_map<const MCDecodedPseudoProbe *, FlowBlock *>
BinaryPseudoProbeToBlock;
const MCPseudoProbeDecoder *PseudoProbeDecoder = BC.getPseudoProbeDecoder();
for (uint64_t I = 0; I < BlockOrder.size(); I++) {
const BinaryBasicBlock *BB = BlockOrder[I];
assert(BB->getHash() != 0 && "empty hash of BinaryBasicBlock");
Expand All @@ -478,11 +563,49 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
if (PseudoProbeDecoder) {
const AddressProbesMap &ProbeMap =
PseudoProbeDecoder->getAddress2ProbesMap();
const uint64_t FuncAddr = BF.getAddress();
const std::pair<uint64_t, uint64_t> &BlockRange =
BB->getInputAddressRange();
const auto &BlockProbes =
llvm::make_range(ProbeMap.lower_bound(FuncAddr + BlockRange.first),
ProbeMap.lower_bound(FuncAddr + BlockRange.second));
for (const auto &[_, Probes] : BlockProbes) {
for (const MCDecodedPseudoProbe &Probe : Probes) {
if (Probe.getInlineTreeNode()->hasInlineSite())
continue;
if (Probe.getType() != static_cast<uint8_t>(PseudoProbeType::Block))
continue;
IndexToBinaryPseudoProbes[Probe.getIndex()].push_back(&Probe);
BinaryPseudoProbeToBlock[&Probe] = Blocks[I];
}
}
}

LLVM_DEBUG(dbgs() << "BB with index " << I << " has hash = "
<< Twine::utohexstr(BB->getHash()) << "\n");
}

uint64_t BFPseudoProbeDescHash = 0;
if (BF.getGUID() != 0) {
assert(PseudoProbeDecoder &&
"If BF has pseudo probe, BC should have a pseudo probe decoder");
auto &GUID2FuncDescMap = PseudoProbeDecoder->getGUID2FuncDescMap();
auto It = GUID2FuncDescMap.find(BF.getGUID());
if (It != GUID2FuncDescMap.end())
BFPseudoProbeDescHash = It->second.FuncHash;
}
uint64_t YamlBFGUID =
BFPseudoProbeDescHash && YamlBF.PseudoProbeDescHash &&
BFPseudoProbeDescHash == YamlBF.PseudoProbeDescHash
? static_cast<uint64_t>(YamlBF.GUID)
: 0;

StaleMatcher Matcher;
Matcher.init(Blocks, BlendedHashes, CallHashes);
Matcher.init(Blocks, BlendedHashes, CallHashes, IndexToBinaryPseudoProbes,
BinaryPseudoProbeToBlock, YamlBFGUID);

// Index in yaml profile => corresponding (matched) block
DenseMap<uint64_t, const FlowBlock *> MatchedBlocks;
Expand All @@ -502,7 +625,7 @@ matchWeightsByHashes(BinaryContext &BC,
else
llvm_unreachable("Unhandled HashFunction");
}
MatchedBlock = Matcher.matchBlock(YamlHash, CallHash);
MatchedBlock = Matcher.matchBlock(YamlHash, CallHash, YamlBB.PseudoProbes);
if (MatchedBlock == nullptr && YamlBB.Index == 0)
MatchedBlock = Blocks[0];
if (MatchedBlock != nullptr) {
Expand Down Expand Up @@ -828,7 +951,7 @@ bool YAMLProfileReader::inferStaleProfile(
// Match as many block/jump counts from the stale profile as possible
size_t MatchedBlocks =
matchWeightsByHashes(BF.getBinaryContext(), BlockOrder, YamlBF, Func,
YamlBP.Header.HashFunction, IdToYamLBF);
YamlBP.Header.HashFunction, IdToYamLBF, BF);

// Adjust the flow function by marking unreachable blocks Unlikely so that
// they don't get any counts assigned.
Expand Down
62 changes: 62 additions & 0 deletions bolt/test/X86/match-blocks-with-pseudo-probes.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Tests stale block matching with pseudo probes.

# REQUIRES: system-linux
# RUN: split-file %s %t
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: llvm-bolt %t.exe -o %t.out --data %t/yaml -v=2 \
# RUN: --print-cfg --funcs=main --profile-ignore-hash=0 --infer-stale-profile 2>&1 | FileCheck %s

# CHECK: BOLT-INFO: matched 0 functions with similar names

#--- main.s
.text
.globl main # -- Begin function main
.p2align 4, 0x90
.type main,@function
main: # @main
# %bb.0:
pushq %rbp
movq %rsp, %rbp
movl $0, -4(%rbp)
.pseudoprobe 15822663052811949562 1 0 0 main
xorl %eax, %eax
popq %rbp
retq
.Lfunc_end0:
.size main, .Lfunc_end0-main
# -- End function
.section .pseudo_probe_desc,"",@progbits
.quad -2624081020897602054
.quad 4294967295
.byte 4
.ascii "main"
.ident "clang version 17.0.6 (CentOS 17.0.6-5.el9)"
.section ".note.GNU-stack","",@progbits
.addrsig

#--- yaml
---
header:
profile-version: 1
binary-name: 'match-blocks-with-pseudo-probes.s.tmp.exe'
binary-build-id: '<unknown>'
profile-flags: [ lbr ]
profile-origin: branch profile reader
profile-events: ''
dfs-order: false
hash-func: xxh3
functions:
- name: main
fid: 0
hash: 0x0000000000000001
exec: 1
nblocks: 6
guid: 0xDB956436E78DD5FA
pseudo_probe_desc_hash: 4294967295 #lookup in code in a second
blocks:
- bid: 1
hash: 0x0000000000000001
insns: 1
succ: [ { bid: 3, cnt: 1} ]
pseudo_probes: [ { guid: 0xDB956436E78DD5FA, id: 1, type: 0 } ]
2 changes: 0 additions & 2 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ C++2c Feature Support

- Implemented `P2963R3 Ordering of constraints involving fold expressions <https://wg21.link/P2963R3>`_.

- Implemented `P3034R1 Module Declarations Shouldn’t be Macros <https://wg21.link/P3034R1>`_.


Resolutions to C++ Defect Reports
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ def PatchableFunctionEntry
: InheritableAttr,
TargetSpecificAttr<TargetArch<
["aarch64", "aarch64_be", "loongarch32", "loongarch64", "riscv32",
"riscv64", "x86", "x86_64"]>> {
"riscv64", "x86", "x86_64", "ppc", "ppc64"]>> {
let Spellings = [GCC<"patchable_function_entry">];
let Subjects = SubjectList<[Function, ObjCMethod]>;
let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>];
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -5800,7 +5800,8 @@ takes precedence over the command line option ``-fpatchable-function-entry=N,M``
``M`` defaults to 0 if omitted.

This attribute is only supported on
aarch64/aarch64-be/loongarch32/loongarch64/riscv32/riscv64/i386/x86-64 targets.
aarch64/aarch64-be/loongarch32/loongarch64/riscv32/riscv64/i386/x86-64/ppc/ppc64 targets.
For ppc/ppc64 targets, AIX is still not supported.
}];
}

Expand Down
5 changes: 0 additions & 5 deletions clang/include/clang/Basic/DiagnosticLexKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -952,11 +952,6 @@ def warn_module_conflict : Warning<
InGroup<ModuleConflict>;

// C++20 modules
def err_module_decl_cannot_be_macros : Error<
"the module name in a module%select{| partition}0 declaration cannot contain "
"an object-like macro %1">;
def err_unxepected_paren_in_module_decl : Error<
"unexpected '(' after the module name in a module%select{| partition}0 declaration">;
def err_header_import_semi_in_macro : Error<
"semicolon terminating header import declaration cannot be produced "
"by a macro">;
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -3492,7 +3492,7 @@ def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "

def err_attr_codemodel_arg : Error<"code model '%0' is not supported on this target">;

def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
def err_aix_attr_unsupported : Error<"%0 attribute is not yet supported on AIX">;

def err_tls_var_aligned_over_maximum : Error<
"alignment (%0) of thread-local variable %1 is greater than the maximum supported "
Expand Down
24 changes: 3 additions & 21 deletions clang/include/clang/Basic/IdentifierTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
LLVM_PREFERRED_TYPE(bool)
unsigned IsModulesImport : 1;

// True if this is the 'module' contextual keyword.
LLVM_PREFERRED_TYPE(bool)
unsigned IsModulesDecl : 1;

// True if this is a mangled OpenMP variant name.
LLVM_PREFERRED_TYPE(bool)
unsigned IsMangledOpenMPVariantName : 1;
Expand All @@ -200,7 +196,7 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
LLVM_PREFERRED_TYPE(bool)
unsigned IsFinal : 1;

// 21 bits left in a 64-bit word.
// 22 bits left in a 64-bit word.

// Managed by the language front-end.
void *FETokenInfo = nullptr;
Expand All @@ -216,8 +212,8 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
IsCPPOperatorKeyword(false), NeedsHandleIdentifier(false),
IsFromAST(false), ChangedAfterLoad(false), FEChangedAfterLoad(false),
RevertedTokenID(false), OutOfDate(false), IsModulesImport(false),
IsModulesDecl(false), IsMangledOpenMPVariantName(false),
IsDeprecatedMacro(false), IsRestrictExpansion(false), IsFinal(false) {}
IsMangledOpenMPVariantName(false), IsDeprecatedMacro(false),
IsRestrictExpansion(false), IsFinal(false) {}

public:
IdentifierInfo(const IdentifierInfo &) = delete;
Expand Down Expand Up @@ -524,18 +520,6 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
RecomputeNeedsHandleIdentifier();
}

/// Determine whether this is the contextual keyword \c module.
bool isModulesDeclaration() const { return IsModulesDecl; }

/// Set whether this identifier is the contextual keyword \c module.
void setModulesDeclaration(bool I) {
IsModulesDecl = I;
if (I)
NeedsHandleIdentifier = true;
else
RecomputeNeedsHandleIdentifier();
}

/// Determine whether this is the mangled name of an OpenMP variant.
bool isMangledOpenMPVariantName() const { return IsMangledOpenMPVariantName; }

Expand Down Expand Up @@ -756,8 +740,6 @@ class IdentifierTable {
// If this is the 'import' contextual keyword, mark it as such.
if (Name == "import")
II->setModulesImport(true);
else if (Name == "module")
II->setModulesDeclaration(true);

return *II;
}
Expand Down
Loading