Skip to content

Commit 871715e

Browse files
authored
Merge branch 'main' into hgh/libcxx/P2835R7-Expose-std_atomic_refs-object-address
2 parents dc6e464 + 008294c commit 871715e

File tree

259 files changed

+40927
-11365
lines changed

Some content is hidden

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

259 files changed

+40927
-11365
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

.github/new-prs-labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,12 @@ mlgo:
722722
- llvm/include/llvm/Analysis/IR2Vec.h
723723
- llvm/lib/Analysis/IR2Vec.cpp
724724
- llvm/lib/Analysis/models/**
725+
- llvm/include/llvm/CodeGen/MIR2Vec.h
726+
- llvm/lib/CodeGen/MIR2Vec.cpp
725727
- llvm/test/Analysis/IR2Vec/**
728+
- llvm/test/CodeGen/MIR2Vec/**
729+
- llvm/unittests/Analysis/IR2VecTest.cpp
730+
- llvm/unittests/CodeGen/MIR2VecTest.cpp
726731
- llvm/tools/llvm-ir2vec/**
727732
- llvm/docs/CommandGuide/llvm-ir2vec.rst
728733

bolt/lib/Passes/MarkRAStates.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ Error MarkRAStates::runOnFunctions(BinaryContext &BC) {
131131
return !BF.containedNegateRAState() || BF.isIgnored();
132132
};
133133

134-
int Total = llvm::count_if(
135-
BC.getBinaryFunctions(),
136-
[&](std::pair<const unsigned long, BinaryFunction> &P) {
137-
return P.second.containedNegateRAState() && !P.second.isIgnored();
138-
});
134+
int Total = llvm::count_if(BC.getBinaryFunctions(), [&](auto &P) {
135+
return P.second.containedNegateRAState() && !P.second.isIgnored();
136+
});
139137

140138
ParallelUtilities::runOnEachFunction(
141139
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ Changes in existing checks
318318

319319
- ``for`` loops are supported.
320320

321+
- Improved :doc:`misc-const-correctness
322+
<clang-tidy/checks/misc/const-correctness>` check to avoid false
323+
positives when pointers is tranferred to non-const references.
324+
321325
- Improved :doc:`misc-header-include-cycle
322326
<clang-tidy/checks/misc/header-include-cycle>` check performance.
323327

clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-pointer-as-pointers.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,18 @@ void ignore_const_alias() {
4848
p_local0 = &a[1];
4949
}
5050

51+
void takeNonConstRef(int *&r);
52+
53+
void ignoreNonConstRefOps() {
54+
// init with non-const ref
55+
int* p0 {nullptr};
56+
int*& r1 = p0;
57+
58+
// non-const ref param
59+
int* p1 {nullptr};
60+
takeNonConstRef(p1);
61+
62+
// cast
63+
int* p2 {nullptr};
64+
int*& r2 = (int*&)p2;
65+
}

clang/docs/ClangLinkerWrapper.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ This tool works as a wrapper of the normal host linking job. This tool is used
1414
to create linked device images for offloading and the necessary runtime calls to
1515
register them. It works by first scanning the linker's input for embedded device
1616
offloading data stored at the ``.llvm.offloading`` section. This section
17-
contains binary data created by the :doc:`ClangOffloadPackager`. The extracted
18-
device files will then be linked. The linked modules will then be wrapped into a
19-
new object file containing the code necessary to register it with the offloading
20-
runtime.
17+
contains binary data created by the ``llvm-offload-binary`` utility. The
18+
extracted device files will then be linked. The linked modules will then be
19+
wrapped into a new object file containing the code necessary to register it with
20+
the offloading runtime.
2121

2222
Usage
2323
=====

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ implementation.
550550
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
551551
| OMP_AVAILABLE_DEVICES envirable | :none:`unclaimed` | :none:`unclaimed` | |
552552
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
553-
| Traits for default device envirable | :none:`unclaimed` | :none:`unclaimed` | |
553+
| Traits for default device envirable | :part:`in progress` | :none:`unclaimed` | ro-i |
554554
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
555555
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | (Parse) https://github.com/llvm/llvm-project/pull/148048, |
556556
| | | | (Sema) https://github.com/llvm/llvm-project/pull/152786 |

clang/docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Using Clang Tools
101101
ClangLinkerWrapper
102102
ClangNVLinkWrapper
103103
ClangOffloadBundler
104-
ClangOffloadPackager
105104
ClangRepl
106105
ClangSYCLLinker
107106

clang/include/clang/AST/HLSLResource.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ struct ResourceBindingAttrs {
6969
assert(hasImplicitOrderID());
7070
return RegBinding->getImplicitBindingOrderID();
7171
}
72+
73+
void setImplicitOrderID(unsigned Value) const {
74+
assert(hasBinding() && !isExplicit() && !hasImplicitOrderID());
75+
RegBinding->setImplicitBindingOrderID(Value);
76+
}
7277
};
7378

7479
} // namespace hlsl

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

0 commit comments

Comments
 (0)