Skip to content

Commit 4684014

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:898d52b819496ba70d0ca29cc7b60237108ae2b4 into amd-gfx:a6bdf8d91f90
Local branch amd-gfx a6bdf8d Merged main:41b55071a13374654a290c01224eb066c38dc87a into amd-gfx:20624ccc2ecf Remote branch main 898d52b [compiler-rt][rtsan] Fix failing file permissions test by checking umask (llvm#106095)
2 parents a6bdf8d + 898d52b commit 4684014

File tree

38 files changed

+1479
-464
lines changed

38 files changed

+1479
-464
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ Bug Fixes to C++ Support
317317
- Clang now properly handles the order of attributes in `extern` blocks. (#GH101990).
318318
- Fixed an assertion failure by preventing null explicit object arguments from being deduced. (#GH102025).
319319
- Correctly check constraints of explicit instantiations of member functions. (#GH46029)
320+
- When performing partial ordering of function templates, clang now checks that
321+
the deduction was consistent. Fixes (#GH18291).
320322
- Fixed an assertion failure about a constraint of a friend function template references to a value with greater
321323
template depth than the friend function template. (#GH98258)
322324
- Clang now rebuilds the template parameters of out-of-line declarations and specializations in the context

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,9 @@ BUILTIN(__nvvm_atom_xor_gen_ll, "LLiLLiD*LLi", "n")
844844
TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_ll, "LLiLLiD*LLi", "n", SM_60)
845845
TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_ll, "LLiLLiD*LLi", "n", SM_60)
846846

847+
TARGET_BUILTIN(__nvvm_atom_cas_gen_us, "UsUsD*UsUs", "n", SM_70)
848+
TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_us, "UsUsD*UsUs", "n", SM_70)
849+
TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_us, "UsUsD*UsUs", "n", SM_70)
847850
BUILTIN(__nvvm_atom_cas_gen_i, "iiD*ii", "n")
848851
TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_i, "iiD*ii", "n", SM_60)
849852
TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_i, "iiD*ii", "n", SM_60)

clang/include/clang/Sema/Sema.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13283,6 +13283,10 @@ class Sema final : public SemaBase {
1328313283
/// \param AllowDeducedTST Whether a DeducedTemplateSpecializationType is
1328413284
/// acceptable as the top level type of the result.
1328513285
///
13286+
/// \param IsIncompleteSubstitution If provided, the pointee will be set
13287+
/// whenever substitution would perform a replacement with a null or
13288+
/// non-existent template argument.
13289+
///
1328613290
/// \returns If the instantiation succeeds, the instantiated
1328713291
/// type. Otherwise, produces diagnostics and returns a NULL type.
1328813292
TypeSourceInfo *SubstType(TypeSourceInfo *T,
@@ -13292,7 +13296,8 @@ class Sema final : public SemaBase {
1329213296

1329313297
QualType SubstType(QualType T,
1329413298
const MultiLevelTemplateArgumentList &TemplateArgs,
13295-
SourceLocation Loc, DeclarationName Entity);
13299+
SourceLocation Loc, DeclarationName Entity,
13300+
bool *IsIncompleteSubstitution = nullptr);
1329613301

1329713302
TypeSourceInfo *SubstType(TypeLoc TL,
1329813303
const MultiLevelTemplateArgumentList &TemplateArgs,

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20344,6 +20344,7 @@ Value *CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID,
2034420344
case NVPTX::BI__nvvm_atom_min_gen_ull:
2034520345
return MakeBinaryAtomicValue(*this, llvm::AtomicRMWInst::UMin, E);
2034620346

20347+
case NVPTX::BI__nvvm_atom_cas_gen_us:
2034720348
case NVPTX::BI__nvvm_atom_cas_gen_i:
2034820349
case NVPTX::BI__nvvm_atom_cas_gen_l:
2034920350
case NVPTX::BI__nvvm_atom_cas_gen_ll:
@@ -20535,6 +20536,7 @@ Value *CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID,
2053520536
case NVPTX::BI__nvvm_atom_sys_xor_gen_l:
2053620537
case NVPTX::BI__nvvm_atom_sys_xor_gen_ll:
2053720538
return MakeScopedAtomic(Intrinsic::nvvm_atomic_xor_gen_i_sys, *this, E);
20539+
case NVPTX::BI__nvvm_atom_cta_cas_gen_us:
2053820540
case NVPTX::BI__nvvm_atom_cta_cas_gen_i:
2053920541
case NVPTX::BI__nvvm_atom_cta_cas_gen_l:
2054020542
case NVPTX::BI__nvvm_atom_cta_cas_gen_ll: {
@@ -20546,6 +20548,7 @@ Value *CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID,
2054620548
Intrinsic::nvvm_atomic_cas_gen_i_cta, {ElemTy, Ptr->getType()}),
2054720549
{Ptr, EmitScalarExpr(E->getArg(1)), EmitScalarExpr(E->getArg(2))});
2054820550
}
20551+
case NVPTX::BI__nvvm_atom_sys_cas_gen_us:
2054920552
case NVPTX::BI__nvvm_atom_sys_cas_gen_i:
2055020553
case NVPTX::BI__nvvm_atom_sys_cas_gen_l:
2055120554
case NVPTX::BI__nvvm_atom_sys_cas_gen_ll: {

clang/lib/Headers/__clang_cuda_device_functions.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,20 @@ __DEVICE__ void __threadfence(void) { __nvvm_membar_gl(); }
529529
__DEVICE__ void __threadfence_block(void) { __nvvm_membar_cta(); };
530530
__DEVICE__ void __threadfence_system(void) { __nvvm_membar_sys(); };
531531
__DEVICE__ void __trap(void) { __asm__ __volatile__("trap;"); }
532+
__DEVICE__ unsigned short
533+
__usAtomicCAS(unsigned short *__p, unsigned short __cmp, unsigned short __v) {
534+
return __nvvm_atom_cas_gen_us(__p, __cmp, __v);
535+
}
536+
__DEVICE__ unsigned short __usAtomicCAS_block(unsigned short *__p,
537+
unsigned short __cmp,
538+
unsigned short __v) {
539+
return __nvvm_atom_cta_cas_gen_us(__p, __cmp, __v);
540+
}
541+
__DEVICE__ unsigned short __usAtomicCAS_system(unsigned short *__p,
542+
unsigned short __cmp,
543+
unsigned short __v) {
544+
return __nvvm_atom_sys_cas_gen_us(__p, __cmp, __v);
545+
}
532546
__DEVICE__ unsigned int __uAtomicAdd(unsigned int *__p, unsigned int __v) {
533547
return __nvvm_atom_add_gen_i((int *)__p, __v);
534548
}

0 commit comments

Comments
 (0)