Skip to content

Commit e2fc454

Browse files
Merged main:e0ea9fd6dc36 into amd-gfx:1e7037e979ae
Local branch amd-gfx 1e7037e Merged main:0964328c2960 into amd-gfx:abbd9422e1e1 Remote branch main e0ea9fd [RISCV][GISel] Lower G_SCMP and G_UCMP. (llvm#119112) Change-Id: I7ce356de6ac57b61322324343e29fda9847d4bfc
2 parents 1e7037e + e0ea9fd commit e2fc454

File tree

1,114 files changed

+79905
-25258
lines changed

Some content is hidden

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

1,114 files changed

+79905
-25258
lines changed

.github/workflows/commit-access-review.py

Lines changed: 47 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -62,57 +62,9 @@ def __repr__(self):
6262
)
6363

6464

65-
def run_graphql_query(
66-
query: str, variables: dict, token: str, retry: bool = True
67-
) -> dict:
68-
"""
69-
This function submits a graphql query and returns the results as a
70-
dictionary.
71-
"""
72-
s = requests.Session()
73-
retries = requests.adapters.Retry(total=8, backoff_factor=2, status_forcelist=[504])
74-
s.mount("https://", requests.adapters.HTTPAdapter(max_retries=retries))
75-
76-
headers = {
77-
"Authorization": "bearer {}".format(token),
78-
# See
79-
# https://github.blog/2021-11-16-graphql-global-id-migration-update/
80-
"X-Github-Next-Global-ID": "1",
81-
}
82-
request = s.post(
83-
url="https://api.github.com/graphql",
84-
json={"query": query, "variables": variables},
85-
headers=headers,
86-
)
87-
88-
rate_limit = request.headers.get("X-RateLimit-Remaining")
89-
print(rate_limit)
90-
if rate_limit and int(rate_limit) < 10:
91-
reset_time = int(request.headers["X-RateLimit-Reset"])
92-
while reset_time - int(time.time()) > 0:
93-
time.sleep(60)
94-
print(
95-
"Waiting until rate limit reset",
96-
reset_time - int(time.time()),
97-
"seconds remaining",
98-
)
99-
100-
if request.status_code == 200:
101-
if "data" not in request.json():
102-
print(request.json())
103-
sys.exit(1)
104-
return request.json()["data"]
105-
elif retry:
106-
return run_graphql_query(query, variables, token, False)
107-
else:
108-
raise Exception(
109-
"Failed to run graphql query\nquery: {}\nerror: {}".format(
110-
query, request.json()
111-
)
112-
)
113-
114-
115-
def check_manual_requests(start_date: datetime.datetime, token: str) -> list[str]:
65+
def check_manual_requests(
66+
gh: github.Github, start_date: datetime.datetime
67+
) -> list[str]:
11668
"""
11769
Return a list of users who have been asked since ``start_date`` if they
11870
want to keep their commit access.
@@ -137,18 +89,21 @@ def check_manual_requests(start_date: datetime.datetime, token: str) -> list[str
13789
"""
13890
formatted_start_date = start_date.strftime("%Y-%m-%dT%H:%M:%S")
13991
variables = {
140-
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infrastructure:commit-access"
92+
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access"
14193
}
14294

143-
data = run_graphql_query(query, variables, token)
95+
res_header, res_data = gh._Github__requester.graphql_query(
96+
query=query, variables=variables
97+
)
98+
data = res_data["data"]
14499
users = []
145100
for issue in data["search"]["nodes"]:
146101
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
147102

148103
return users
149104

150105

151-
def get_num_commits(user: str, start_date: datetime.datetime, token: str) -> int:
106+
def get_num_commits(gh: github.Github, user: str, start_date: datetime.datetime) -> int:
152107
"""
153108
Get number of commits that ``user`` has been made since ``start_date`.
154109
"""
@@ -166,7 +121,10 @@ def get_num_commits(user: str, start_date: datetime.datetime, token: str) -> int
166121
}
167122
"""
168123

169-
data = run_graphql_query(user_query, variables, token)
124+
res_header, res_data = gh._Github__requester.graphql_query(
125+
query=user_query, variables=variables
126+
)
127+
data = res_data["data"]
170128
variables["user_id"] = data["user"]["id"]
171129

172130
query = """
@@ -193,7 +151,10 @@ def get_num_commits(user: str, start_date: datetime.datetime, token: str) -> int
193151
}
194152
"""
195153
count = 0
196-
data = run_graphql_query(query, variables, token)
154+
res_header, res_data = gh._Github__requester.graphql_query(
155+
query=query, variables=variables
156+
)
157+
data = res_data["data"]
197158
for repo in data["organization"]["teams"]["nodes"][0]["repositories"]["nodes"]:
198159
count += int(repo["ref"]["target"]["history"]["totalCount"])
199160
if count >= User.THRESHOLD:
@@ -202,7 +163,7 @@ def get_num_commits(user: str, start_date: datetime.datetime, token: str) -> int
202163

203164

204165
def is_new_committer_query_repo(
205-
user: str, start_date: datetime.datetime, token: str
166+
gh: github.Github, user: str, start_date: datetime.datetime
206167
) -> bool:
207168
"""
208169
Determine if ``user`` is a new committer. A new committer can keep their
@@ -220,7 +181,10 @@ def is_new_committer_query_repo(
220181
}
221182
"""
222183

223-
data = run_graphql_query(user_query, variables, token)
184+
res_header, res_data = gh._Github__requester.graphql_query(
185+
query=user_query, variables=variables
186+
)
187+
data = res_data["data"]
224188
variables["owner"] = "llvm"
225189
variables["user_id"] = data["user"]["id"]
226190
variables["start_date"] = start_date.strftime("%Y-%m-%dT%H:%M:%S")
@@ -245,7 +209,10 @@ def is_new_committer_query_repo(
245209
}
246210
"""
247211

248-
data = run_graphql_query(query, variables, token)
212+
res_header, res_data = gh._Github__requester.graphql_query(
213+
query=query, variables=variables
214+
)
215+
data = res_data["data"]
249216
repo = data["organization"]["repository"]
250217
commits = repo["ref"]["target"]["history"]["nodes"]
251218
if len(commits) == 0:
@@ -256,18 +223,22 @@ def is_new_committer_query_repo(
256223
return True
257224

258225

259-
def is_new_committer(user: str, start_date: datetime.datetime, token: str) -> bool:
226+
def is_new_committer(
227+
gh: github.Github, user: str, start_date: datetime.datetime
228+
) -> bool:
260229
"""
261230
Wrapper around is_new_commiter_query_repo to handle exceptions.
262231
"""
263232
try:
264-
return is_new_committer_query_repo(user, start_date, token)
233+
return is_new_committer_query_repo(gh, user, start_date)
265234
except:
266235
pass
267236
return True
268237

269238

270-
def get_review_count(user: str, start_date: datetime.datetime, token: str) -> int:
239+
def get_review_count(
240+
gh: github.Github, user: str, start_date: datetime.datetime
241+
) -> int:
271242
"""
272243
Return the number of reviews that ``user`` has done since ``start_date``.
273244
"""
@@ -286,11 +257,14 @@ def get_review_count(user: str, start_date: datetime.datetime, token: str) -> in
286257
"query": f"type:pr commenter:{user} -author:{user} merged:>{formatted_start_date} org:llvm",
287258
}
288259

289-
data = run_graphql_query(query, variables, token)
260+
res_header, res_data = gh._Github__requester.graphql_query(
261+
query=query, variables=variables
262+
)
263+
data = res_data["data"]
290264
return int(data["search"]["issueCount"])
291265

292266

293-
def count_prs(triage_list: dict, start_date: datetime.datetime, token: str):
267+
def count_prs(gh: github.Github, triage_list: dict, start_date: datetime.datetime):
294268
"""
295269
Fetch all the merged PRs for the project since ``start_date`` and update
296270
``triage_list`` with the number of PRs merged for each user.
@@ -329,7 +303,10 @@ def count_prs(triage_list: dict, start_date: datetime.datetime, token: str):
329303
has_next_page = True
330304
while has_next_page:
331305
print(variables)
332-
data = run_graphql_query(query, variables, token)
306+
res_header, res_data = gh._Github__requester.graphql_query(
307+
query=query, variables=variables
308+
)
309+
data = res_data["data"]
333310
for pr in data["search"]["nodes"]:
334311
# Users can be None if the user has been deleted.
335312
if not pr["author"]:
@@ -365,14 +342,14 @@ def main():
365342

366343
print("Start:", len(triage_list), "triagers")
367344
# Step 0 Check if users have requested commit access in the last year.
368-
for user in check_manual_requests(one_year_ago, token):
345+
for user in check_manual_requests(gh, one_year_ago):
369346
if user in triage_list:
370347
print(user, "requested commit access in the last year.")
371348
del triage_list[user]
372349
print("After Request Check:", len(triage_list), "triagers")
373350

374351
# Step 1 count all PRs authored or merged
375-
count_prs(triage_list, one_year_ago, token)
352+
count_prs(gh, triage_list, one_year_ago)
376353

377354
print("After PRs:", len(triage_list), "triagers")
378355

@@ -381,7 +358,7 @@ def main():
381358

382359
# Step 2 check for reviews
383360
for user in list(triage_list.keys()):
384-
review_count = get_review_count(user, one_year_ago, token)
361+
review_count = get_review_count(gh, user, one_year_ago)
385362
triage_list[user].add_reviewed(review_count)
386363

387364
print("After Reviews:", len(triage_list), "triagers")
@@ -391,7 +368,7 @@ def main():
391368

392369
# Step 3 check for number of commits
393370
for user in list(triage_list.keys()):
394-
num_commits = get_num_commits(user, one_year_ago, token)
371+
num_commits = get_num_commits(gh, user, one_year_ago)
395372
# Override the total number of commits to not double count commits and
396373
# authored PRs.
397374
triage_list[user].set_authored(num_commits)
@@ -401,7 +378,7 @@ def main():
401378
# Step 4 check for new committers
402379
for user in list(triage_list.keys()):
403380
print("Checking", user)
404-
if is_new_committer(user, one_year_ago, token):
381+
if is_new_committer(gh, user, one_year_ago):
405382
print("Removing new committer: ", user)
406383
del triage_list[user]
407384

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ jobs:
133133
134134
restart-test:
135135
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') && github.event.actor.login == 'ldionne' # TESTING ONLY
136-
name: "Restart Job"
136+
name: "Restart Job (test)"
137137
permissions:
138138
statuses: read
139139
checks: write
140140
actions: write
141141
runs-on: ubuntu-latest
142142
steps:
143-
- name: "Restart Job"
143+
- name: "Restart Job (test)"
144144
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
145145
with:
146146
script: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ autoconf/autom4te.cache
5959
# VS2017 and VSCode config files.
6060
.vscode
6161
.vs
62+
#zed config files
63+
.zed
6264
# pythonenv for github Codespaces
6365
pythonenv*
6466
# clangd index. (".clangd" is a config file now, thus trailing slash)

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "llvm/ADT/iterator.h"
2929
#include "llvm/BinaryFormat/Dwarf.h"
3030
#include "llvm/BinaryFormat/MachO.h"
31+
#include "llvm/ExecutionEngine/Orc/SymbolStringPool.h"
3132
#include "llvm/MC/MCAsmInfo.h"
3233
#include "llvm/MC/MCCodeEmitter.h"
3334
#include "llvm/MC/MCContext.h"
@@ -276,11 +277,10 @@ class BinaryContext {
276277
void deregisterSectionName(const BinarySection &Section);
277278

278279
public:
279-
static Expected<std::unique_ptr<BinaryContext>>
280-
createBinaryContext(Triple TheTriple, StringRef InputFileName,
281-
SubtargetFeatures *Features, bool IsPIC,
282-
std::unique_ptr<DWARFContext> DwCtx,
283-
JournalingStreams Logger);
280+
static Expected<std::unique_ptr<BinaryContext>> createBinaryContext(
281+
Triple TheTriple, std::shared_ptr<orc::SymbolStringPool> SSP,
282+
StringRef InputFileName, SubtargetFeatures *Features, bool IsPIC,
283+
std::unique_ptr<DWARFContext> DwCtx, JournalingStreams Logger);
284284

285285
/// Superset of compiler units that will contain overwritten code that needs
286286
/// new debug info. In a few cases, functions may end up not being
@@ -372,6 +372,7 @@ class BinaryContext {
372372
bool hasSymbolsWithFileName() const { return HasSymbolsWithFileName; }
373373
void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = Value; }
374374

375+
std::shared_ptr<orc::SymbolStringPool> getSymbolStringPool() { return SSP; }
375376
/// Return true if relocations against symbol with a given name
376377
/// must be created.
377378
bool forceSymbolRelocations(StringRef SymbolName) const;
@@ -631,6 +632,8 @@ class BinaryContext {
631632

632633
std::unique_ptr<Triple> TheTriple;
633634

635+
std::shared_ptr<orc::SymbolStringPool> SSP;
636+
634637
const Target *TheTarget;
635638

636639
std::string TripleName;
@@ -807,8 +810,10 @@ class BinaryContext {
807810

808811
BinaryContext(std::unique_ptr<MCContext> Ctx,
809812
std::unique_ptr<DWARFContext> DwCtx,
810-
std::unique_ptr<Triple> TheTriple, const Target *TheTarget,
811-
std::string TripleName, std::unique_ptr<MCCodeEmitter> MCE,
813+
std::unique_ptr<Triple> TheTriple,
814+
std::shared_ptr<orc::SymbolStringPool> SSP,
815+
const Target *TheTarget, std::string TripleName,
816+
std::unique_ptr<MCCodeEmitter> MCE,
812817
std::unique_ptr<MCObjectFileInfo> MOFI,
813818
std::unique_ptr<const MCAsmInfo> AsmInfo,
814819
std::unique_ptr<const MCInstrInfo> MII,

bolt/lib/Core/BinaryContext.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ void BinaryContext::logBOLTErrorsAndQuitOnFatal(Error E) {
123123
BinaryContext::BinaryContext(std::unique_ptr<MCContext> Ctx,
124124
std::unique_ptr<DWARFContext> DwCtx,
125125
std::unique_ptr<Triple> TheTriple,
126+
std::shared_ptr<orc::SymbolStringPool> SSP,
126127
const Target *TheTarget, std::string TripleName,
127128
std::unique_ptr<MCCodeEmitter> MCE,
128129
std::unique_ptr<MCObjectFileInfo> MOFI,
@@ -136,12 +137,12 @@ BinaryContext::BinaryContext(std::unique_ptr<MCContext> Ctx,
136137
std::unique_ptr<MCDisassembler> DisAsm,
137138
JournalingStreams Logger)
138139
: Ctx(std::move(Ctx)), DwCtx(std::move(DwCtx)),
139-
TheTriple(std::move(TheTriple)), TheTarget(TheTarget),
140-
TripleName(TripleName), MCE(std::move(MCE)), MOFI(std::move(MOFI)),
141-
AsmInfo(std::move(AsmInfo)), MII(std::move(MII)), STI(std::move(STI)),
142-
InstPrinter(std::move(InstPrinter)), MIA(std::move(MIA)),
143-
MIB(std::move(MIB)), MRI(std::move(MRI)), DisAsm(std::move(DisAsm)),
144-
Logger(Logger), InitialDynoStats(isAArch64()) {
140+
TheTriple(std::move(TheTriple)), SSP(std::move(SSP)),
141+
TheTarget(TheTarget), TripleName(TripleName), MCE(std::move(MCE)),
142+
MOFI(std::move(MOFI)), AsmInfo(std::move(AsmInfo)), MII(std::move(MII)),
143+
STI(std::move(STI)), InstPrinter(std::move(InstPrinter)),
144+
MIA(std::move(MIA)), MIB(std::move(MIB)), MRI(std::move(MRI)),
145+
DisAsm(std::move(DisAsm)), Logger(Logger), InitialDynoStats(isAArch64()) {
145146
RegularPageSize = isAArch64() ? RegularPageSizeAArch64 : RegularPageSizeX86;
146147
PageAlign = opts::NoHugePages ? RegularPageSize : HugePageSize;
147148
}
@@ -159,8 +160,9 @@ BinaryContext::~BinaryContext() {
159160
/// Create BinaryContext for a given architecture \p ArchName and
160161
/// triple \p TripleName.
161162
Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
162-
Triple TheTriple, StringRef InputFileName, SubtargetFeatures *Features,
163-
bool IsPIC, std::unique_ptr<DWARFContext> DwCtx, JournalingStreams Logger) {
163+
Triple TheTriple, std::shared_ptr<orc::SymbolStringPool> SSP,
164+
StringRef InputFileName, SubtargetFeatures *Features, bool IsPIC,
165+
std::unique_ptr<DWARFContext> DwCtx, JournalingStreams Logger) {
164166
StringRef ArchName = "";
165167
std::string FeaturesStr = "";
166168
switch (TheTriple.getArch()) {
@@ -283,8 +285,8 @@ Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
283285

284286
auto BC = std::make_unique<BinaryContext>(
285287
std::move(Ctx), std::move(DwCtx), std::make_unique<Triple>(TheTriple),
286-
TheTarget, std::string(TripleName), std::move(MCE), std::move(MOFI),
287-
std::move(AsmInfo), std::move(MII), std::move(STI),
288+
std::move(SSP), TheTarget, std::string(TripleName), std::move(MCE),
289+
std::move(MOFI), std::move(AsmInfo), std::move(MII), std::move(STI),
288290
std::move(InstructionPrinter), std::move(MIA), nullptr, std::move(MRI),
289291
std::move(DisAsm), Logger);
290292

bolt/lib/Core/DebugNames.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ bool static canProcess(const DWARFUnit &Unit, const DIE &Die,
161161
case dwarf::DW_TAG_structure_type:
162162
case dwarf::DW_TAG_typedef:
163163
case dwarf::DW_TAG_unspecified_type:
164+
case dwarf::DW_TAG_union_type:
164165
if (TagsOnly || Die.findAttribute(dwarf::Attribute::DW_AT_name))
165166
return true;
166167
return false;

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,8 @@ namespace {
16911691
std::unique_ptr<BinaryContext>
16921692
createDwarfOnlyBC(const object::ObjectFile &File) {
16931693
return cantFail(BinaryContext::createBinaryContext(
1694-
File.makeTriple(), File.getFileName(), nullptr, false,
1694+
File.makeTriple(), std::make_shared<orc::SymbolStringPool>(),
1695+
File.getFileName(), nullptr, false,
16951696
DWARFContext::create(File, DWARFContext::ProcessDebugRelocations::Ignore,
16961697
nullptr, "", WithColor::defaultErrorHandler,
16971698
WithColor::defaultWarningHandler),

0 commit comments

Comments
 (0)