Skip to content

Commit a551db5

Browse files
committed
Merge from 'master' to 'sycl-web' (#8)
CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticSemaKinds.td
2 parents 030a52d + 3aec298 commit a551db5

File tree

17 files changed

+71
-169
lines changed

17 files changed

+71
-169
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10811,12 +10811,6 @@ def err_matrix_separate_incomplete_index: Error<
1081110811
def err_matrix_subscript_comma: Error<
1081210812
"comma expressions are not allowed as indices in matrix subscript expressions">;
1081310813

10814-
def warn_mismatched_import : Warning<
10815-
"import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
10816-
"previous declaration">;
10817-
def warn_import_on_definition : Warning<
10818-
"import %select{module|name}0 cannot be applied to a function with a definition">;
10819-
1082010814
// SYCL-specific diagnostics
1082110815
def err_sycl_kernel_incorrectly_named : Error<
1082210816
"kernel %select{name is missing"

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,10 +3153,6 @@ class Sema final {
31533153
const InternalLinkageAttr &AL);
31543154
CommonAttr *mergeCommonAttr(Decl *D, const ParsedAttr &AL);
31553155
CommonAttr *mergeCommonAttr(Decl *D, const CommonAttr &AL);
3156-
WebAssemblyImportNameAttr *mergeImportNameAttr(
3157-
Decl *D, const WebAssemblyImportNameAttr &AL);
3158-
WebAssemblyImportModuleAttr *mergeImportModuleAttr(
3159-
Decl *D, const WebAssemblyImportModuleAttr &AL);
31603156

31613157
void mergeDeclAttributes(NamedDecl *New, Decl *Old,
31623158
AvailabilityMergeKind AMK = AMK_Redeclaration);

clang/lib/Sema/SemaDecl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,10 +2598,6 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
25982598
NewAttr = S.mergeSpeculativeLoadHardeningAttr(D, *SLHA);
25992599
else if (const auto *SLHA = dyn_cast<NoSpeculativeLoadHardeningAttr>(Attr))
26002600
NewAttr = S.mergeNoSpeculativeLoadHardeningAttr(D, *SLHA);
2601-
else if (const auto *IMA = dyn_cast<WebAssemblyImportModuleAttr>(Attr))
2602-
NewAttr = S.mergeImportModuleAttr(D, *IMA);
2603-
else if (const auto *INA = dyn_cast<WebAssemblyImportNameAttr>(Attr))
2604-
NewAttr = S.mergeImportNameAttr(D, *INA);
26052601
else if (Attr->shouldInheritEvenIfAlreadyPresent() || !DeclHasAttr(D, Attr))
26062602
NewAttr = cast<InheritableAttr>(Attr->clone(S.Context));
26072603

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6467,75 +6467,45 @@ static void handleWebAssemblyExportNameAttr(Sema &S, Decl *D, const ParsedAttr &
64676467
D->addAttr(UsedAttr::CreateImplicit(S.Context));
64686468
}
64696469

6470-
WebAssemblyImportModuleAttr *
6471-
Sema::mergeImportModuleAttr(Decl *D, const WebAssemblyImportModuleAttr &AL) {
6472-
auto *FD = cast<FunctionDecl>(D);
6473-
6474-
if (const auto *ExistingAttr = FD->getAttr<WebAssemblyImportModuleAttr>()) {
6475-
if (ExistingAttr->getImportModule() == AL.getImportModule())
6476-
return nullptr;
6477-
Diag(ExistingAttr->getLocation(), diag::warn_mismatched_import) << 0
6478-
<< ExistingAttr->getImportModule() << AL.getImportModule();
6479-
Diag(AL.getLoc(), diag::note_previous_attribute);
6480-
return nullptr;
6481-
}
6482-
if (FD->hasBody()) {
6483-
Diag(AL.getLoc(), diag::warn_import_on_definition) << 0;
6484-
return nullptr;
6470+
static void handleWebAssemblyImportModuleAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
6471+
if (!isFunctionOrMethod(D)) {
6472+
S.Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
6473+
<< "'import_module'" << ExpectedFunction;
6474+
return;
64856475
}
6486-
return ::new (Context) WebAssemblyImportModuleAttr(Context, AL,
6487-
AL.getImportModule());
6488-
}
64896476

6490-
WebAssemblyImportNameAttr *
6491-
Sema::mergeImportNameAttr(Decl *D, const WebAssemblyImportNameAttr &AL) {
64926477
auto *FD = cast<FunctionDecl>(D);
6493-
6494-
if (const auto *ExistingAttr = FD->getAttr<WebAssemblyImportNameAttr>()) {
6495-
if (ExistingAttr->getImportName() == AL.getImportName())
6496-
return nullptr;
6497-
Diag(ExistingAttr->getLocation(), diag::warn_mismatched_import) << 1
6498-
<< ExistingAttr->getImportName() << AL.getImportName();
6499-
Diag(AL.getLoc(), diag::note_previous_attribute);
6500-
return nullptr;
6501-
}
6502-
if (FD->hasBody()) {
6503-
Diag(AL.getLoc(), diag::warn_import_on_definition) << 1;
6504-
return nullptr;
6478+
if (FD->isThisDeclarationADefinition()) {
6479+
S.Diag(D->getLocation(), diag::err_alias_is_definition) << FD << 0;
6480+
return;
65056481
}
6506-
return ::new (Context) WebAssemblyImportNameAttr(Context, AL,
6507-
AL.getImportName());
6508-
}
6509-
6510-
static void
6511-
handleWebAssemblyImportModuleAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
6512-
auto *FD = cast<FunctionDecl>(D);
65136482

65146483
StringRef Str;
65156484
SourceLocation ArgLoc;
65166485
if (!S.checkStringLiteralArgumentAttr(AL, 0, Str, &ArgLoc))
65176486
return;
6518-
if (FD->hasBody()) {
6519-
S.Diag(AL.getLoc(), diag::warn_import_on_definition) << 0;
6520-
return;
6521-
}
65226487

65236488
FD->addAttr(::new (S.Context)
65246489
WebAssemblyImportModuleAttr(S.Context, AL, Str));
65256490
}
65266491

6527-
static void
6528-
handleWebAssemblyImportNameAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
6492+
static void handleWebAssemblyImportNameAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
6493+
if (!isFunctionOrMethod(D)) {
6494+
S.Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
6495+
<< "'import_name'" << ExpectedFunction;
6496+
return;
6497+
}
6498+
65296499
auto *FD = cast<FunctionDecl>(D);
6500+
if (FD->isThisDeclarationADefinition()) {
6501+
S.Diag(D->getLocation(), diag::err_alias_is_definition) << FD << 0;
6502+
return;
6503+
}
65306504

65316505
StringRef Str;
65326506
SourceLocation ArgLoc;
65336507
if (!S.checkStringLiteralArgumentAttr(AL, 0, Str, &ArgLoc))
65346508
return;
6535-
if (FD->hasBody()) {
6536-
S.Diag(AL.getLoc(), diag::warn_import_on_definition) << 1;
6537-
return;
6538-
}
65396509

65406510
FD->addAttr(::new (S.Context) WebAssemblyImportNameAttr(S.Context, AL, Str));
65416511
}

clang/test/AST/ast-dump-wasm-attr-export.c

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

clang/test/AST/ast-dump-wasm-attr-import.c

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

clang/test/Driver/hip-include-path.hip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
// NOWRAP-NOT: clang/{{.*}}/include/cuda_wrappers
2020
// HIP: {{.*}}Inputs/rocm/include
2121
// NOHIP-NOT: {{.*}}Inputs/rocm/include
22-
// COMMON: {{.*}}include/c++
22+
// skip check of standard C++ include path
2323
// COMMON: clang/{{.*}}/include
2424

2525
// COMMON-LABEL: clang{{.*}} -cc1 -triple x86_64
2626
// WRAP: clang/{{.*}}/include/cuda_wrappers
2727
// NOWRAP-NOT: clang/{{.*}}/include/cuda_wrappers
2828
// HIP: {{.*}}Inputs/rocm/include
2929
// NOHIP-NOT: {{.*}}Inputs/rocm/include
30-
// COMMON: {{.*}}include/c++
30+
// skip check of standard C++ include path
3131
// COMMON: clang/{{.*}}/include

clang/test/Sema/attr-wasm.c

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

llvm/include/llvm/IR/IntrinsicsAMDGPU.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ class AMDGPUBufferAtomicNoRtn : Intrinsic <
17251725
llvm_i32_ty, // vindex(VGPR)
17261726
llvm_i32_ty, // offset(SGPR/VGPR/imm)
17271727
llvm_i1_ty], // slc(imm)
1728-
[], "", [SDNPMemOperand]>,
1728+
[ImmArg<ArgIndex<4>>], "", [SDNPMemOperand]>,
17291729
AMDGPURsrcIntrinsic<1, 0>;
17301730

17311731
class AMDGPUGlobalAtomicNoRtn : Intrinsic <

llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
216216

217217
bool InsertExport = false;
218218

219+
bool Changed = false;
219220
for (BasicBlock *BB : PDT.getRoots()) {
220221
if (isa<ReturnInst>(BB->getTerminator())) {
221222
if (!isUniformlyReached(DA, *BB))
@@ -281,6 +282,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
281282
BB->getTerminator()->eraseFromParent();
282283
BranchInst::Create(TransitionBB, DummyReturnBB, BoolTrue, BB);
283284
}
285+
Changed = true;
284286
}
285287
}
286288

@@ -299,6 +301,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
299301
BB->getTerminator()->eraseFromParent();
300302
BranchInst::Create(UnreachableBlock, BB);
301303
}
304+
Changed = true;
302305
}
303306

304307
if (!ReturningBlocks.empty()) {
@@ -322,15 +325,16 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
322325
// actually reached here.
323326
ReturnInst::Create(F.getContext(), RetVal, UnreachableBlock);
324327
ReturningBlocks.push_back(UnreachableBlock);
328+
Changed = true;
325329
}
326330
}
327331

328332
// Now handle return blocks.
329333
if (ReturningBlocks.empty())
330-
return false; // No blocks return
334+
return Changed; // No blocks return
331335

332336
if (ReturningBlocks.size() == 1 && !InsertExport)
333-
return false; // Already has a single return block
337+
return Changed; // Already has a single return block
334338

335339
const TargetTransformInfo &TTI
336340
= getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);

0 commit comments

Comments
 (0)