Skip to content

Commit 39f7b9d

Browse files
committed
merge main into amd-staging
Change-Id: I71b26ae9391bcd02ebc29549481e1ec704e8ebe8
2 parents dd2f0f7 + 3ff1d01 commit 39f7b9d

File tree

91 files changed

+2938
-1777
lines changed

Some content is hidden

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

91 files changed

+2938
-1777
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ Bug Fixes to C++ Support
958958
(`LWG3929 <https://wg21.link/LWG3929>`__.) (#GH121278)
959959
- Clang now identifies unexpanded parameter packs within the type constraint on a non-type template parameter. (#GH88866)
960960
- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)
961+
- Fixed a crash when __PRETTY_FUNCTION__ or __FUNCSIG__ (clang-cl) appears in the trailing return type of the lambda (#GH121274)
961962

962963
Bug Fixes to AST Handling
963964
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/AST/Expr.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,15 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK,
774774
const FunctionDecl *Decl = FD;
775775
if (const FunctionDecl* Pattern = FD->getTemplateInstantiationPattern())
776776
Decl = Pattern;
777-
const FunctionType *AFT = Decl->getType()->getAs<FunctionType>();
777+
778+
// Bail out if the type of the function has not been set yet.
779+
// This can notably happen in the trailing return type of a lambda
780+
// expression.
781+
const Type *Ty = Decl->getType().getTypePtrOrNull();
782+
if (!Ty)
783+
return "";
784+
785+
const FunctionType *AFT = Ty->getAs<FunctionType>();
778786
const FunctionProtoType *FT = nullptr;
779787
if (FD->hasWrittenPrototype())
780788
FT = dyn_cast<FunctionProtoType>(AFT);

clang/lib/CodeGen/CGStmt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,8 @@ void CodeGenFunction::EmitStmt(const Stmt *S, ArrayRef<const Attr *> Attrs) {
13871387
cast<OMPMasterTaskLoopSimdDirective>(*S));
13881388
break;
13891389
case Stmt::OMPMaskedTaskLoopSimdDirectiveClass:
1390-
llvm_unreachable("masked taskloop simd directive not supported yet.");
1390+
EmitOMPMaskedTaskLoopSimdDirective(
1391+
cast<OMPMaskedTaskLoopSimdDirective>(*S));
13911392
break;
13921393
case Stmt::OMPParallelMasterTaskLoopDirectiveClass:
13931394
EmitOMPParallelMasterTaskLoopDirective(

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8817,6 +8817,18 @@ void CodeGenFunction::EmitOMPMasterTaskLoopSimdDirective(
88178817
CGM.getOpenMPRuntime().emitMasterRegion(*this, CodeGen, S.getBeginLoc());
88188818
}
88198819

8820+
void CodeGenFunction::EmitOMPMaskedTaskLoopSimdDirective(
8821+
const OMPMaskedTaskLoopSimdDirective &S) {
8822+
auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8823+
Action.Enter(CGF);
8824+
EmitOMPTaskLoopBasedDirective(S);
8825+
};
8826+
auto LPCRegion =
8827+
CGOpenMPRuntime::LastprivateConditionalRAII::disable(*this, S);
8828+
OMPLexicalScope Scope(*this, S);
8829+
CGM.getOpenMPRuntime().emitMaskedRegion(*this, CodeGen, S.getBeginLoc());
8830+
}
8831+
88208832
void CodeGenFunction::EmitOMPParallelMasterTaskLoopDirective(
88218833
const OMPParallelMasterTaskLoopDirective &S) {
88228834
auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,8 @@ class CodeGenFunction : public CodeGenTypeCache {
39523952
void EmitOMPMasterTaskLoopDirective(const OMPMasterTaskLoopDirective &S);
39533953
void
39543954
EmitOMPMasterTaskLoopSimdDirective(const OMPMasterTaskLoopSimdDirective &S);
3955+
void
3956+
EmitOMPMaskedTaskLoopSimdDirective(const OMPMaskedTaskLoopSimdDirective &S);
39553957
void EmitOMPParallelMasterTaskLoopDirective(
39563958
const OMPParallelMasterTaskLoopDirective &S);
39573959
void EmitOMPParallelMaskedTaskLoopDirective(

clang/lib/Driver/ToolChains/HIPUtility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
291291

292292
// ToDo: Remove the dummy host binary entry which is required by
293293
// clang-offload-bundler.
294-
std::string BundlerTargetArg = "-targets=host-x86_64-unknown-linux";
294+
std::string BundlerTargetArg = "-targets=host-x86_64-unknown-linux-gnu";
295295
// AMDGCN:
296296
// For code object version 2 and 3, the offload kind in bundle ID is 'hip'
297297
// for backward compatibility. For code object version 4 and greater, the

clang/test/Driver/cuda-arch-translation.cu

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@
8181
// SM61:--image=profile=sm_61{{.*}}
8282
// SM62:--image=profile=sm_62{{.*}}
8383
// SM70:--image=profile=sm_70{{.*}}
84-
// GFX600:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx600
85-
// GFX601:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx601
86-
// GFX602:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx602
87-
// GFX700:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx700
88-
// GFX701:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx701
89-
// GFX702:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx702
90-
// GFX703:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx703
91-
// GFX704:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx704
92-
// GFX705:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx705
93-
// GFX801:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx801
94-
// GFX802:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx802
95-
// GFX803:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803
96-
// GFX805:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx805
97-
// GFX810:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx810
98-
// GFX900:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900
99-
// GFX902:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx902
100-
// SPIRV:-targets=host-x86_64-unknown-linux,hip-spirv64-amd-amdhsa--amdgcnspirv
84+
// GFX600:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx600
85+
// GFX601:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx601
86+
// GFX602:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx602
87+
// GFX700:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx700
88+
// GFX701:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx701
89+
// GFX702:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx702
90+
// GFX703:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx703
91+
// GFX704:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx704
92+
// GFX705:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx705
93+
// GFX801:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx801
94+
// GFX802:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx802
95+
// GFX803:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx803
96+
// GFX805:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx805
97+
// GFX810:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx810
98+
// GFX900:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx900
99+
// GFX902:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx902
100+
// SPIRV:-targets=host-x86_64-unknown-linux-gnu,hip-spirv64-amd-amdhsa--amdgcnspirv

clang/test/Driver/hip-code-object-version.hip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// V4: "-mcode-object-version=4"
99
// V4: "-mllvm" "--amdhsa-code-object-version=4"
10-
// V4: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
10+
// V4: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
1111

1212
// Check bundle ID for code object version 5.
1313

@@ -18,7 +18,7 @@
1818

1919
// V5: "-mcode-object-version=5"
2020
// V5: "-mllvm" "--amdhsa-code-object-version=5"
21-
// V5: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
21+
// V5: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
2222

2323
// Check bundle ID for code object version 6.
2424

@@ -29,7 +29,7 @@
2929

3030
// V6: "-mcode-object-version=6"
3131
// V6: "-mllvm" "--amdhsa-code-object-version=6"
32-
// V6: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
32+
// V6: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
3333

3434

3535
// Check bundle ID for code object version default
@@ -38,7 +38,7 @@
3838
// RUN: --offload-arch=gfx906 -nogpuinc -nogpulib \
3939
// RUN: %s 2>&1 | FileCheck -check-prefix=VD %s
4040

41-
// VD: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
41+
// VD: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
4242

4343
// Check invalid code object version option.
4444

clang/test/Driver/hip-target-id.hip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// CHECK-SAME: "-plugin-opt=-mattr=-sramecc,+xnack"
4444

4545
// CHECK: {{"[^"]*clang-offload-bundler[^"]*"}}
46-
// CHECK-SAME: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+:xnack+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-:xnack+"
46+
// CHECK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+:xnack+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-:xnack+"
4747

4848
// Check canonicalization and repeating of target ID.
4949

@@ -54,7 +54,7 @@
5454
// RUN: --offload-arch=fiji \
5555
// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
5656
// RUN: %s 2>&1 | FileCheck -check-prefix=FIJI %s
57-
// FIJI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803"
57+
// FIJI: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx803"
5858

5959
// RUN: not %clang -### --target=x86_64-linux-gnu \
6060
// RUN: -x hip \
@@ -65,4 +65,4 @@
6565
// RUN: --offload-arch=gfx906 \
6666
// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
6767
// RUN: %s 2>&1 | FileCheck -check-prefix=MULTI %s
68-
// MULTI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900:xnack+,hipv4-amdgcn-amd-amdhsa--gfx900:xnack-,hipv4-amdgcn-amd-amdhsa--gfx906,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-"
68+
// MULTI: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx900:xnack+,hipv4-amdgcn-amd-amdhsa--gfx900:xnack-,hipv4-amdgcn-amd-amdhsa--gfx906,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-"

clang/test/Driver/hipspv-toolchain.hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// CHECK-SAME: [[LOWER_BC]] "-o" "[[SPIRV_OUT:.*out]]"
2525

2626
// CHECK: {{".*clang-offload-bundler"}} "-type=o" "-bundle-align=4096"
27-
// CHECK-SAME: "-targets=host-x86_64-unknown-linux,hip-spirv64----generic"
27+
// CHECK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-spirv64----generic"
2828
// CHECK-SAME: "-input={{.*}}" "-input=[[SPIRV_OUT]]" "-output=[[BUNDLE:.*hipfb]]"
2929

3030
// CHECK: [[CLANG]] "-cc1" "-triple" {{".*"}} "-aux-triple" "spirv64"

0 commit comments

Comments
 (0)