Merge llvm-project release/16.x llvmorg-16.0.3-0-gda3cd333bea5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.3-0-gda3cd333bea5 (aka 16.0.3 release).

PR:		271047
MFC after:	1 month
This commit is contained in:
Dimitry Andric 2023-05-05 19:37:33 +02:00
commit cbe9438cfe
18 changed files with 93 additions and 53 deletions

View file

@ -1963,6 +1963,10 @@ Expr *ignoreImplicitSemaNodes(Expr *E) {
if (auto *Full = dyn_cast<FullExpr>(E))
return Full->getSubExpr();
if (auto *CPLIE = dyn_cast<CXXParenListInitExpr>(E);
CPLIE && CPLIE->getInitExprs().size() == 1)
return CPLIE->getInitExprs()[0];
return E;
}
} // namespace

View file

@ -757,6 +757,13 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
D.Diag(clang::diag::warn_drv_fjmc_for_elf_only);
}
if (Arg *A = Args.getLastArg(options::OPT_femulated_tls,
options::OPT_fno_emulated_tls)) {
bool Enable = A->getOption().getID() == options::OPT_femulated_tls;
CmdArgs.push_back(Args.MakeArgString(
Twine(PluginOptPrefix) + "-emulated-tls=" + (Enable ? "1" : "0")));
}
if (Args.hasFlag(options::OPT_fstack_size_section,
options::OPT_fno_stack_size_section, false))
CmdArgs.push_back(

View file

@ -5420,8 +5420,9 @@ static void TryOrBuildParenListInitialization(
} else if (auto *RT = Entity.getType()->getAs<RecordType>()) {
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
auto BaseRange = map_range(RD->bases(), [&S](auto &base) {
return InitializedEntity::InitializeBase(S.getASTContext(), &base, false);
auto BaseRange = map_range(RD->bases(), [&](auto &base) {
return InitializedEntity::InitializeBase(S.getASTContext(), &base, false,
&Entity);
});
auto FieldRange = map_range(RD->fields(), [](auto *field) {
return InitializedEntity::InitializeMember(field);
@ -9180,6 +9181,8 @@ ExprResult InitializationSequence::Perform(Sema &S,
/*VerifyOnly=*/false, &CurInit);
if (CurInit.get() && ResultType)
*ResultType = CurInit.get()->getType();
if (shouldBindAsTemporary(Entity))
CurInit = S.MaybeBindToTemporary(CurInit.get());
break;
}
}

View file

@ -3137,6 +3137,13 @@ class TreeTransform {
Expr *Sub,
SourceLocation RParenLoc,
bool ListInitialization) {
// If Sub is a ParenListExpr, then Sub is the syntatic form of a
// CXXParenListInitExpr. Pass its expanded arguments so that the
// CXXParenListInitExpr can be rebuilt.
if (auto *PLE = dyn_cast<ParenListExpr>(Sub))
return getSema().BuildCXXTypeConstructExpr(
TInfo, LParenLoc, MultiExprArg(PLE->getExprs(), PLE->getNumExprs()),
RParenLoc, ListInitialization);
return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
MultiExprArg(&Sub, 1), RParenLoc,
ListInitialization);
@ -3866,16 +3873,6 @@ class TreeTransform {
return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
}
ExprResult RebuildCXXParenListInitExpr(ArrayRef<Expr *> Args, QualType T,
unsigned NumUserSpecifiedExprs,
SourceLocation InitLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
return CXXParenListInitExpr::Create(getSema().Context, Args, T,
NumUserSpecifiedExprs, InitLoc,
LParenLoc, RParenLoc);
}
/// Build a new atomic operation expression.
///
/// By default, performs semantic analysis to build the new expression.
@ -14075,9 +14072,8 @@ TreeTransform<Derived>::TransformCXXParenListInitExpr(CXXParenListInitExpr *E) {
TransformedInits))
return ExprError();
return getDerived().RebuildCXXParenListInitExpr(
TransformedInits, E->getType(), E->getUserSpecifiedInitExprs().size(),
E->getInitLoc(), E->getBeginLoc(), E->getEndLoc());
return getDerived().RebuildParenListExpr(E->getBeginLoc(), TransformedInits,
E->getEndLoc());
}
template<typename Derived>

View file

@ -38,7 +38,7 @@
// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 16.0.1 == 16.00.01), _LIBCPP_VERSION is
// defined to XXYYZZ.
# define _LIBCPP_VERSION 160002
# define _LIBCPP_VERSION 160003
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)

View file

@ -436,9 +436,12 @@ void LinkerDriver::parseDirectives(InputFile *file) {
case OPT_editandcontinue:
case OPT_guardsym:
case OPT_throwingnew:
case OPT_inferasanlibs:
case OPT_inferasanlibs_no:
break;
default:
error(arg->getSpelling() + " is not allowed in .drectve");
error(arg->getSpelling() + " is not allowed in .drectve (" +
toString(file) + ")");
}
}
}
@ -1923,6 +1926,9 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
args.hasFlag(OPT_stdcall_fixup, OPT_stdcall_fixup_no, config->mingw);
config->warnStdcallFixup = !args.hasArg(OPT_stdcall_fixup);
if (args.hasFlag(OPT_inferasanlibs, OPT_inferasanlibs_no, false))
warn("ignoring '/inferasanlibs', this flag is not supported");
// Don't warn about long section names, such as .debug_info, for mingw or
// when -debug:dwarf is requested.
if (config->mingw || config->debugDwarf)

View file

@ -194,6 +194,9 @@ defm highentropyva : B<"highentropyva",
defm incremental : B<"incremental",
"Keep original import library if contents are unchanged",
"Overwrite import library even if contents are unchanged">;
defm inferasanlibs : B<"inferasanlibs",
"Unused, generates a warning",
"No effect (default)">;
defm integritycheck : B<"integritycheck",
"Set FORCE_INTEGRITY bit in PE header",
"No effect (default)">;

View file

@ -156,9 +156,12 @@ Status MainLoopPosix::RunImpl::Poll() {
size_t sigset_len;
} extra_data = {&kernel_sigset, sizeof(kernel_sigset)};
if (syscall(__NR_pselect6, nfds, &read_fd_set, nullptr, nullptr, nullptr,
&extra_data) == -1 &&
errno != EINTR)
return Status(errno, eErrorTypePOSIX);
&extra_data) == -1) {
if (errno != EINTR)
return Status(errno, eErrorTypePOSIX);
else
FD_ZERO(&read_fd_set);
}
return Status();
}

View file

@ -175,7 +175,8 @@ bool MachineLateInstrsCleanup::processBlock(MachineBasicBlock *MBB) {
Reg2DefMap &MBBDefs = RegDefs[MBB->getNumber()];
// Find reusable definitions in the predecessor(s).
if (!MBB->pred_empty() && !MBB->isEHPad()) {
if (!MBB->pred_empty() && !MBB->isEHPad() &&
!MBB->isInlineAsmBrIndirectTarget()) {
MachineBasicBlock *FirstPred = *MBB->pred_begin();
for (auto [Reg, DefMI] : RegDefs[FirstPred->getNumber()])
if (llvm::all_of(

View file

@ -1121,7 +1121,7 @@ static const unsigned MaxDepth = 6;
// actual instructions, otherwise return a non-null dummy value. Return nullptr
// on failure.
static Value *takeLog2(IRBuilderBase &Builder, Value *Op, unsigned Depth,
bool DoFold) {
bool AssumeNonZero, bool DoFold) {
auto IfFold = [DoFold](function_ref<Value *()> Fn) {
if (!DoFold)
return reinterpret_cast<Value *>(-1);
@ -1147,14 +1147,18 @@ static Value *takeLog2(IRBuilderBase &Builder, Value *Op, unsigned Depth,
// FIXME: Require one use?
Value *X, *Y;
if (match(Op, m_ZExt(m_Value(X))))
if (Value *LogX = takeLog2(Builder, X, Depth, DoFold))
if (Value *LogX = takeLog2(Builder, X, Depth, AssumeNonZero, DoFold))
return IfFold([&]() { return Builder.CreateZExt(LogX, Op->getType()); });
// log2(X << Y) -> log2(X) + Y
// FIXME: Require one use unless X is 1?
if (match(Op, m_Shl(m_Value(X), m_Value(Y))))
if (Value *LogX = takeLog2(Builder, X, Depth, DoFold))
return IfFold([&]() { return Builder.CreateAdd(LogX, Y); });
if (match(Op, m_Shl(m_Value(X), m_Value(Y)))) {
auto *BO = cast<OverflowingBinaryOperator>(Op);
// nuw will be set if the `shl` is trivially non-zero.
if (AssumeNonZero || BO->hasNoUnsignedWrap() || BO->hasNoSignedWrap())
if (Value *LogX = takeLog2(Builder, X, Depth, AssumeNonZero, DoFold))
return IfFold([&]() { return Builder.CreateAdd(LogX, Y); });
}
// log2(Cond ? X : Y) -> Cond ? log2(X) : log2(Y)
// FIXME: missed optimization: if one of the hands of select is/contains
@ -1162,8 +1166,10 @@ static Value *takeLog2(IRBuilderBase &Builder, Value *Op, unsigned Depth,
// FIXME: can both hands contain undef?
// FIXME: Require one use?
if (SelectInst *SI = dyn_cast<SelectInst>(Op))
if (Value *LogX = takeLog2(Builder, SI->getOperand(1), Depth, DoFold))
if (Value *LogY = takeLog2(Builder, SI->getOperand(2), Depth, DoFold))
if (Value *LogX = takeLog2(Builder, SI->getOperand(1), Depth,
AssumeNonZero, DoFold))
if (Value *LogY = takeLog2(Builder, SI->getOperand(2), Depth,
AssumeNonZero, DoFold))
return IfFold([&]() {
return Builder.CreateSelect(SI->getOperand(0), LogX, LogY);
});
@ -1171,13 +1177,18 @@ static Value *takeLog2(IRBuilderBase &Builder, Value *Op, unsigned Depth,
// log2(umin(X, Y)) -> umin(log2(X), log2(Y))
// log2(umax(X, Y)) -> umax(log2(X), log2(Y))
auto *MinMax = dyn_cast<MinMaxIntrinsic>(Op);
if (MinMax && MinMax->hasOneUse() && !MinMax->isSigned())
if (Value *LogX = takeLog2(Builder, MinMax->getLHS(), Depth, DoFold))
if (Value *LogY = takeLog2(Builder, MinMax->getRHS(), Depth, DoFold))
if (MinMax && MinMax->hasOneUse() && !MinMax->isSigned()) {
// Use AssumeNonZero as false here. Otherwise we can hit case where
// log2(umax(X, Y)) != umax(log2(X), log2(Y)) (because overflow).
if (Value *LogX = takeLog2(Builder, MinMax->getLHS(), Depth,
/*AssumeNonZero*/ false, DoFold))
if (Value *LogY = takeLog2(Builder, MinMax->getRHS(), Depth,
/*AssumeNonZero*/ false, DoFold))
return IfFold([&]() {
return Builder.CreateBinaryIntrinsic(
MinMax->getIntrinsicID(), LogX, LogY);
return Builder.CreateBinaryIntrinsic(MinMax->getIntrinsicID(), LogX,
LogY);
});
}
return nullptr;
}
@ -1297,8 +1308,10 @@ Instruction *InstCombinerImpl::visitUDiv(BinaryOperator &I) {
}
// Op1 udiv Op2 -> Op1 lshr log2(Op2), if log2() folds away.
if (takeLog2(Builder, Op1, /*Depth*/0, /*DoFold*/false)) {
Value *Res = takeLog2(Builder, Op1, /*Depth*/0, /*DoFold*/true);
if (takeLog2(Builder, Op1, /*Depth*/ 0, /*AssumeNonZero*/ true,
/*DoFold*/ false)) {
Value *Res = takeLog2(Builder, Op1, /*Depth*/ 0,
/*AssumeNonZero*/ true, /*DoFold*/ true);
return replaceInstUsesWith(
I, Builder.CreateLShr(Op0, Res, I.getName(), I.isExact()));
}

View file

@ -2455,9 +2455,13 @@ bool CompatibleSets::shouldBelongToSameSet(ArrayRef<InvokeInst *> Invokes) {
// Can we theoretically form the data operands for the merged `invoke`?
auto IsIllegalToMergeArguments = [](auto Ops) {
Type *Ty = std::get<0>(Ops)->getType();
assert(Ty == std::get<1>(Ops)->getType() && "Incompatible types?");
return Ty->isTokenTy() && std::get<0>(Ops) != std::get<1>(Ops);
Use &U0 = std::get<0>(Ops);
Use &U1 = std::get<1>(Ops);
if (U0 == U1)
return false;
return U0->getType()->isTokenTy() ||
!canReplaceOperandWithVariable(cast<Instruction>(U0.getUser()),
U0.getOperandNo());
};
assert(Invokes.size() == 2 && "Always called with exactly two candidates.");
if (any_of(zip(Invokes[0]->data_ops(), Invokes[1]->data_ops()),

View file

@ -1,10 +1,10 @@
// $FreeBSD$
#define LLVM_REVISION "llvmorg-16.0.2-0-g18ddebe1a1a9"
#define LLVM_REVISION "llvmorg-16.0.3-0-gda3cd333bea5"
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
#define CLANG_REVISION "llvmorg-16.0.2-0-g18ddebe1a1a9"
#define CLANG_REVISION "llvmorg-16.0.3-0-gda3cd333bea5"
#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git"
#define LLDB_REVISION "llvmorg-16.0.2-0-g18ddebe1a1a9"
#define LLDB_REVISION "llvmorg-16.0.3-0-gda3cd333bea5"
#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git"

View file

@ -1,10 +1,10 @@
/* $FreeBSD$ */
#define CLANG_VERSION 16.0.2
#define CLANG_VERSION_STRING "16.0.2"
#define CLANG_VERSION 16.0.3
#define CLANG_VERSION_STRING "16.0.3"
#define CLANG_VERSION_MAJOR 16
#define CLANG_VERSION_MAJOR_STRING "16"
#define CLANG_VERSION_MINOR 0
#define CLANG_VERSION_PATCHLEVEL 2
#define CLANG_VERSION_PATCHLEVEL 3
#define CLANG_VENDOR "FreeBSD "

View file

@ -1,4 +1,4 @@
// Local identifier in __FreeBSD_version style
#define LLD_FREEBSD_VERSION 1400006
#define LLD_VERSION_STRING "16.0.2 (FreeBSD llvmorg-16.0.2-0-g18ddebe1a1a9-" __XSTRING(LLD_FREEBSD_VERSION) ")"
#define LLD_VERSION_STRING "16.0.3 (FreeBSD llvmorg-16.0.3-0-gda3cd333bea5-" __XSTRING(LLD_FREEBSD_VERSION) ")"

View file

@ -1,6 +1,6 @@
#define LLDB_VERSION 16.0.2
#define LLDB_VERSION_STRING "16.0.2"
#define LLDB_VERSION 16.0.3
#define LLDB_VERSION_STRING "16.0.3"
#define LLDB_VERSION_MAJOR 16
#define LLDB_VERSION_MINOR 0
#define LLDB_VERSION_PATCH 2
#define LLDB_VERSION_PATCH 3
/* #undef LLDB_FULL_VERSION_STRING */

View file

@ -348,10 +348,10 @@
#define PACKAGE_NAME "LLVM"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "LLVM 16.0.2"
#define PACKAGE_STRING "LLVM 16.0.3"
/* Define to the version of this package. */
#define PACKAGE_VERSION "16.0.2"
#define PACKAGE_VERSION "16.0.3"
/* Define to the vendor of this package. */
/* #undef PACKAGE_VENDOR */

View file

@ -74,10 +74,10 @@
#define LLVM_VERSION_MINOR 0
/* Patch version of the LLVM API */
#define LLVM_VERSION_PATCH 2
#define LLVM_VERSION_PATCH 3
/* LLVM version string */
#define LLVM_VERSION_STRING "16.0.2"
#define LLVM_VERSION_STRING "16.0.3"
/* Whether LLVM records statistics for use with GetStatistics(),
* PrintStatistics() or PrintStatisticsJSON()

View file

@ -1,3 +1,3 @@
/* $FreeBSD$ */
#define LLVM_REVISION "llvmorg-16.0.2-0-g18ddebe1a1a9"
#define LLVM_REVISION "llvmorg-16.0.3-0-gda3cd333bea5"
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"