Skip to content

Commit 6ad77b7

Browse files
committed
Revert "Merge branch 'main' into riscv-address-resolution"
This reverts commit 3228086, reversing changes made to b738bf1.
1 parent 3228086 commit 6ad77b7

File tree

4,380 files changed

+70726
-185067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,380 files changed

+70726
-185067
lines changed

.github/new-prs-labeler.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,6 @@ backend:NVPTX:
777777
- 'llvm/**/*nvptx*/**'
778778
- 'llvm/**/*NVPTX*/**'
779779

780-
backend:MIPS:
781-
- '**/*mips*'
782-
- '**/*Mips*'
783-
784780
backend:RISC-V:
785781
- clang/**/*riscv*
786782
- clang/**/*RISCV*

.github/workflows/email-check.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ jobs:
3232
COMMENT: >-
3333
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
3434
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35-
See [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html#email-addresses) and
36-
[LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
35+
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
3736
run: |
3837
cat << EOF > comments
3938
[{"body" : "$COMMENT"}]

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
55-
cc: 'gcc-15'
56-
cxx: 'g++-15'
55+
cc: 'gcc-14'
56+
cxx: 'g++-14'
5757
steps:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
@@ -92,8 +92,8 @@ jobs:
9292
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
95-
cc: 'gcc-15'
96-
cxx: 'g++-15'
95+
cc: 'gcc-14'
96+
cxx: 'g++-14'
9797
- config: 'generic-cxx26'
9898
cc: 'clang-20'
9999
cxx: 'clang++-20'

.github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
script: |
3535
const failure_regex = /Process completed with exit code 1./
36-
const preemption_regex = /(The runner has received a shutdown signal)|(The operation was canceled)/
36+
const preemption_regex = /The runner has received a shutdown signal/
3737
3838
const wf_run = context.payload.workflow_run
3939
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,6 @@ class BinaryFunction {
388388
/// The profile data for the number of times the function was executed.
389389
uint64_t ExecutionCount{COUNT_NO_PROFILE};
390390

391-
/// Profile data for the number of times this function was entered from
392-
/// external code (DSO, JIT, etc).
393-
uint64_t ExternEntryCount{0};
394-
395391
/// Profile match ratio.
396392
float ProfileMatchRatio{0.0f};
397393

@@ -1881,10 +1877,6 @@ class BinaryFunction {
18811877
return *this;
18821878
}
18831879

1884-
/// Set the profile data for the number of times the function was entered from
1885-
/// external code (DSO/JIT).
1886-
void setExternEntryCount(uint64_t Count) { ExternEntryCount = Count; }
1887-
18881880
/// Adjust execution count for the function by a given \p Count. The value
18891881
/// \p Count will be subtracted from the current function count.
18901882
///
@@ -1912,10 +1904,6 @@ class BinaryFunction {
19121904
/// Return COUNT_NO_PROFILE if there's no profile info.
19131905
uint64_t getExecutionCount() const { return ExecutionCount; }
19141906

1915-
/// Return the profile information about the number of times the function was
1916-
/// entered from external code (DSO/JIT).
1917-
uint64_t getExternEntryCount() const { return ExternEntryCount; }
1918-
19191907
/// Return the raw profile information about the number of branch
19201908
/// executions corresponding to this function.
19211909
uint64_t getRawSampleCount() const { return RawSampleCount; }

bolt/include/bolt/Passes/PAuthGadgetScanner.h

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ namespace PAuthGadgetScanner {
199199
// to distinguish intermediate and final results at the type level.
200200
//
201201
// Here is an overview of issue life-cycle:
202-
// * an analysis (SrcSafetyAnalysis or DstSafetyAnalysis) computes register
202+
// * an analysis (SrcSafetyAnalysis at now, DstSafetyAnalysis will be added
203+
// later to support the detection of authentication oracles) computes register
203204
// state for each instruction in the function.
204205
// * for each instruction, it is checked whether it is a gadget of some kind,
205206
// taking the computed state into account. If a gadget is found, its kind
@@ -272,11 +273,6 @@ class ExtraInfo {
272273
virtual ~ExtraInfo() {}
273274
};
274275

275-
/// The set of instructions writing to the affected register in an unsafe
276-
/// manner.
277-
///
278-
/// This is a hint to be printed alongside the report. It should be further
279-
/// analyzed by the user.
280276
class ClobberingInfo : public ExtraInfo {
281277
SmallVector<MCInstReference> ClobberingInstrs;
282278

@@ -286,20 +282,6 @@ class ClobberingInfo : public ExtraInfo {
286282
void print(raw_ostream &OS, const MCInstReference Location) const override;
287283
};
288284

289-
/// The set of instructions leaking the authenticated pointer before the
290-
/// result of authentication was checked.
291-
///
292-
/// This is a hint to be printed alongside the report. It should be further
293-
/// analyzed by the user.
294-
class LeakageInfo : public ExtraInfo {
295-
SmallVector<MCInstReference> LeakingInstrs;
296-
297-
public:
298-
LeakageInfo(ArrayRef<MCInstReference> Instrs) : LeakingInstrs(Instrs) {}
299-
300-
void print(raw_ostream &OS, const MCInstReference Location) const override;
301-
};
302-
303285
/// A brief version of a report that can be further augmented with the details.
304286
///
305287
/// A half-baked report produced on the first run of the analysis. An extra,
@@ -340,9 +322,6 @@ class FunctionAnalysisContext {
340322
void findUnsafeUses(SmallVector<PartialReport<MCPhysReg>> &Reports);
341323
void augmentUnsafeUseReports(ArrayRef<PartialReport<MCPhysReg>> Reports);
342324

343-
void findUnsafeDefs(SmallVector<PartialReport<MCPhysReg>> &Reports);
344-
void augmentUnsafeDefReports(ArrayRef<PartialReport<MCPhysReg>> Reports);
345-
346325
/// Process the reports which do not have to be augmented, and remove them
347326
/// from Reports.
348327
void handleSimpleReports(SmallVector<PartialReport<MCPhysReg>> &Reports);

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ class DataAggregator : public DataReader {
8585
};
8686
friend raw_ostream &operator<<(raw_ostream &OS, const LBREntry &);
8787

88-
friend struct PerfSpeEventsTestHelper;
89-
9088
struct PerfBranchSample {
9189
SmallVector<LBREntry, 32> LBR;
9290
};
@@ -101,29 +99,24 @@ class DataAggregator : public DataReader {
10199
uint64_t Addr;
102100
};
103101

104-
/// Container for the unit of branch data, matching pre-aggregated trace type.
105-
/// Backwards compatible with branch and fall-through types:
106-
/// - if \p To is < 0, the trace only contains branch data (BR_ONLY),
107-
/// - if \p Branch is < 0, the trace only contains fall-through data
108-
/// (FT_ONLY, FT_EXTERNAL_ORIGIN, or FT_EXTERNAL_RETURN).
109102
struct Trace {
110-
static constexpr const uint64_t EXTERNAL = 0ULL;
111-
static constexpr const uint64_t BR_ONLY = -1ULL;
112-
static constexpr const uint64_t FT_ONLY = -1ULL;
113-
static constexpr const uint64_t FT_EXTERNAL_ORIGIN = -2ULL;
114-
static constexpr const uint64_t FT_EXTERNAL_RETURN = -3ULL;
115-
116-
uint64_t Branch;
117103
uint64_t From;
118104
uint64_t To;
119-
auto tie() const { return std::tie(Branch, From, To); }
120-
bool operator==(const Trace &Other) const { return tie() == Other.tie(); }
121-
bool operator<(const Trace &Other) const { return tie() < Other.tie(); }
105+
Trace(uint64_t From, uint64_t To) : From(From), To(To) {}
106+
bool operator==(const Trace &Other) const {
107+
return From == Other.From && To == Other.To;
108+
}
122109
};
123-
friend raw_ostream &operator<<(raw_ostream &OS, const Trace &);
124110

125111
struct TraceHash {
126-
size_t operator()(const Trace &L) const { return hash_combine(L.tie()); }
112+
size_t operator()(const Trace &L) const {
113+
return std::hash<uint64_t>()(L.From << 32 | L.To);
114+
}
115+
};
116+
117+
struct FTInfo {
118+
uint64_t InternCount{0};
119+
uint64_t ExternCount{0};
127120
};
128121

129122
struct TakenBranchInfo {
@@ -133,11 +126,8 @@ class DataAggregator : public DataReader {
133126

134127
/// Intermediate storage for profile data. We save the results of parsing
135128
/// and use them later for processing and assigning profile.
136-
std::unordered_map<Trace, TakenBranchInfo, TraceHash> TraceMap;
137-
std::vector<std::pair<Trace, TakenBranchInfo>> Traces;
138-
/// Pre-populated addresses of returns, coming from pre-aggregated data or
139-
/// disassembly. Used to disambiguate call-continuation fall-throughs.
140-
std::unordered_set<uint64_t> Returns;
129+
std::unordered_map<Trace, TakenBranchInfo, TraceHash> BranchLBRs;
130+
std::unordered_map<Trace, FTInfo, TraceHash> FallthroughLBRs;
141131
std::unordered_map<uint64_t, uint64_t> BasicSamples;
142132
std::vector<PerfMemSample> MemSamples;
143133

@@ -210,8 +200,8 @@ class DataAggregator : public DataReader {
210200
/// Return a vector of offsets corresponding to a trace in a function
211201
/// if the trace is valid, std::nullopt otherwise.
212202
std::optional<SmallVector<std::pair<uint64_t, uint64_t>, 16>>
213-
getFallthroughsInTrace(BinaryFunction &BF, const Trace &Trace, uint64_t Count,
214-
bool IsReturn) const;
203+
getFallthroughsInTrace(BinaryFunction &BF, const LBREntry &First,
204+
const LBREntry &Second, uint64_t Count = 1) const;
215205

216206
/// Record external entry into the function \p BF.
217207
///
@@ -271,14 +261,12 @@ class DataAggregator : public DataReader {
271261
uint64_t From, uint64_t To, uint64_t Count,
272262
uint64_t Mispreds);
273263

274-
/// Checks if \p Addr corresponds to a return instruction.
275-
bool checkReturn(uint64_t Addr);
276-
277264
/// Register a \p Branch.
278265
bool doBranch(uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds);
279266

280267
/// Register a trace between two LBR entries supplied in execution order.
281-
bool doTrace(const Trace &Trace, uint64_t Count, bool IsReturn);
268+
bool doTrace(const LBREntry &First, const LBREntry &Second,
269+
uint64_t Count = 1);
282270

283271
/// Parser helpers
284272
/// Return false if we exhausted our parser buffer and finished parsing
@@ -391,9 +379,9 @@ class DataAggregator : public DataReader {
391379
/// File format syntax:
392380
/// E <event>
393381
/// S <start> <count>
394-
/// [TR] <start> <end> <ft_end> <count>
382+
/// T <start> <end> <ft_end> <count>
395383
/// B <start> <end> <count> <mispred_count>
396-
/// [Ffr] <start> <end> <count>
384+
/// [Ff] <start> <end> <count>
397385
///
398386
/// where <start>, <end>, <ft_end> have the format [<id>:]<offset>
399387
///
@@ -404,11 +392,8 @@ class DataAggregator : public DataReader {
404392
/// f - an aggregated fall-through with external origin - used to disambiguate
405393
/// between a return hitting a basic block head and a regular internal
406394
/// jump to the block
407-
/// r - an aggregated fall-through originating at an external return, no
408-
/// checks are performed for a fallthrough start
409395
/// T - an aggregated trace: branch from <start> to <end> with a fall-through
410396
/// to <ft_end>
411-
/// R - an aggregated trace originating at a return
412397
///
413398
/// <id> - build id of the object containing the address. We can skip it for
414399
/// the main binary and use "X" for an unknown object. This will save some
@@ -531,26 +516,6 @@ inline raw_ostream &operator<<(raw_ostream &OS,
531516
OS << formatv("{0:x} -> {1:x}/{2}", L.From, L.To, L.Mispred ? 'M' : 'P');
532517
return OS;
533518
}
534-
535-
inline raw_ostream &operator<<(raw_ostream &OS,
536-
const DataAggregator::Trace &T) {
537-
switch (T.Branch) {
538-
case DataAggregator::Trace::FT_ONLY:
539-
break;
540-
case DataAggregator::Trace::FT_EXTERNAL_ORIGIN:
541-
OS << "X:0 -> ";
542-
break;
543-
case DataAggregator::Trace::FT_EXTERNAL_RETURN:
544-
OS << "X:R -> ";
545-
break;
546-
default:
547-
OS << Twine::utohexstr(T.Branch) << " -> ";
548-
}
549-
OS << Twine::utohexstr(T.From);
550-
if (T.To != DataAggregator::Trace::BR_ONLY)
551-
OS << " ... " << Twine::utohexstr(T.To);
552-
return OS;
553-
}
554519
} // namespace bolt
555520
} // namespace llvm
556521

bolt/include/bolt/Profile/DataReader.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ struct FuncBranchData {
9797
/// Total execution count for the function.
9898
int64_t ExecutionCount{0};
9999

100-
/// Total entry count from external code for the function.
101-
uint64_t ExternEntryCount{0};
102-
103100
/// Indicate if the data was used.
104101
bool Used{false};
105102

bolt/include/bolt/Profile/ProfileYAMLMapping.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ struct BinaryFunctionProfile {
206206
uint32_t Id{0};
207207
llvm::yaml::Hex64 Hash{0};
208208
uint64_t ExecCount{0};
209-
uint64_t ExternEntryCount{0};
210209
std::vector<BinaryBasicBlockProfile> Blocks;
211210
std::vector<InlineTreeNode> InlineTree;
212211
bool Used{false};
@@ -219,7 +218,6 @@ template <> struct MappingTraits<bolt::BinaryFunctionProfile> {
219218
YamlIO.mapRequired("fid", BFP.Id);
220219
YamlIO.mapRequired("hash", BFP.Hash);
221220
YamlIO.mapRequired("exec", BFP.ExecCount);
222-
YamlIO.mapOptional("extern", BFP.ExternEntryCount, 0);
223221
YamlIO.mapRequired("nblocks", BFP.NumBasicBlocks);
224222
YamlIO.mapOptional("blocks", BFP.Blocks,
225223
std::vector<bolt::BinaryBasicBlockProfile>());

bolt/include/bolt/Utils/CommandLineOpts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ extern llvm::cl::OptionCategory BinaryAnalysisCategory;
4848
extern llvm::cl::opt<unsigned> AlignText;
4949
extern llvm::cl::opt<unsigned> AlignFunctions;
5050
extern llvm::cl::opt<bool> AggregateOnly;
51-
extern llvm::cl::opt<bool> ArmSPE;
5251
extern llvm::cl::opt<unsigned> BucketsPerLine;
5352
extern llvm::cl::opt<bool> CompactCodeModel;
5453
extern llvm::cl::opt<bool> DiffOnly;

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,6 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
471471
OS << "\n Sample Count: " << RawSampleCount;
472472
OS << "\n Profile Acc : " << format("%.1f%%", ProfileMatchRatio * 100.0f);
473473
}
474-
if (ExternEntryCount)
475-
OS << "\n Extern Entry Count: " << ExternEntryCount;
476474

477475
if (opts::PrintDynoStats && !getLayout().block_empty()) {
478476
OS << '\n';

0 commit comments

Comments
 (0)