Skip to content

Commit 80bdc48

Browse files
authored
Merge branch 'main' into users/ojhunt/P2719
2 parents 3d61fe7 + 8a0c2e7 commit 80bdc48

File tree

27 files changed

+1885
-975
lines changed

27 files changed

+1885
-975
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6677,6 +6677,7 @@ def fbinutils_version_EQ : Joined<["-"], "fbinutils-version=">,
66776677
def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>,
66786678
Flags<[LinkOption]>, Visibility<[ClangOption, FlangOption, CLOption]>;
66796679
def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
6680+
def fuse_lipo_EQ : Joined<["-"], "fuse-lipo=">, Group<f_clang_Group>, Flags<[LinkOption]>;
66806681

66816682
defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
66826683
def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3607,18 +3607,15 @@ void CodeGenFunction::EmitCheck(
36073607
llvm::Value *RecoverableCond = nullptr;
36083608
llvm::Value *TrapCond = nullptr;
36093609
bool NoMerge = false;
3610-
for (int i = 0, n = Checked.size(); i < n; ++i) {
3611-
llvm::Value *Check = Checked[i].first;
3610+
for (auto &[Check, Ord] : Checked) {
36123611
// -fsanitize-trap= overrides -fsanitize-recover=.
3613-
llvm::Value *&Cond =
3614-
CGM.getCodeGenOpts().SanitizeTrap.has(Checked[i].second)
3615-
? TrapCond
3616-
: CGM.getCodeGenOpts().SanitizeRecover.has(Checked[i].second)
3617-
? RecoverableCond
3618-
: FatalCond;
3612+
llvm::Value *&Cond = CGM.getCodeGenOpts().SanitizeTrap.has(Ord) ? TrapCond
3613+
: CGM.getCodeGenOpts().SanitizeRecover.has(Ord)
3614+
? RecoverableCond
3615+
: FatalCond;
36193616
Cond = Cond ? Builder.CreateAnd(Cond, Check) : Check;
36203617

3621-
if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second))
3618+
if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Ord))
36223619
NoMerge = true;
36233620
}
36243621

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,9 @@ void darwin::Lipo::ConstructJob(Compilation &C, const JobAction &JA,
910910
CmdArgs.push_back(II.getFilename());
911911
}
912912

913-
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
913+
StringRef LipoName = Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo");
914+
const char *Exec =
915+
Args.MakeArgString(getToolChain().GetProgramPath(LipoName.data()));
914916
C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
915917
Exec, CmdArgs, Inputs, Output));
916918
}

clang/test/Driver/fuse-lipo.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 -fuse-lipo=llvm-lipo 2>&1 | FileCheck -check-prefix=TEST1 %s
2+
// TEST1: llvm-lipo
3+
4+
// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 -fuse-lipo=nonexistant-lipo 2>&1 | FileCheck -check-prefix=TEST2 %s
5+
// TEST2: nonexistant-lipo
6+
7+
// RUN: %clang %s -### --target=arm64-apple-darwin -fuse-lipo=llvm-lipo 2>&1 | FileCheck -check-prefix=TEST3 %s
8+
// TEST3: clang: warning: argument unused during compilation: '-fuse-lipo=llvm-lipo'
9+
10+
// RUN: %clang %s -### --target=arm64-apple-darwin -Wno-unused-command-line-argument -fuse-lipo=llvm-lipo 2>&1 | FileCheck -check-prefix=TEST4 %s
11+
// TEST4-NOT: llvm-lipo
12+
13+
// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 2>&1 | FileCheck -check-prefix=TEST5 %s
14+
// TEST5: lipo
15+
// TEST5-NOT: llvm-lipo

libcxx/test/configs/stdlib-libstdc++.cfg.in

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
22
# This testing configuration runs the test suite using the libstdc++ Standard library.
33
#
4-
# The additional '--param libstdcxx-install-prefix=<PATH>', '--param libstdcxx-triple=<TRIPLE>' and
5-
# '--param libstdcxx-version=<VERSION>' lit parameters must be provided when invoking lit for the
4+
# The additional '--param libstdcxx_install_prefix=<PATH>', '--param libstdcxx_triple=<TRIPLE>' and
5+
# '--param libstdcxx_version=<VERSION>' lit parameters must be provided when invoking lit for the
66
# configuration to find the appropriate headers and library.
77
#
88
# For example:
99
#
10-
# $ ./libcxx/utils/libcxx-lit <BUILD> -sv libcxx/test/std --param libstdcxx-install-prefix=/opt/homebrew/Cellar/gcc/14.1.0_1 \
11-
# --param libstdcxx-version=14 \
12-
# --param libstdcxx-triple=aarch64-apple-darwin22
10+
# $ ./libcxx/utils/libcxx-lit <BUILD> -sv libcxx/test/std --param libstdcxx_install_prefix=/opt/homebrew/Cellar/gcc/14.1.0_1 \
11+
# --param libstdcxx_version=14 \
12+
# --param libstdcxx_triple=aarch64-apple-darwin22
1313
#
1414

1515
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
@@ -20,19 +20,19 @@ import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
2020

2121
# Additional parameters for libstdc++
2222
LIBSTDCXX_PARAMETERS = [
23-
libcxx.test.dsl.Parameter(name='libstdcxx-install-prefix', type=str,
23+
libcxx.test.dsl.Parameter(name='libstdcxx_install_prefix', type=str,
2424
actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-install-prefix}', path)],
2525
help="""
2626
The installation prefix where libstdc++ was installed. This is used to find the libstdc++ headers,
2727
link against its built library, etc.
2828
"""),
29-
libcxx.test.dsl.Parameter(name='libstdcxx-triple', type=str,
29+
libcxx.test.dsl.Parameter(name='libstdcxx_triple', type=str,
3030
actions=lambda triple: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-triple}', triple)],
3131
help="""
3232
The target triple used for the target-specific include directory of libstdc++. This is used to find the
3333
libstdc++ headers.
3434
"""),
35-
libcxx.test.dsl.Parameter(name='libstdcxx-version', type=str,
35+
libcxx.test.dsl.Parameter(name='libstdcxx_version', type=str,
3636
actions=lambda version: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-version}', version)],
3737
help="""
3838
The version of libstdc++. This is used to find the libstdc++ headers and library.

libunwind/src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ set(LIBUNWIND_C_SOURCES
2020
)
2121
set_source_files_properties(${LIBUNWIND_C_SOURCES}
2222
PROPERTIES
23-
COMPILE_FLAGS "-std=c99")
23+
# We need to set `-fexceptions` here so that key
24+
# unwinding functions, like
25+
# _UNWIND_RaiseException, are not marked as
26+
# `nounwind`, which breaks LTO builds of
27+
# libunwind. See #56825 and #120657 for context.
28+
COMPILE_FLAGS "-std=c99 -fexceptions")
2429

2530
set(LIBUNWIND_ASM_SOURCES
2631
UnwindRegistersRestore.S

lldb/include/lldb/Utility/LLDBAssert.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,30 @@
1919
// __FILE__ but only renders the last path component (the filename) instead of
2020
// an invocation dependent full path to that file.
2121
#define lldbassert(x) \
22-
lldb_private::lldb_assert(static_cast<bool>(x), #x, __FUNCTION__, \
23-
__FILE_NAME__, __LINE__)
22+
lldb_private::_lldb_assert(static_cast<bool>(x), #x, __FUNCTION__, \
23+
__FILE_NAME__, __LINE__)
2424
#else
2525
#define lldbassert(x) \
26-
lldb_private::lldb_assert(static_cast<bool>(x), #x, __FUNCTION__, __FILE__, \
27-
__LINE__)
26+
lldb_private::_lldb_assert(static_cast<bool>(x), #x, __FUNCTION__, __FILE__, \
27+
__LINE__)
2828
#endif
2929
#endif
3030

3131
namespace lldb_private {
32-
void lldb_assert(bool expression, const char *expr_text, const char *func,
33-
const char *file, unsigned int line);
3432

33+
/// Don't use _lldb_assert directly. Use the lldbassert macro instead so that
34+
/// LLDB asserts become regular asserts in NDEBUG builds.
35+
void _lldb_assert(bool expression, const char *expr_text, const char *func,
36+
const char *file, unsigned int line);
37+
38+
/// The default LLDB assert callback, which prints to stderr.
3539
typedef void (*LLDBAssertCallback)(llvm::StringRef message,
3640
llvm::StringRef backtrace,
3741
llvm::StringRef prompt);
3842

43+
/// Replace the LLDB assert callback.
3944
void SetLLDBAssertCallback(LLDBAssertCallback callback);
45+
4046
} // namespace lldb_private
4147

4248
#endif // LLDB_UTILITY_LLDBASSERT_H

lldb/source/Utility/LLDBAssert.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
namespace lldb_private {
2222

23+
/// The default callback prints to stderr.
2324
static void DefaultAssertCallback(llvm::StringRef message,
2425
llvm::StringRef backtrace,
2526
llvm::StringRef prompt) {
@@ -31,8 +32,8 @@ static void DefaultAssertCallback(llvm::StringRef message,
3132
static std::atomic<LLDBAssertCallback> g_lldb_assert_callback =
3233
&DefaultAssertCallback;
3334

34-
void lldb_assert(bool expression, const char *expr_text, const char *func,
35-
const char *file, unsigned int line) {
35+
void _lldb_assert(bool expression, const char *expr_text, const char *func,
36+
const char *file, unsigned int line) {
3637
if (LLVM_LIKELY(expression))
3738
return;
3839

@@ -44,8 +45,6 @@ void lldb_assert(bool expression, const char *expr_text, const char *func,
4445
}
4546
#endif
4647

47-
// Print a warning and encourage the user to file a bug report, similar to
48-
// LLVM’s crash handler, and then return execution.
4948
std::string buffer;
5049
llvm::raw_string_ostream backtrace(buffer);
5150
llvm::sys::PrintStackTrace(backtrace);

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,8 +3007,8 @@ bool GCNHazardRecognizer::fixVALUMaskWriteHazard(MachineInstr *MI) {
30073007
switch (I.getOpcode()) {
30083008
case AMDGPU::V_ADDC_U32_e32:
30093009
case AMDGPU::V_ADDC_U32_dpp:
3010-
case AMDGPU::V_CNDMASK_B16_e32:
3011-
case AMDGPU::V_CNDMASK_B16_dpp:
3010+
case AMDGPU::V_CNDMASK_B16_fake16_e32:
3011+
case AMDGPU::V_CNDMASK_B16_fake16_dpp:
30123012
case AMDGPU::V_CNDMASK_B32_e32:
30133013
case AMDGPU::V_CNDMASK_B32_dpp:
30143014
case AMDGPU::V_DIV_FMAS_F32_e64:
@@ -3023,8 +3023,8 @@ bool GCNHazardRecognizer::fixVALUMaskWriteHazard(MachineInstr *MI) {
30233023
HazardReg == AMDGPU::VCC_HI;
30243024
case AMDGPU::V_ADDC_U32_e64:
30253025
case AMDGPU::V_ADDC_U32_e64_dpp:
3026-
case AMDGPU::V_CNDMASK_B16_e64:
3027-
case AMDGPU::V_CNDMASK_B16_e64_dpp:
3026+
case AMDGPU::V_CNDMASK_B16_fake16_e64:
3027+
case AMDGPU::V_CNDMASK_B16_fake16_e64_dpp:
30283028
case AMDGPU::V_CNDMASK_B32_e64:
30293029
case AMDGPU::V_CNDMASK_B32_e64_dpp:
30303030
case AMDGPU::V_SUBB_U32_e64:

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,11 +1245,22 @@ class VOPSelectPat <ValueType vt> : GCNPat <
12451245
(vt (select i1:$src0, vt:$src1, vt:$src2)),
12461246
(V_CNDMASK_B32_e64 0, VSrc_b32:$src2, 0, VSrc_b32:$src1, SSrc_i1:$src0)
12471247
>;
1248+
class VOPSelectPat_t16 <ValueType vt> : GCNPat <
1249+
(vt (select i1:$src0, vt:$src1, vt:$src2)),
1250+
(V_CNDMASK_B16_t16_e64 0, VSrcT_b16:$src2, 0, VSrcT_b16:$src1, SSrc_i1:$src0)
1251+
>;
12481252

12491253
def : VOPSelectModsPat <i32>;
12501254
def : VOPSelectModsPat <f32>;
1251-
def : VOPSelectPat <f16>;
1252-
def : VOPSelectPat <i16>;
1255+
foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
1256+
let True16Predicate = p in {
1257+
def : VOPSelectPat <f16>;
1258+
def : VOPSelectPat <i16>;
1259+
} // End True16Predicate = p
1260+
let True16Predicate = UseRealTrue16Insts in {
1261+
def : VOPSelectPat_t16 <f16>;
1262+
def : VOPSelectPat_t16 <i16>;
1263+
} // End True16Predicate = UseRealTrue16Insts
12531264

12541265
let AddedComplexity = 1 in {
12551266
def : GCNPat <

0 commit comments

Comments
 (0)