aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-05-22 16:21:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-05-22 16:21:37 +0000
commit791701a7dc6225242c41502cb3ed6874623c1785 (patch)
tree2fb85e4d1b92ab10771f6d8420c9e6eb5cd77058
parent727e049ae5985f129320069542bb57add1ba6096 (diff)
Vendor import of llvm-project branch release/16.x llvmorg-16.0.4-0-gae42196bc493 (aka 16.0.4 release).vendor/llvm-project/llvmorg-16.0.4-0-gae42196bc493
-rw-r--r--clang/lib/AST/TypePrinter.cpp2
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp2
-rw-r--r--clang/lib/Driver/ToolChains/MSVC.cpp2
-rw-r--r--clang/lib/Sema/SemaInit.cpp16
-rw-r--r--libcxx/include/__config2
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp9
-rw-r--r--llvm/lib/Target/SystemZ/SystemZISelLowering.cpp6
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp14
8 files changed, 33 insertions, 20 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index 5c2464904485..2d06faeca182 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -1812,7 +1812,7 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
void TypePrinter::printBTFTagAttributedBefore(const BTFTagAttributedType *T,
raw_ostream &OS) {
printBefore(T->getWrappedType(), OS);
- OS << " btf_type_tag(" << T->getAttr()->getBTFTypeTag() << ")";
+ OS << " __attribute__((btf_type_tag(\"" << T->getAttr()->getBTFTypeTag() << "\")))";
}
void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T,
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index ec6860113b7e..238507e06335 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -7782,7 +7782,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
if (Args.hasArg(options::OPT__SLASH_kernel))
CmdArgs.push_back("-fms-kernel");
- if (Arg *A = Args.getLastArg(options::OPT__SLASH_guard)) {
+ for (const Arg *A : Args.filtered(options::OPT__SLASH_guard)) {
StringRef GuardArgs = A->getValue();
// The only valid options are "cf", "cf,nochecks", "cf-", "ehcont" and
// "ehcont-".
diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
index 8ad67ca3e13f..b8aa21b7a766 100644
--- a/clang/lib/Driver/ToolChains/MSVC.cpp
+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
@@ -227,7 +227,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddAllArgValues(CmdArgs, options::OPT__SLASH_link);
// Control Flow Guard checks
- if (Arg *A = Args.getLastArg(options::OPT__SLASH_guard)) {
+ for (const Arg *A : Args.filtered(options::OPT__SLASH_guard)) {
StringRef GuardArgs = A->getValue();
if (GuardArgs.equals_insensitive("cf") ||
GuardArgs.equals_insensitive("cf,nochecks")) {
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 99801a88e3ed..44adb167dcc0 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -5348,14 +5348,16 @@ static void TryOrBuildParenListInitialization(
// The remaining elements are initialized with their default member
// initializers, if any
auto *FD = cast<FieldDecl>(SubEntity.getDecl());
- if (Expr *ICE = FD->getInClassInitializer(); ICE && !VerifyOnly) {
- ExprResult DIE = S.BuildCXXDefaultInitExpr(FD->getLocation(), FD);
- if (DIE.isInvalid())
- return false;
- S.checkInitializerLifetime(SubEntity, DIE.get());
- InitExprs.push_back(DIE.get());
+ if (FD->hasInClassInitializer()) {
+ if (!VerifyOnly) {
+ ExprResult DIE = S.BuildCXXDefaultInitExpr(FD->getLocation(), FD);
+ if (DIE.isInvalid())
+ return false;
+ S.checkInitializerLifetime(SubEntity, DIE.get());
+ InitExprs.push_back(DIE.get());
+ }
continue;
- };
+ }
}
// Remaining class elements without default member initializers and
// array elements are value initialized:
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 36bdbd8680db..9009b9014abb 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -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 160003
+# define _LIBCPP_VERSION 160004
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 8d4c8802f71c..3de4efb5ba22 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1724,12 +1724,9 @@ bool TargetLowering::SimplifyDemandedBits(
unsigned InnerBits = InnerVT.getScalarSizeInBits();
if (ShAmt < InnerBits && DemandedBits.getActiveBits() <= InnerBits &&
isTypeDesirableForOp(ISD::SHL, InnerVT)) {
- EVT ShTy = getShiftAmountTy(InnerVT, DL);
- if (!APInt(BitWidth, ShAmt).isIntN(ShTy.getSizeInBits()))
- ShTy = InnerVT;
- SDValue NarrowShl =
- TLO.DAG.getNode(ISD::SHL, dl, InnerVT, InnerOp,
- TLO.DAG.getConstant(ShAmt, dl, ShTy));
+ SDValue NarrowShl = TLO.DAG.getNode(
+ ISD::SHL, dl, InnerVT, InnerOp,
+ TLO.DAG.getShiftAmountConstant(ShAmt, InnerVT, dl));
return TLO.CombineTo(
Op, TLO.DAG.getNode(ISD::ANY_EXTEND, dl, VT, NarrowShl));
}
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index 5dca792dc89a..0b3059df124e 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -8488,11 +8488,13 @@ SystemZTargetLowering::emitMemMemWrapper(MachineInstr &MI,
.addReg(RemSrcReg).addImm(SrcDisp);
MBB->addSuccessor(AllDoneMBB);
MBB = AllDoneMBB;
- if (EndMBB) {
+ if (Opcode != SystemZ::MVC) {
EXRL_MIB.addReg(SystemZ::CC, RegState::ImplicitDefine);
- MBB->addLiveIn(SystemZ::CC);
+ if (EndMBB)
+ MBB->addLiveIn(SystemZ::CC);
}
}
+ MF.getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
}
// Handle any remaining bytes with straight-line code.
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 1606413c382b..df9aaddd5729 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -1557,7 +1557,19 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
Fn.arg_size() == 2) {
StackSize += 8;
MFI.setStackSize(StackSize);
- emitSPUpdate(MBB, MBBI, DL, -8, /*InEpilogue=*/false);
+
+ // Update the stack pointer by pushing a register. This is the instruction
+ // emitted that would be end up being emitted by a call to `emitSPUpdate`.
+ // Hard-coding the update to a push avoids emitting a second
+ // `STACKALLOC_W_PROBING` instruction in the save block: We know that stack
+ // probing isn't needed anyways for an 8-byte update.
+ // Pushing a register leaves us in a similar situation to a regular
+ // function call where we know that the address at (rsp-8) is writeable.
+ // That way we avoid any off-by-ones with stack probing for additional
+ // stack pointer updates later on.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::PUSH64r))
+ .addReg(X86::RAX, RegState::Undef)
+ .setMIFlag(MachineInstr::FrameSetup);
}
// If this is x86-64 and the Red Zone is not disabled, if we are a leaf