Skip to content

Commit db4eb0d

Browse files
authored
Merge branch 'main' into users/svkeerthy/10-08-ir2vec-fa-refactor
2 parents 727a6b8 + b7e256d commit db4eb0d

File tree

25 files changed

+636
-71
lines changed

25 files changed

+636
-71
lines changed

.ci/generate_test_report_github.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
import generate_test_report_lib
1010

11-
PLATFORM_TITLES = {
12-
"Windows": ":window: Windows x64 Test Results",
13-
"Linux": ":penguin: Linux x64 Test Results",
14-
}
11+
def compute_platform_title() -> str:
12+
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
13+
# On Linux the machine value is x86_64 on Windows it is AMD64.
14+
if platform.machine() == "x86_64" or platform.machine() == "AMD64":
15+
arch = "x64"
16+
else:
17+
arch = platform.machine()
18+
return f"{logo} {platform.system()} {arch} Test Results"
19+
1520

1621
if __name__ == "__main__":
1722
parser = argparse.ArgumentParser()
@@ -22,7 +27,7 @@
2227
args = parser.parse_args()
2328

2429
report = generate_test_report_lib.generate_report_from_files(
25-
PLATFORM_TITLES[platform.system()], args.return_code, args.build_test_logs
30+
compute_platform_title(), args.return_code, args.build_test_logs
2631
)
2732

2833
print(report)

.ci/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function start-group {
5656
export PIP_BREAK_SYSTEM_PACKAGES=1
5757
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5858

59-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
59+
# The ARM64 builders run on AWS and don't have access to the GCS cache.
60+
if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
6061
python .ci/cache_lit_timing_files.py download
6162
fi

.github/workflows/premerge.yaml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,45 @@ concurrency:
2424

2525
jobs:
2626
premerge-checks-linux:
27-
name: Build and Test Linux
27+
name: Build and Test Linux${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && ' AArch64') || '' }}
2828
if: >-
2929
github.repository_owner == 'llvm' &&
3030
(github.event_name != 'pull_request' || github.event.action != 'closed')
31-
runs-on: llvm-premerge-linux-runners
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
runs-on:
35+
- depot-ubuntu-24.04-arm-16
36+
- llvm-premerge-linux-runners
37+
runs-on: ${{ matrix.runs-on }}
38+
container:
39+
# The llvm-premerge agents are already containers and running the
40+
# this same image, so we can't use a container for the github action
41+
# job. The depot containers are running on VMs, so we can use a
42+
# container. This helps ensure the build environment is as close
43+
# as possible on both the depot runners and the llvm-premerge runners.
44+
image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && format('ghcr.io/{0}/arm64v8/ci-ubuntu-24.04',github.repository_owner) ) || null }}
45+
# --privileged is needed to run the lldb tests that disable aslr.
46+
# The SCCACHE environment variables are need to be copied from the host
47+
# to the container to make sure it is configured correctly to use the
48+
# depot cache.
49+
options: >-
50+
--privileged
51+
--env SCCACHE_WEBDAV_ENDPOINT
52+
--env SCCACHE_WEBDAV_TOKEN
53+
defaults:
54+
run:
55+
# The run step defaults to using sh as the shell when running in a
56+
# container, so make bash the default to ensure consistency between
57+
# container and non-container jobs.
58+
shell: bash
3259
steps:
3360
- name: Checkout LLVM
3461
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3562
with:
3663
fetch-depth: 2
3764
- name: Build and Test
65+
continue-on-error: ${{ runner.arch == 'ARM64' }}
3866
run: |
3967
git config --global --add safe.directory '*'
4068
@@ -54,11 +82,16 @@ jobs:
5482
export CC=/opt/llvm/bin/clang
5583
export CXX=/opt/llvm/bin/clang++
5684
57-
# This environment variable is passes into the container through the
58-
# runner pod definition. This differs between our two clusters which
59-
# why we do not hardcode it.
60-
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
61-
export SCCACHE_GCS_RW_MODE=READ_WRITE
85+
# The linux-premerge runners are hosted on GCP and have a different
86+
# cache setup than the depot runners.
87+
if [[ "${{ matrix.runs-on }}" = "llvm-premerge-linux-runners" ]]; then
88+
# This environment variable is passes into the container through the
89+
# runner pod definition. This differs between our two clusters which
90+
# why we do not hardcode it.
91+
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
92+
export SCCACHE_GCS_RW_MODE=READ_WRITE
93+
fi
94+
env
6295
6396
# Set the idle timeout to zero to ensure sccache runs for the
6497
# entire duration of the job. Otherwise it might stop if we run
@@ -78,7 +111,7 @@ jobs:
78111
if: '!cancelled()'
79112
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
80113
with:
81-
name: Premerge Artifacts (Linux)
114+
name: Premerge Artifacts (Linux ${{ runner.arch }})
82115
path: artifacts/
83116
retention-days: 5
84117
include-hidden-files: 'true'

clang/include/clang/AST/OpenACCClause.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,13 +1280,31 @@ class OpenACCCreateClause final
12801280
// 'main' declaration used for initializaiton, which is fixed.
12811281
struct OpenACCReductionRecipe {
12821282
VarDecl *AllocaDecl;
1283-
// TODO: OpenACC: this should eventually have the operations here too.
12841283

1285-
OpenACCReductionRecipe(VarDecl *A) : AllocaDecl(A) {}
1284+
// A combiner recipe is represented by an operation expression. However, in
1285+
// order to generate these properly, we have to make up a LHS and a RHS
1286+
// expression for the purposes of generation.
1287+
struct CombinerRecipe {
1288+
VarDecl *LHS;
1289+
VarDecl *RHS;
1290+
Expr *Op;
1291+
};
1292+
1293+
// Contains a collection of the recipe elements we need for the combiner:
1294+
// -For Scalars, there will be 1 element, just the combiner for that scalar.
1295+
// -For a struct with a valid operator, this will be 1 element, just that
1296+
// call.
1297+
// -For a struct without the operator, this will be 1 element per field, which
1298+
// should be the combiner for that element.
1299+
// -For an array of any of the above, it will be the above for the element.
1300+
llvm::SmallVector<CombinerRecipe, 1> CombinerRecipes;
1301+
1302+
OpenACCReductionRecipe(VarDecl *A, llvm::ArrayRef<CombinerRecipe> Combiners)
1303+
: AllocaDecl(A), CombinerRecipes(Combiners) {}
12861304

12871305
bool isSet() const { return AllocaDecl; }
12881306
static OpenACCReductionRecipe Empty() {
1289-
return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr);
1307+
return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr, {});
12901308
}
12911309
};
12921310

clang/lib/AST/StmtProfile.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,10 +2769,19 @@ void OpenACCClauseProfiler::VisitReductionClause(
27692769

27702770
for (auto &Recipe : Clause.getRecipes()) {
27712771
Profiler.VisitDecl(Recipe.AllocaDecl);
2772+
27722773
// TODO: OpenACC: Make sure we remember to update this when we figure out
27732774
// what we're adding for the operation recipe, in the meantime, a static
27742775
// assert will make sure we don't add something.
2775-
static_assert(sizeof(OpenACCReductionRecipe) == sizeof(int *));
2776+
static_assert(sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
2777+
3 * sizeof(int *));
2778+
for (auto &CombinerRecipe : Recipe.CombinerRecipes) {
2779+
if (CombinerRecipe.Op) {
2780+
Profiler.VisitDecl(CombinerRecipe.LHS);
2781+
Profiler.VisitDecl(CombinerRecipe.RHS);
2782+
Profiler.VisitStmt(CombinerRecipe.Op);
2783+
}
2784+
}
27762785
}
27772786
}
27782787

clang/lib/Sema/SemaOpenACC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2946,5 +2946,5 @@ OpenACCReductionRecipe SemaOpenACC::CreateReductionInitRecipe(
29462946
AllocaDecl->setInit(Init.get());
29472947
AllocaDecl->setInitStyle(VarDecl::CallInit);
29482948
}
2949-
return OpenACCReductionRecipe(AllocaDecl);
2949+
return OpenACCReductionRecipe(AllocaDecl, {});
29502950
}

clang/lib/Serialization/ASTReader.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13009,9 +13009,22 @@ OpenACCClause *ASTRecordReader::readOpenACCClause() {
1300913009
llvm::SmallVector<OpenACCReductionRecipe> RecipeList;
1301013010

1301113011
for (unsigned I = 0; I < VarList.size(); ++I) {
13012-
static_assert(sizeof(OpenACCReductionRecipe) == sizeof(int *));
1301313012
VarDecl *Recipe = readDeclAs<VarDecl>();
13014-
RecipeList.push_back({Recipe});
13013+
13014+
static_assert(sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
13015+
3 * sizeof(int *));
13016+
13017+
llvm::SmallVector<OpenACCReductionRecipe::CombinerRecipe> Combiners;
13018+
unsigned NumCombiners = readInt();
13019+
for (unsigned I = 0; I < NumCombiners; ++I) {
13020+
VarDecl *LHS = readDeclAs<VarDecl>();
13021+
VarDecl *RHS = readDeclAs<VarDecl>();
13022+
Expr *Op = readExpr();
13023+
13024+
Combiners.push_back({LHS, RHS, Op});
13025+
}
13026+
13027+
RecipeList.push_back({Recipe, Combiners});
1301513028
}
1301613029

1301713030
return OpenACCReductionClause::Create(getContext(), BeginLoc, LParenLoc, Op,

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8925,8 +8925,17 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
89258925
writeOpenACCVarList(RC);
89268926

89278927
for (const OpenACCReductionRecipe &R : RC->getRecipes()) {
8928-
static_assert(sizeof(OpenACCReductionRecipe) == 1 * sizeof(int *));
89298928
AddDeclRef(R.AllocaDecl);
8929+
8930+
static_assert(sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
8931+
3 * sizeof(int *));
8932+
writeUInt32(R.CombinerRecipes.size());
8933+
8934+
for (auto &CombinerRecipe : R.CombinerRecipes) {
8935+
AddDeclRef(CombinerRecipe.LHS);
8936+
AddDeclRef(CombinerRecipe.RHS);
8937+
AddStmt(CombinerRecipe.Op);
8938+
}
89308939
}
89318940
return;
89328941
}

clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefMemberChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class RawPtrRefMemberChecker
232232
bool ignoreARC =
233233
!PD->isReadOnly() && PD->getSetterKind() == ObjCPropertyDecl::Assign;
234234
auto IsUnsafePtr = isUnsafePtr(QT, ignoreARC);
235-
return {IsUnsafePtr && *IsUnsafePtr, PropType};
235+
return {IsUnsafePtr && *IsUnsafePtr && !PD->isRetaining(), PropType};
236236
}
237237

238238
bool shouldSkipDecl(const RecordDecl *RD) const {

clang/test/Analysis/Checkers/WebKit/unretained-members.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ @interface AnotherObject : NSObject {
113113
// expected-warning@-1{{Instance variable 'dispatch' in 'AnotherObject' is a retainable type 'dispatch_queue_t'}}
114114
}
115115
@property(nonatomic, readonly, strong) NSString *prop_string;
116-
// expected-warning@-1{{Property 'prop_string' in 'AnotherObject' is a raw pointer to retainable type 'NSString'; member variables must be a RetainPtr}}
117116
@property(nonatomic, readonly) NSString *prop_safe;
118117
@end
119118

@@ -132,7 +131,6 @@ @interface DerivedObject : AnotherObject {
132131
// expected-warning@-1{{Instance variable 'os_dispatch' in 'DerivedObject' is a retainable type 'dispatch_queue_t'}}
133132
}
134133
@property(nonatomic, strong) NSNumber *prop_number;
135-
// expected-warning@-1{{Property 'prop_number' in 'DerivedObject' is a raw pointer to retainable type 'NSNumber'; member variables must be a RetainPtr}}
136134
@property(nonatomic, readonly) NSString *prop_string;
137135
@end
138136

@@ -178,12 +176,12 @@ @interface NoSynthObject : NSObject {
178176
}
179177
@property(nonatomic, readonly, strong) NSString *prop_string1;
180178
@property(nonatomic, readonly, strong) NSString *prop_string2;
181-
// expected-warning@-1{{Property 'prop_string2' in 'NoSynthObject' is a raw pointer to retainable type 'NSString'}}
182179
@property(nonatomic, assign) NSString *prop_string3;
183180
// expected-warning@-1{{Property 'prop_string3' in 'NoSynthObject' is a raw pointer to retainable type 'NSString'; member variables must be a RetainPtr}}
184181
@property(nonatomic, unsafe_unretained) NSString *prop_string4;
185182
// expected-warning@-1{{Property 'prop_string4' in 'NoSynthObject' is a raw pointer to retainable type 'NSString'; member variables must be a RetainPtr}}
186-
@property(nonatomic, readonly, strong) NSString *dispatch;
183+
@property(nonatomic, copy) NSString *prop_string5;
184+
@property(nonatomic, readonly, strong) dispatch_queue_t dispatch;
187185
@end
188186

189187
@implementation NoSynthObject
@@ -193,6 +191,7 @@ - (NSString *)prop_string1 {
193191
@synthesize prop_string2;
194192
@synthesize prop_string3;
195193
@synthesize prop_string4;
194+
@synthesize prop_string5;
196195
- (dispatch_queue_t)dispatch {
197196
return nil;
198197
}

0 commit comments

Comments
 (0)