Skip to content

Commit 646675b

Browse files
authored
Merge branch 'main' into fix/111854
2 parents 76be3d8 + f87f3ad commit 646675b

File tree

85 files changed

+5239
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5239
-1239
lines changed

.github/workflows/containers/github-action-ci/stage1.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/ubuntu:22.04 as base
22
ENV LLVM_SYSROOT=/opt/llvm
33

44
FROM base as stage1-toolchain
5-
ENV LLVM_VERSION=18.1.8
5+
ENV LLVM_VERSION=19.1.2
66

77
RUN apt-get update && \
88
apt-get install -y \

clang/test/CodeGenCUDA/bf16.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __device__ void test_arg(__bf16 *out, __bf16 in) {
2525
__device__ __bf16 test_ret( __bf16 in) {
2626
// CHECK: ld.param.b16 %[[R:rs[0-9]+]], [_Z8test_retDF16b_param_0];
2727
return in;
28-
// CHECK: st.param.b16 [func_retval0+0], %[[R]]
28+
// CHECK: st.param.b16 [func_retval0], %[[R]]
2929
// CHECK: ret;
3030
}
3131

@@ -35,15 +35,15 @@ __device__ __bf16 external_func( __bf16 in);
3535
// CHECK: .param .align 2 .b8 _Z9test_callDF16b_param_0[2]
3636
__device__ __bf16 test_call( __bf16 in) {
3737
// CHECK: ld.param.b16 %[[R:rs[0-9]+]], [_Z9test_callDF16b_param_0];
38-
// CHECK: st.param.b16 [param0+0], %[[R]];
38+
// CHECK: st.param.b16 [param0], %[[R]];
3939
// CHECK: .param .align 2 .b8 retval0[2];
4040
// CHECK: call.uni (retval0),
4141
// CHECK-NEXT: _Z13external_funcDF16b,
4242
// CHECK-NEXT: (
4343
// CHECK-NEXT: param0
4444
// CHECK-NEXT );
45-
// CHECK: ld.param.b16 %[[RET:rs[0-9]+]], [retval0+0];
45+
// CHECK: ld.param.b16 %[[RET:rs[0-9]+]], [retval0];
4646
return external_func(in);
47-
// CHECK: st.param.b16 [func_retval0+0], %[[RET]]
47+
// CHECK: st.param.b16 [func_retval0], %[[RET]]
4848
// CHECK: ret;
4949
}

compiler-rt/lib/hwasan/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ foreach(arch ${HWASAN_SUPPORTED_ARCH})
2424
if(${arch} MATCHES "aarch64")
2525
list(APPEND HWASAN_RTL_SOURCES
2626
hwasan_setjmp_aarch64.S
27-
hwasan_tag_mismatch_aarch64.S)
27+
hwasan_tag_mismatch_aarch64.S
28+
)
2829
endif()
2930
if(${arch} MATCHES "riscv64")
3031
list(APPEND HWASAN_RTL_SOURCES
3132
hwasan_setjmp_riscv64.S
32-
hwasan_tag_mismatch_riscv64.S)
33+
hwasan_tag_mismatch_riscv64.S
34+
)
3335
endif()
3436
if(${arch} MATCHES "x86_64")
3537
list(APPEND HWASAN_RTL_SOURCES
36-
hwasan_setjmp_x86_64.S)
38+
hwasan_setjmp_x86_64.S
39+
)
3740
endif()
3841
endforeach()
3942

lldb/include/lldb/Core/Module.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "llvm/ADT/DenseSet.h"
3232
#include "llvm/ADT/STLFunctionalExtras.h"
33+
#include "llvm/ADT/StableHashing.h"
3334
#include "llvm/ADT/StringRef.h"
3435
#include "llvm/Support/Chrono.h"
3536

@@ -1057,8 +1058,11 @@ class Module : public std::enable_shared_from_this<Module>,
10571058
/// time for the symbol tables can be aggregated here.
10581059
StatsDuration m_symtab_index_time;
10591060

1060-
std::once_flag m_optimization_warning;
1061-
std::once_flag m_language_warning;
1061+
/// A set of hashes of all warnings and errors, to avoid reporting them
1062+
/// multiple times to the same Debugger.
1063+
llvm::DenseMap<llvm::stable_hash, std::unique_ptr<std::once_flag>>
1064+
m_shown_diagnostics;
1065+
std::recursive_mutex m_diagnostic_mutex;
10621066

10631067
void SymbolIndicesToSymbolContextList(Symtab *symtab,
10641068
std::vector<uint32_t> &symbol_indexes,
@@ -1086,6 +1090,7 @@ class Module : public std::enable_shared_from_this<Module>,
10861090
void ReportWarning(const llvm::formatv_object_base &payload);
10871091
void ReportError(const llvm::formatv_object_base &payload);
10881092
void ReportErrorIfModifyDetected(const llvm::formatv_object_base &payload);
1093+
std::once_flag *GetDiagnosticOnceFlag(llvm::StringRef msg);
10891094
};
10901095

10911096
} // namespace lldb_private

lldb/source/Core/Module.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,8 @@ void Module::ReportWarningOptimization(
10931093
ss << file_name
10941094
<< " was compiled with optimization - stepping may behave "
10951095
"oddly; variables may not be available.";
1096-
Debugger::ReportWarning(std::string(ss.GetString()), debugger_id,
1097-
&m_optimization_warning);
1096+
llvm::StringRef msg = ss.GetString();
1097+
Debugger::ReportWarning(msg.str(), debugger_id, GetDiagnosticOnceFlag(msg));
10981098
}
10991099

11001100
void Module::ReportWarningUnsupportedLanguage(
@@ -1104,8 +1104,8 @@ void Module::ReportWarningUnsupportedLanguage(
11041104
<< Language::GetNameForLanguageType(language)
11051105
<< "\". "
11061106
"Inspection of frame variables will be limited.";
1107-
Debugger::ReportWarning(std::string(ss.GetString()), debugger_id,
1108-
&m_language_warning);
1107+
llvm::StringRef msg = ss.GetString();
1108+
Debugger::ReportWarning(msg.str(), debugger_id, GetDiagnosticOnceFlag(msg));
11091109
}
11101110

11111111
void Module::ReportErrorIfModifyDetected(
@@ -1125,20 +1125,29 @@ void Module::ReportErrorIfModifyDetected(
11251125
}
11261126
}
11271127

1128+
std::once_flag *Module::GetDiagnosticOnceFlag(llvm::StringRef msg) {
1129+
std::lock_guard<std::recursive_mutex> guard(m_diagnostic_mutex);
1130+
auto &once_ptr = m_shown_diagnostics[llvm::stable_hash_name(msg)];
1131+
if (!once_ptr)
1132+
once_ptr = std::make_unique<std::once_flag>();
1133+
return once_ptr.get();
1134+
}
1135+
11281136
void Module::ReportError(const llvm::formatv_object_base &payload) {
11291137
StreamString strm;
11301138
GetDescription(strm.AsRawOstream(), lldb::eDescriptionLevelBrief);
1131-
strm.PutChar(' ');
1132-
strm.PutCString(payload.str());
1133-
Debugger::ReportError(strm.GetString().str());
1139+
std::string msg = payload.str();
1140+
strm << ' ' << msg;
1141+
Debugger::ReportError(strm.GetString().str(), {}, GetDiagnosticOnceFlag(msg));
11341142
}
11351143

11361144
void Module::ReportWarning(const llvm::formatv_object_base &payload) {
11371145
StreamString strm;
11381146
GetDescription(strm.AsRawOstream(), lldb::eDescriptionLevelFull);
1139-
strm.PutChar(' ');
1140-
strm.PutCString(payload.str());
1141-
Debugger::ReportWarning(std::string(strm.GetString()));
1147+
std::string msg = payload.str();
1148+
strm << ' ' << msg;
1149+
Debugger::ReportWarning(strm.GetString().str(), {},
1150+
GetDiagnosticOnceFlag(msg));
11421151
}
11431152

11441153
void Module::LogMessage(Log *log, const llvm::formatv_object_base &payload) {

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,13 +2069,15 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
20692069
Status error = ModuleList::GetSharedModule(dwo_module_spec, module_sp,
20702070
nullptr, nullptr, nullptr);
20712071
if (!module_sp) {
2072+
// ReportWarning also rate-limits based on the warning string,
2073+
// but in a -gmodules build, each object file has a similar DAG
2074+
// of module dependencies that would all be listed here.
20722075
GetObjectFile()->GetModule()->ReportWarning(
2073-
"{0:x16}: unable to locate module needed for external types: "
2074-
"{1}\nerror: {2}\nDebugging will be degraded due to missing "
2075-
"types. Rebuilding the project will regenerate the needed "
2076-
"module files.",
2077-
die.GetOffset(), dwo_module_spec.GetFileSpec().GetPath().c_str(),
2078-
error.AsCString("unknown error"));
2076+
"{0}", error.AsCString("unknown error"));
2077+
GetObjectFile()->GetModule()->ReportWarning(
2078+
"Unable to locate module needed for external types.\n"
2079+
"Debugging will be degraded due to missing types. Rebuilding the "
2080+
"project will regenerate the needed module files.");
20792081
continue;
20802082
}
20812083

@@ -2095,12 +2097,11 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
20952097

20962098
if (dwo_id != dwo_dwo_id) {
20972099
GetObjectFile()->GetModule()->ReportWarning(
2098-
"{0:x16}: Module {1} is out-of-date (hash mismatch). Type "
2099-
"information "
2100-
"from this module may be incomplete or inconsistent with the rest of "
2101-
"the program. Rebuilding the project will regenerate the needed "
2102-
"module files.",
2103-
die.GetOffset(), dwo_module_spec.GetFileSpec().GetPath().c_str());
2100+
"Module {0} is out-of-date (hash mismatch).\n"
2101+
"Type information from this module may be incomplete or inconsistent "
2102+
"with the rest of the program. Rebuilding the project will "
2103+
"regenerate the needed module files.",
2104+
dwo_module_spec.GetFileSpec().GetPath());
21042105
}
21052106
}
21062107
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# REQUIRES: system-darwin
2+
# Test the rate-limiting of module not found warnings.
3+
# RUN: rm -rf %t
4+
# RUN: mkdir -p %t
5+
6+
# RUN: echo 'module "C" { header "c.h" }' >%t/module.modulemap
7+
# RUN: echo 'struct c {};' >>%t/c.h
8+
# RUN: echo '@import C;' >%t/a.m
9+
# RUN: echo 'struct a { struct c c; } a;' >>%t/a.m
10+
# RUN: echo '@import C;' >%t/b.m
11+
# RUN: echo 'struct b { struct c c; } b;' >>%t/b.m
12+
# RUN: echo 'int main() {}' >>%t/b.m
13+
14+
# RUN: %clang_host -fmodules -Xclang -fmodules-cache-path=%t/cache -I%t -g -gmodules %t/a.m -o %t/a.o -c
15+
# RUN: %clang_host -fmodules -Xclang -fmodules-cache-path=%t/cache -I%t -g -gmodules %t/b.m -o %t/b.o -c
16+
# RUN: %clang_host %t/a.o %t/b.o -o %t/a.out
17+
# RUN: rm -rf %t/cache
18+
# RUN: %lldb %t/a.out -o "b main" -o run -o "p a" -o "p b" -o q 2>&1 | FileCheck %s
19+
# CHECK: {{[ab]}}.o{{.*}}/cache/{{.*}}/C-{{.*}}.pcm' does not exist
20+
# CHECK-NOT: /cache/{{.*}}/C-{.*}.pcm' does not exist
21+
# CHECK: {{[ab]}}.o{{.*}}/cache/{{.*}}/C-{{.*}}.pcm' does not exist
22+
# CHECK-NOT: /cache/{{.*}}/C-{.*}.pcm' does not exist

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,6 +3223,9 @@ class TargetLoweringBase {
32233223
/// not legal, but should return true if those types will eventually legalize
32243224
/// to types that support FMAs. After legalization, it will only be called on
32253225
/// types that support FMAs (via Legal or Custom actions)
3226+
///
3227+
/// Targets that care about soft float support should return false when soft
3228+
/// float code is being generated (i.e. use-soft-float).
32263229
virtual bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
32273230
EVT) const {
32283231
return false;

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19354,6 +19354,9 @@ bool ARMTargetLowering::allowTruncateForTailCall(Type *Ty1, Type *Ty2) const {
1935419354
/// patterns (and we don't have the non-fused floating point instruction).
1935519355
bool ARMTargetLowering::isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
1935619356
EVT VT) const {
19357+
if (Subtarget->useSoftFloat())
19358+
return false;
19359+
1935719360
if (!VT.isSimple())
1935819361
return false;
1935919362

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,16 @@ void NVPTXInstPrinter::printMemOperand(const MCInst *MI, int OpNum,
363363
}
364364
}
365365

366+
void NVPTXInstPrinter::printOffseti32imm(const MCInst *MI, int OpNum,
367+
raw_ostream &O, const char *Modifier) {
368+
auto &Op = MI->getOperand(OpNum);
369+
assert(Op.isImm() && "Invalid operand");
370+
if (Op.getImm() != 0) {
371+
O << "+";
372+
printOperand(MI, OpNum, O);
373+
}
374+
}
375+
366376
void NVPTXInstPrinter::printProtoIdent(const MCInst *MI, int OpNum,
367377
raw_ostream &O, const char *Modifier) {
368378
const MCOperand &Op = MI->getOperand(OpNum);

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class NVPTXInstPrinter : public MCInstPrinter {
4545
const char *Modifier = nullptr);
4646
void printMemOperand(const MCInst *MI, int OpNum,
4747
raw_ostream &O, const char *Modifier = nullptr);
48+
void printOffseti32imm(const MCInst *MI, int OpNum, raw_ostream &O,
49+
const char *Modifier = nullptr);
4850
void printProtoIdent(const MCInst *MI, int OpNum,
4951
raw_ostream &O, const char *Modifier = nullptr);
5052
void printPrmtMode(const MCInst *MI, int OpNum, raw_ostream &O,

0 commit comments

Comments
 (0)