Skip to content

Commit ed6a23f

Browse files
Merge branch 'main' into TargetHooks
2 parents e0644ab + 0df5fc7 commit ed6a23f

File tree

90 files changed

+12140
-5740
lines changed

Some content is hidden

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

90 files changed

+12140
-5740
lines changed

.ci/cache_lit_timing_files.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import glob
1818

1919
from google.cloud import storage
20+
from google.api_core import exceptions
2021

2122
GCS_PARALLELISM = 100
2223

@@ -50,7 +51,14 @@ def _maybe_download_timing_file(blob):
5051

5152
def download_timing_files(storage_client, bucket_name: str):
5253
bucket = storage_client.bucket(bucket_name)
53-
blobs = bucket.list_blobs(prefix="lit_timing")
54+
try:
55+
blobs = bucket.list_blobs(prefix="lit_timing")
56+
except exceptions.ClientError as client_error:
57+
print(
58+
"::warning file=cache_lit_timing_files.py::Failed to list blobs "
59+
"in bucket."
60+
)
61+
sys.exit(0)
5462
with multiprocessing.pool.ThreadPool(GCS_PARALLELISM) as thread_pool:
5563
futures = []
5664
for timing_file_blob in blobs:
@@ -60,7 +68,13 @@ def download_timing_files(storage_client, bucket_name: str):
6068
)
6169
)
6270
for future in futures:
63-
future.get()
71+
future.wait()
72+
if not future.successful():
73+
print(
74+
"::warning file=cache_lit_timing_files.py::Failed to "
75+
"download lit timing file."
76+
)
77+
continue
6478
print("Done downloading")
6579

6680

bolt/docs/PacRetDesign.md

Lines changed: 0 additions & 228 deletions
This file was deleted.

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,6 @@ class BinaryFunction {
148148
PF_MEMEVENT = 4, /// Profile has mem events.
149149
};
150150

151-
void setContainedNegateRAState() { HadNegateRAState = true; }
152-
bool containedNegateRAState() const { return HadNegateRAState; }
153-
void setInitialRAState(bool State) { InitialRAState = State; }
154-
bool getInitialRAState() { return InitialRAState; }
155-
156151
/// Struct for tracking exception handling ranges.
157152
struct CallSite {
158153
const MCSymbol *Start;
@@ -223,12 +218,6 @@ class BinaryFunction {
223218
/// Current state of the function.
224219
State CurrentState{State::Empty};
225220

226-
/// Indicates if the Function contained .cfi-negate-ra-state. These are not
227-
/// read from the binary. This boolean is used when deciding to run the
228-
/// .cfi-negate-ra-state rewriting passes on a function or not.
229-
bool HadNegateRAState{false};
230-
bool InitialRAState{false};
231-
232221
/// A list of symbols associated with the function entry point.
233222
///
234223
/// Multiple symbols would typically result from identical code-folding
@@ -1651,51 +1640,6 @@ class BinaryFunction {
16511640

16521641
void setHasInferredProfile(bool Inferred) { HasInferredProfile = Inferred; }
16531642

1654-
/// Find corrected offset the same way addCFIInstruction does it to skip NOPs.
1655-
std::optional<uint64_t> getCorrectedCFIOffset(uint64_t Offset) {
1656-
assert(!Instructions.empty());
1657-
auto I = Instructions.lower_bound(Offset);
1658-
if (Offset == getSize()) {
1659-
assert(I == Instructions.end() && "unexpected iterator value");
1660-
// Sometimes compiler issues restore_state after all instructions
1661-
// in the function (even after nop).
1662-
--I;
1663-
Offset = I->first;
1664-
}
1665-
assert(I->first == Offset && "CFI pointing to unknown instruction");
1666-
if (I == Instructions.begin())
1667-
return {};
1668-
1669-
--I;
1670-
while (I != Instructions.begin() && BC.MIB->isNoop(I->second)) {
1671-
Offset = I->first;
1672-
--I;
1673-
}
1674-
return Offset;
1675-
}
1676-
1677-
void setInstModifiesRAState(uint8_t CFIOpcode, uint64_t Offset) {
1678-
std::optional<uint64_t> CorrectedOffset = getCorrectedCFIOffset(Offset);
1679-
if (CorrectedOffset) {
1680-
auto I = Instructions.lower_bound(*CorrectedOffset);
1681-
I--;
1682-
1683-
switch (CFIOpcode) {
1684-
case dwarf::DW_CFA_AARCH64_negate_ra_state:
1685-
BC.MIB->setNegateRAState(I->second);
1686-
break;
1687-
case dwarf::DW_CFA_remember_state:
1688-
BC.MIB->setRememberState(I->second);
1689-
break;
1690-
case dwarf::DW_CFA_restore_state:
1691-
BC.MIB->setRestoreState(I->second);
1692-
break;
1693-
default:
1694-
assert(0 && "CFI Opcode not covered by function");
1695-
}
1696-
}
1697-
}
1698-
16991643
void addCFIInstruction(uint64_t Offset, MCCFIInstruction &&Inst) {
17001644
assert(!Instructions.empty());
17011645

bolt/include/bolt/Core/MCPlus.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ class MCAnnotation {
7272
kLabel, /// MCSymbol pointing to this instruction.
7373
kSize, /// Size of the instruction.
7474
kDynamicBranch, /// Jit instruction patched at runtime.
75-
kRASigned, /// Inst is in a range where RA is signed.
76-
kRAUnsigned, /// Inst is in a range where RA is unsigned.
77-
kRememberState, /// Inst has rememberState CFI.
78-
kRestoreState, /// Inst has restoreState CFI.
79-
kNegateState, /// Inst has OpNegateRAState CFI.
80-
kGeneric, /// First generic annotation.
75+
kGeneric /// First generic annotation.
8176
};
8277

8378
virtual void print(raw_ostream &OS) const = 0;

0 commit comments

Comments
 (0)