Skip to content

Commit 59f4280

Browse files
authored
merge main into amd-staging (llvm#4408)
2 parents 9240f3a + 5edfc85 commit 59f4280

File tree

179 files changed

+7732
-2825
lines changed

Some content is hidden

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

179 files changed

+7732
-2825
lines changed

.ci/all_requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ ml-dtypes==0.5.1 ; python_version < "3.13" \
194194
--hash=sha256:d13755f8e8445b3870114e5b6240facaa7cb0c3361e54beba3e07fa912a6e12b \
195195
--hash=sha256:fd918d4e6a4e0c110e2e05be7a7814d10dc1b95872accbf6512b80a109b71ae1
196196
# via -r mlir/python/requirements.txt
197+
nanobind==2.9.2 \
198+
--hash=sha256:c37957ffd5eac7eda349cff3622ecd32e5ee1244ecc912c99b5bc8188bafd16e \
199+
--hash=sha256:e7608472de99d375759814cab3e2c94aba3f9ec80e62cfef8ced495ca5c27d6e
200+
# via -r mlir/python/requirements.txt
197201
numpy==2.0.2 \
198202
--hash=sha256:0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a \
199203
--hash=sha256:11a76c372d1d37437857280aa142086476136a8c0f373b2e648ab2c8f18fb195 \
@@ -295,6 +299,10 @@ pyasn1-modules==0.4.2 \
295299
--hash=sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a \
296300
--hash=sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6
297301
# via google-auth
302+
pybind11==2.13.6 \
303+
--hash=sha256:237c41e29157b962835d356b370ededd57594a26d5894a795960f0047cb5caf5 \
304+
--hash=sha256:ba6af10348c12b24e92fa086b39cfba0eff619b61ac77c406167d813b096d39a
305+
# via -r mlir/python/requirements.txt
298306
pyyaml==6.0.1 \
299307
--hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \
300308
--hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \

.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

clang/docs/ClangOffloadPackager.rst

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

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ AST Dumping Potentially Breaking Changes
126126
- Pretty-printing of templates with inherited (i.e. specified in a previous
127127
redeclaration) default arguments has been fixed.
128128

129+
- Default arguments of template template parameters are pretty-printed now.
130+
129131
Clang Frontend Potentially Breaking Changes
130132
-------------------------------------------
131133
- Members of anonymous unions/structs are now injected as ``IndirectFieldDecl``

clang/include/clang/Analysis/Analyses/LifetimeSafety.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@
2929
namespace clang::lifetimes {
3030

3131
/// Enum to track the confidence level of a potential error.
32-
enum class Confidence {
32+
enum class Confidence : uint8_t {
3333
None,
3434
Maybe, // Reported as a potential error (-Wlifetime-safety-strict)
3535
Definite // Reported as a definite error (-Wlifetime-safety-permissive)
3636
};
3737

38+
enum class LivenessKind : uint8_t {
39+
Dead, // Not alive
40+
Maybe, // Live on some path but not all paths (may-be-live)
41+
Must // Live on all paths (must-be-live)
42+
};
43+
3844
class LifetimeSafetyReporter {
3945
public:
4046
LifetimeSafetyReporter() = default;
@@ -55,6 +61,7 @@ class Fact;
5561
class FactManager;
5662
class LoanPropagationAnalysis;
5763
class ExpiredLoansAnalysis;
64+
class LiveOriginAnalysis;
5865
struct LifetimeFactory;
5966

6067
/// A generic, type-safe wrapper for an ID, distinguished by its `Tag` type.
@@ -89,6 +96,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, OriginID ID) {
8996
// TODO(opt): Consider using a bitset to represent the set of loans.
9097
using LoanSet = llvm::ImmutableSet<LoanID>;
9198
using OriginSet = llvm::ImmutableSet<OriginID>;
99+
using OriginLoanMap = llvm::ImmutableMap<OriginID, LoanSet>;
92100

93101
/// A `ProgramPoint` identifies a location in the CFG by pointing to a specific
94102
/// `Fact`. identified by a lifetime-related event (`Fact`).
@@ -110,8 +118,16 @@ class LifetimeSafetyAnalysis {
110118
/// Returns the set of loans an origin holds at a specific program point.
111119
LoanSet getLoansAtPoint(OriginID OID, ProgramPoint PP) const;
112120

113-
/// Returns the set of loans that have expired at a specific program point.
114-
std::vector<LoanID> getExpiredLoansAtPoint(ProgramPoint PP) const;
121+
/// Returns the set of origins that are live at a specific program point,
122+
/// along with the confidence level of their liveness.
123+
///
124+
/// An origin is considered live if there are potential future uses of that
125+
/// origin after the given program point. The confidence level indicates
126+
/// whether the origin is definitely live (Definite) due to being domintated
127+
/// by a set of uses or only possibly live (Maybe) only on some but not all
128+
/// control flow paths.
129+
std::vector<std::pair<OriginID, LivenessKind>>
130+
getLiveOriginsAtPoint(ProgramPoint PP) const;
115131

116132
/// Finds the OriginID for a given declaration.
117133
/// Returns a null optional if not found.
@@ -138,7 +154,7 @@ class LifetimeSafetyAnalysis {
138154
std::unique_ptr<LifetimeFactory> Factory;
139155
std::unique_ptr<FactManager> FactMgr;
140156
std::unique_ptr<LoanPropagationAnalysis> LoanPropagation;
141-
std::unique_ptr<ExpiredLoansAnalysis> ExpiredLoans;
157+
std::unique_ptr<LiveOriginAnalysis> LiveOrigins;
142158
};
143159
} // namespace internal
144160
} // namespace clang::lifetimes

clang/include/clang/Basic/Sanitizers.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)
195195
// Scudo hardened allocator
196196
SANITIZER("scudo", Scudo)
197197

198+
// AllocToken
199+
SANITIZER("alloc-token", AllocToken)
200+
198201
// Magic group, containing all sanitizers. For example, "-fno-sanitize=all"
199202
// can be used to disable all the sanitizers.
200203
SANITIZER_GROUP("all", All, ~SanitizerMask())

0 commit comments

Comments
 (0)