Skip to content

Commit 5fd0352

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:21e6f16517b9 into amd-gfx:4a184c07f200
Local branch amd-gfx 4a184c0 Merged main:40acaa394fa2 into amd-gfx:abc91debd3ba Remote branch main 21e6f16 [libc++] Mark N4089 as complete
2 parents 4a184c0 + 21e6f16 commit 5fd0352

File tree

17 files changed

+105
-78
lines changed

17 files changed

+105
-78
lines changed

clang/lib/Basic/Targets/X86.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,6 @@ class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
832832
"i64:64-i128:128-f80:128-n8:16:32:64-S128");
833833
}
834834

835-
void getTargetDefines(const LangOptions &Opts,
836-
MacroBuilder &Builder) const override {
837-
getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
838-
}
839-
840835
BuiltinVaListKind getBuiltinVaListKind() const override {
841836
return TargetInfo::CharPtrBuiltinVaList;
842837
}

clang/lib/Driver/ToolChains/UEFI.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ UEFI::UEFI(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
3535

3636
Tool *UEFI::buildLinker() const { return new tools::uefi::Linker(*this); }
3737

38+
void UEFI::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
39+
ArgStringList &CC1Args) const {
40+
if (DriverArgs.hasArg(options::OPT_nostdinc))
41+
return;
42+
43+
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
44+
SmallString<128> Dir(getDriver().ResourceDir);
45+
llvm::sys::path::append(Dir, "include");
46+
addSystemInclude(DriverArgs, CC1Args, Dir.str());
47+
}
48+
49+
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
50+
return;
51+
52+
if (std::optional<std::string> Path = getStdlibIncludePath())
53+
addSystemInclude(DriverArgs, CC1Args, *Path);
54+
}
55+
3856
void tools::uefi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
3957
const InputInfo &Output,
4058
const InputInfoList &Inputs,

clang/lib/Driver/ToolChains/UEFI.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class LLVM_LIBRARY_VISIBILITY UEFI : public ToolChain {
5151
return false;
5252
}
5353
bool isPICDefaultForced() const override { return true; }
54+
55+
void
56+
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
57+
llvm::opt::ArgStringList &CC1Args) const override;
5458
};
5559

5660
} // namespace toolchains

clang/lib/Lex/InitHeaderSearch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
301301
case llvm::Triple::PS5:
302302
case llvm::Triple::RTEMS:
303303
case llvm::Triple::Solaris:
304+
case llvm::Triple::UEFI:
304305
case llvm::Triple::WASI:
305306
case llvm::Triple::ZOS:
306307
return false;

clang/lib/Serialization/MultiOnDiskHashTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template<typename Info> class MultiOnDiskHashTable {
9393
using result_type = OnDiskTable *;
9494

9595
result_type operator()(void *P) const {
96-
return Table::getFromOpaqueValue(P).template get<OnDiskTable *>();
96+
return llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(P));
9797
}
9898
};
9999

@@ -130,7 +130,7 @@ template<typename Info> class MultiOnDiskHashTable {
130130
Files.insert(PendingOverrides.begin(), PendingOverrides.end());
131131
// Explicitly capture Files to work around an MSVC 2015 rejects-valid bug.
132132
auto ShouldRemove = [&Files](void *T) -> bool {
133-
auto *ODT = Table::getFromOpaqueValue(T).template get<OnDiskTable *>();
133+
auto *ODT = llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(T));
134134
bool Remove = Files.count(ODT->File);
135135
if (Remove)
136136
delete ODT;

libcxx/docs/Status/Cxx17Papers.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Paper #","Paper Name","Meeting","Status","First released version","Notes"
22
"`N3911 <https://wg21.link/N3911>`__","TransformationTrait Alias ``void_t``\ .","2014-11 (Urbana)","|Complete|","3.6",""
3-
"`N4089 <https://wg21.link/N4089>`__","Safe conversions in ``unique_ptr<T[]>``\ .","2014-11 (Urbana)","|In Progress|","3.9",""
3+
"`N4089 <https://wg21.link/N4089>`__","Safe conversions in ``unique_ptr<T[]>``\ .","2014-11 (Urbana)","|Complete|","5",""
44
"`N4169 <https://wg21.link/N4169>`__","A proposal to add invoke function template","2014-11 (Urbana)","|Complete|","3.7",""
55
"`N4190 <https://wg21.link/N4190>`__","Removing auto_ptr, random_shuffle(), And Old <functional> Stuff.","2014-11 (Urbana)","|Complete|","15",""
66
"`N4258 <https://wg21.link/N4258>`__","Cleaning-up noexcept in the Library.","2014-11 (Urbana)","|In Progress|","3.7",""
@@ -51,7 +51,7 @@
5151
"`P0137R1 <https://wg21.link/P0137R1>`__","Core Issue 1776: Replacement of class objects containing reference members","2016-06 (Oulu)","|Complete|","6",""
5252
"`P0163R0 <https://wg21.link/P0163R0>`__","shared_ptr::weak_type","2016-06 (Oulu)","|Complete|","3.9",""
5353
"`P0174R2 <https://wg21.link/P0174R2>`__","Deprecating Vestigial Library Parts in C++17","2016-06 (Oulu)","|Complete|","15",""
54-
"`P0175R1 <https://wg21.link/P0175R1>`__","Synopses for the C library","2016-06 (Oulu)","","",""
54+
"`P0175R1 <https://wg21.link/P0175R1>`__","Synopses for the C library","2016-06 (Oulu)","|Nothing To Do|","n/a",""
5555
"`P0180R2 <https://wg21.link/P0180R2>`__","Reserve a New Library Namespace for Future Standardization","2016-06 (Oulu)","|Nothing To Do|","n/a",""
5656
"`P0181R1 <https://wg21.link/P0181R1>`__","Ordered by Default","2016-06 (Oulu)","|Nothing To Do|","n/a","Pulled at the 2017-01 meeting in Kona"
5757
"`P0209R2 <https://wg21.link/P0209R2>`__","make_from_tuple: apply for construction","2016-06 (Oulu)","|Complete|","3.9",""

libcxx/include/__memory/unique_ptr.h

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
492492
bool _Dummy = true,
493493
class = _EnableIfDeleterDefaultConstructible<_Dummy>,
494494
class = _EnableIfPointerConvertible<_Pp> >
495-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Pp __p) _NOEXCEPT
496-
: __ptr_(__p),
495+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Pp __ptr) _NOEXCEPT
496+
: __ptr_(__ptr),
497497
__deleter_() {}
498498

499499
// Private constructor used by make_unique & friends to pass the size that was allocated
@@ -506,37 +506,39 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
506506
bool _Dummy = true,
507507
class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >,
508508
class = _EnableIfPointerConvertible<_Pp> >
509-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT
510-
: __ptr_(__p),
511-
__deleter_(__d) {}
509+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Pp __ptr, _LValRefType<_Dummy> __deleter) _NOEXCEPT
510+
: __ptr_(__ptr),
511+
__deleter_(__deleter) {}
512512

513513
template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
514-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT
514+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, _LValRefType<_Dummy> __deleter) _NOEXCEPT
515515
: __ptr_(nullptr),
516-
__deleter_(__d) {}
516+
__deleter_(__deleter) {}
517517

518518
template <class _Pp,
519519
bool _Dummy = true,
520520
class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >,
521521
class = _EnableIfPointerConvertible<_Pp> >
522-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
523-
: __ptr_(__p),
524-
__deleter_(std::move(__d)) {
522+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
523+
unique_ptr(_Pp __ptr, _GoodRValRefType<_Dummy> __deleter) _NOEXCEPT
524+
: __ptr_(__ptr),
525+
__deleter_(std::move(__deleter)) {
525526
static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
526527
}
527528

528529
template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
529-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
530+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
531+
unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __deleter) _NOEXCEPT
530532
: __ptr_(nullptr),
531-
__deleter_(std::move(__d)) {
533+
__deleter_(std::move(__deleter)) {
532534
static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
533535
}
534536

535537
template <class _Pp,
536538
bool _Dummy = true,
537539
class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >,
538540
class = _EnableIfPointerConvertible<_Pp> >
539-
_LIBCPP_HIDE_FROM_ABI unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
541+
_LIBCPP_HIDE_FROM_ABI unique_ptr(_Pp __ptr, _BadRValRefType<_Dummy> __deleter) = delete;
540542

541543
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT
542544
: __ptr_(__u.release()),
@@ -608,9 +610,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
608610
}
609611

610612
template <class _Pp, __enable_if_t<_CheckArrayPointerConversion<_Pp>::value, int> = 0>
611-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void reset(_Pp __p) _NOEXCEPT {
613+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void reset(_Pp __ptr) _NOEXCEPT {
612614
pointer __tmp = __ptr_;
613-
__ptr_ = __p;
615+
__ptr_ = __ptr;
614616
__checker_ = _BoundsChecker();
615617
if (__tmp)
616618
__deleter_(__tmp);

libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ void test_sfinae() {
103103
using UA2 = std::unique_ptr<A[], const DAC&>;
104104
static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
105105
}
106+
{ // cannot move-convert with reference deleters with different qualifiers
107+
using UA1 = std::unique_ptr<A[], DA&>;
108+
using UA2 = std::unique_ptr<A[], const DA&>;
109+
static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
110+
static_assert(!std::is_assignable<UA2, UA1&&>::value, "");
111+
}
106112
{ // cannot move-convert from unique_ptr<Single>
107113
using UA1 = std::unique_ptr<A[]>;
108114
using UA2 = std::unique_ptr<A>;

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 522221
19+
#define LLVM_MAIN_REVISION 522229
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,10 +1711,9 @@ class ModuleSummaryIndex {
17111711
GlobalValue::GUID OrigGUID) {
17121712
if (OrigGUID == 0 || ValueGUID == OrigGUID)
17131713
return;
1714-
if (OidGuidMap.count(OrigGUID) && OidGuidMap[OrigGUID] != ValueGUID)
1715-
OidGuidMap[OrigGUID] = 0;
1716-
else
1717-
OidGuidMap[OrigGUID] = ValueGUID;
1714+
auto [It, Inserted] = OidGuidMap.try_emplace(OrigGUID, ValueGUID);
1715+
if (!Inserted && It->second != ValueGUID)
1716+
It->second = 0;
17181717
}
17191718

17201719
/// Find the summary for ValueInfo \p VI in module \p ModuleId, or nullptr if

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,9 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags {
16881688
InstructionCost computeCost(ElementCount VF,
16891689
VPCostContext &Ctx) const override;
16901690

1691+
/// Return the ID of the intrinsic.
1692+
Intrinsic::ID getVectorIntrinsicID() const { return VectorIntrinsicID; }
1693+
16911694
/// Return the scalar return type of the intrinsic.
16921695
Type *getResultType() const { return ResultTy; }
16931696

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,24 +1488,23 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
14881488
return new VPReductionEVLRecipe(*Red, EVL, NewMask);
14891489
})
14901490
.Case<VPWidenIntrinsicRecipe>(
1491-
[&](VPWidenIntrinsicRecipe *CInst) -> VPRecipeBase * {
1492-
auto *CI = cast<CallInst>(CInst->getUnderlyingInstr());
1491+
[&](VPWidenIntrinsicRecipe *CallR) -> VPRecipeBase * {
14931492
Intrinsic::ID VPID = VPIntrinsic::getForIntrinsic(
1494-
CI->getCalledFunction()->getIntrinsicID());
1495-
if (VPID == Intrinsic::not_intrinsic)
1496-
return nullptr;
1497-
1498-
SmallVector<VPValue *> Ops(CInst->operands());
1493+
CallR->getVectorIntrinsicID());
1494+
assert(VPID != Intrinsic::not_intrinsic &&
1495+
"Expected vp.casts Instrinsic");
14991496
assert(VPIntrinsic::getMaskParamPos(VPID) &&
15001497
VPIntrinsic::getVectorLengthParamPos(VPID) &&
15011498
"Expected VP intrinsic");
1502-
VPValue *Mask = Plan.getOrAddLiveIn(ConstantInt::getTrue(
1503-
IntegerType::getInt1Ty(CI->getContext())));
1499+
1500+
SmallVector<VPValue *> Ops(CallR->operands());
1501+
VPValue *Mask =
1502+
Plan.getOrAddLiveIn(ConstantInt::getTrue(Ctx));
15041503
Ops.push_back(Mask);
15051504
Ops.push_back(&EVL);
15061505
return new VPWidenIntrinsicRecipe(
1507-
*CI, VPID, Ops, TypeInfo.inferScalarType(CInst),
1508-
CInst->getDebugLoc());
1506+
VPID, Ops, TypeInfo.inferScalarType(CallR),
1507+
CallR->getDebugLoc());
15091508
})
15101509
.Case<VPWidenCastRecipe>(
15111510
[&](VPWidenCastRecipe *CastR) -> VPRecipeBase * {

llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-reduction.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ define float @fmuladd(ptr %a, ptr %b, i64 %n, float %start) {
17271727
; IF-EVL-NEXT: [[TMP14:%.*]] = getelementptr inbounds float, ptr [[B:%.*]], i64 [[TMP11]]
17281728
; IF-EVL-NEXT: [[TMP15:%.*]] = getelementptr inbounds float, ptr [[TMP14]], i32 0
17291729
; IF-EVL-NEXT: [[VP_OP_LOAD1:%.*]] = call <vscale x 4 x float> @llvm.vp.load.nxv4f32.p0(ptr align 4 [[TMP15]], <vscale x 4 x i1> splat (i1 true), i32 [[TMP10]])
1730-
; IF-EVL-NEXT: [[TMP16:%.*]] = call reassoc <vscale x 4 x float> @llvm.vp.fmuladd.nxv4f32(<vscale x 4 x float> [[VP_OP_LOAD]], <vscale x 4 x float> [[VP_OP_LOAD1]], <vscale x 4 x float> [[VEC_PHI]], <vscale x 4 x i1> splat (i1 true), i32 [[TMP10]])
1730+
; IF-EVL-NEXT: [[TMP16:%.*]] = call <vscale x 4 x float> @llvm.vp.fmuladd.nxv4f32(<vscale x 4 x float> [[VP_OP_LOAD]], <vscale x 4 x float> [[VP_OP_LOAD1]], <vscale x 4 x float> [[VEC_PHI]], <vscale x 4 x i1> splat (i1 true), i32 [[TMP10]])
17311731
; IF-EVL-NEXT: [[TMP17]] = call <vscale x 4 x float> @llvm.vp.merge.nxv4f32(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x float> [[TMP16]], <vscale x 4 x float> [[VEC_PHI]], i32 [[TMP10]])
17321732
; IF-EVL-NEXT: [[TMP18:%.*]] = zext i32 [[TMP10]] to i64
17331733
; IF-EVL-NEXT: [[INDEX_EVL_NEXT]] = add i64 [[TMP18]], [[EVL_BASED_IV]]

0 commit comments

Comments
 (0)