Skip to content

[AutoBump] Merge with 43d71baa (Feb 20) (66) #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: bump_to_11468c3b
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df9d3c2
Reverting commits 5bc51611446ee3a9fc353 and df427992da4492a664b6 (#12…
Renaud-K Feb 20, 2025
cc45365
[clang][NFC] Update isAuxBuiltinID comment (#128038)
sarnex Feb 20, 2025
87bf232
[libc] Add missing dependencies on `getc` and `ungetc` for GPU (#128069)
jhuber6 Feb 20, 2025
d1dde17
[libc] Fix failing NVPTX tests due to removed internal LLVM option
jhuber6 Feb 20, 2025
84c8848
[flang][cuda] Lower match_any_sync functions to nvvm intrinsics (#127…
clementval Feb 20, 2025
5981335
[libc] Fix scanf cmake for targets without FILE (#128056)
michaelrj-google Feb 20, 2025
a67566b
Allow do concurrent inside cuf kernel directive (#127693)
wangzpgi Feb 20, 2025
309e3ca
Revert "[CodeGen] Remove static member function Register::isPhysicalR…
cjdb Feb 20, 2025
08c69b2
Revert "[CodeGen] Remove static member function Register::isVirtualRe…
cjdb Feb 20, 2025
74c6111
[lld][WebAssembly] Skip BSS when combining data segments (#127735)
sbc100 Feb 20, 2025
dcc08a1
[llvm-dlltool] Implement the --identify option (#127465)
mstorsjo Feb 20, 2025
f83ef28
[NVPTX] Remove redundant addressing mode instrs (#128044)
AlexMaclean Feb 20, 2025
a1a1073
[SandboxVec][DAG] Remove all matching nodes from bundle
vporpo Feb 20, 2025
1ca93b1
[llvm-dlltool] Add a missing dependency
mstorsjo Feb 20, 2025
2ff80d2
[SandboxVec][Scheduler] Fix reassignment of SchedBundle to DGNode
vporpo Feb 20, 2025
62c209b
[mlir][tosa] add test of scalar mul op (#128088)
Tai78641 Feb 20, 2025
4d92975
[SandboxVec][Scheduler] Don't allow rescheduling of already scheduled…
vporpo Feb 21, 2025
3c46deb
[MLIR] Fix 0-dimensional case of conversion of vector ops to GPU (#12…
bjacob Feb 21, 2025
9fa77c1
[BOLT][Linker][NFC] Remove lookupSymbol() in favor of lookupSymbolInf…
yozhu Feb 21, 2025
776cdda
[HLSL] Implement default constant buffer `$Globals` (#125807)
hekota Feb 21, 2025
7c2ebe5
AMDGPU: Restrict src0 to VGPRs only for certain cvt scale opcodes. (#…
pravinjagtap Feb 21, 2025
6e5f26b
Revert "[HLSL] Implement default constant buffer `$Globals`" (#128112)
hekota Feb 21, 2025
24c06a1
[C++20] [Modules] handling selectAny attribute for vardecl
ChuanqiXu9 Feb 21, 2025
f27081b
[FIR] Avoid generating llvm.undef for dummy scoping info (#128098)
razvanlupusoru Feb 21, 2025
89e80ab
[lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo`
wangleiat Feb 21, 2025
204dcaf
[clang-format] Fix a bug in BCIS_AfterColon and `ColumnLimit: 0` (#12…
owenca Feb 21, 2025
22f5268
[mlir][tosa] Add infer shape test of scalar mul op (#128091)
Tai78641 Feb 21, 2025
35d7bf2
[mlir] Remove unused outer loop (NFC) (#127998)
lcvon007 Feb 21, 2025
e729dc7
AMDGPU: Widen f16 minimum/maximum to v2f16 on gfx950 (#128121)
arsenm Feb 21, 2025
cc46d00
AMDGPU: Form v2f16 minimum3/maximum3 on gfx950 (#128123)
arsenm Feb 21, 2025
cc675c6
[utils] Use stricter SSA regexp for CHECK-SAME. (#128083)
vzakhari Feb 21, 2025
f0134e6
[MLIR][Math] Add lowering for isnan and isfinite (#128125)
wsmoses Feb 21, 2025
fd5d1cb
[clang][Index] Use HeuristicResolver in IndexTypeSourceInfo as well (…
HighCommander4 Feb 21, 2025
e3c8408
[llvm-jitlink] Apply symbol scope modifiers explicitly for -hidden-lx.
lhames Feb 21, 2025
6c90f87
[ORC-RT] Add -num-threads=0 to testcase.
lhames Feb 21, 2025
36d304d
[RegAllocFast][NPM] Make RegAllocFastPassOptions a nested class (#127…
optimisan Feb 21, 2025
43d71ba
[mlir][bazel] Fix build after @11468c3, @f0134e6.
chsigg Feb 21, 2025
567a51a
[AutoBump] Merge with 43d71baa (Feb 20)
jorickert Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions bolt/include/bolt/Core/Linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ class BOLTLinker {
/// Return the address and size of a symbol or std::nullopt if it cannot be
/// found.
virtual std::optional<SymbolInfo> lookupSymbolInfo(StringRef Name) const = 0;

/// Return the address of a symbol or std::nullopt if it cannot be found.
std::optional<uint64_t> lookupSymbol(StringRef Name) const {
if (const auto Info = lookupSymbolInfo(Name))
return Info->Address;
return std::nullopt;
}
};

} // namespace bolt
Expand Down
20 changes: 10 additions & 10 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4259,21 +4259,21 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {

if (BC.HasRelocations || isInjected()) {
if (hasConstantIsland()) {
const auto DataAddress =
Linker.lookupSymbol(getFunctionConstantIslandLabel()->getName());
assert(DataAddress && "Cannot find function CI symbol");
setOutputDataAddress(*DataAddress);
const auto IslandLabelSymInfo =
Linker.lookupSymbolInfo(getFunctionConstantIslandLabel()->getName());
assert(IslandLabelSymInfo && "Cannot find function CI symbol");
setOutputDataAddress(IslandLabelSymInfo->Address);
for (auto It : Islands->Offsets) {
const uint64_t OldOffset = It.first;
BinaryData *BD = BC.getBinaryDataAtAddress(getAddress() + OldOffset);
if (!BD)
continue;

MCSymbol *Symbol = It.second;
const auto NewAddress = Linker.lookupSymbol(Symbol->getName());
assert(NewAddress && "Cannot find CI symbol");
const auto SymInfo = Linker.lookupSymbolInfo(Symbol->getName());
assert(SymInfo && "Cannot find CI symbol");
auto &Section = *getCodeSection();
const auto NewOffset = *NewAddress - Section.getOutputAddress();
const auto NewOffset = SymInfo->Address - Section.getOutputAddress();
BD->setOutputLocation(Section, NewOffset);
}
}
Expand All @@ -4298,10 +4298,10 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
FF.setAddress(ColdStartSymbolInfo->Address);
FF.setImageSize(ColdStartSymbolInfo->Size);
if (hasConstantIsland()) {
const auto DataAddress = Linker.lookupSymbol(
const auto SymInfo = Linker.lookupSymbolInfo(
getFunctionColdConstantIslandLabel()->getName());
assert(DataAddress && "Cannot find cold CI symbol");
setOutputColdDataAddress(*DataAddress);
assert(SymInfo && "Cannot find cold CI symbol");
setOutputColdDataAddress(SymInfo->Address);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions bolt/lib/Rewrite/JITLinkLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ struct JITLinkLinker::Context : jitlink::JITLinkContext {
std::string SymName = (*Symbol.first).str();
LLVM_DEBUG(dbgs() << "BOLT: looking for " << SymName << "\n");

if (auto Address = Linker.lookupSymbol(SymName)) {
if (auto SymInfo = Linker.lookupSymbolInfo(SymName)) {
LLVM_DEBUG(dbgs() << "Resolved to address 0x"
<< Twine::utohexstr(*Address) << "\n");
<< Twine::utohexstr(SymInfo->Address) << "\n");
AllResults[Symbol.first] = orc::ExecutorSymbolDef(
orc::ExecutorAddr(*Address), JITSymbolFlags());
orc::ExecutorAddr(SymInfo->Address), JITSymbolFlags());
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5907,9 +5907,9 @@ void RewriteInstance::writeEHFrameHeader() {
}

uint64_t RewriteInstance::getNewValueForSymbol(const StringRef Name) {
auto Value = Linker->lookupSymbol(Name);
auto Value = Linker->lookupSymbolInfo(Name);
if (Value)
return *Value;
return Value->Address;

// Return the original value if we haven't emitted the symbol.
BinaryData *BD = BC->getBinaryDataByName(Name);
Expand Down
5 changes: 3 additions & 2 deletions bolt/lib/RuntimeLibs/HugifyRuntimeLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ void HugifyRuntimeLibrary::link(BinaryContext &BC, StringRef ToolPath,

assert(!RuntimeStartAddress &&
"We don't currently support linking multiple runtime libraries");
RuntimeStartAddress = Linker.lookupSymbol("__bolt_hugify_self").value_or(0);
if (!RuntimeStartAddress) {
auto StartSymInfo = Linker.lookupSymbolInfo("__bolt_hugify_self");
if (!StartSymInfo) {
errs() << "BOLT-ERROR: hugify library does not define __bolt_hugify_self: "
<< LibPath << "\n";
exit(1);
}
RuntimeStartAddress = StartSymInfo->Address;
}
22 changes: 15 additions & 7 deletions bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,27 +203,35 @@ void InstrumentationRuntimeLibrary::link(
if (BC.isMachO())
return;

RuntimeFiniAddress = Linker.lookupSymbol("__bolt_instr_fini").value_or(0);
if (!RuntimeFiniAddress) {
std::optional<BOLTLinker::SymbolInfo> FiniSymInfo =
Linker.lookupSymbolInfo("__bolt_instr_fini");
if (!FiniSymInfo) {
errs() << "BOLT-ERROR: instrumentation library does not define "
"__bolt_instr_fini: "
<< LibPath << "\n";
exit(1);
}
RuntimeStartAddress = Linker.lookupSymbol("__bolt_instr_start").value_or(0);
if (!RuntimeStartAddress) {
RuntimeFiniAddress = FiniSymInfo->Address;

std::optional<BOLTLinker::SymbolInfo> StartSymInfo =
Linker.lookupSymbolInfo("__bolt_instr_start");
if (!StartSymInfo) {
errs() << "BOLT-ERROR: instrumentation library does not define "
"__bolt_instr_start: "
<< LibPath << "\n";
exit(1);
}
RuntimeStartAddress = StartSymInfo->Address;

outs() << "BOLT-INFO: output linked against instrumentation runtime "
"library, lib entry point is 0x"
<< Twine::utohexstr(RuntimeStartAddress) << "\n";

std::optional<BOLTLinker::SymbolInfo> ClearSymInfo =
Linker.lookupSymbolInfo("__bolt_instr_clear_counters");
const uint64_t ClearSymAddress = ClearSymInfo ? ClearSymInfo->Address : 0;
outs() << "BOLT-INFO: clear procedure is 0x"
<< Twine::utohexstr(
Linker.lookupSymbol("__bolt_instr_clear_counters").value_or(0))
<< "\n";
<< Twine::utohexstr(ClearSymAddress) << "\n";

emitTablesAsELFNote(BC);
}
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/Builtins.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ class Context {

unsigned getRequiredVectorWidth(unsigned ID) const;

/// Return true if builtin ID belongs to AuxTarget.
/// Return true if the builtin ID belongs exclusively to the AuxTarget,
/// and false if it belongs to both primary and aux target, or neither.
bool isAuxBuiltinID(unsigned ID) const {
return ID >= (Builtin::FirstTSBuiltin + NumTargetBuiltins);
}
Expand Down
5 changes: 2 additions & 3 deletions clang/lib/Format/ContinuationIndenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
(State.Column + State.Line->Last->TotalLength - Previous.TotalLength >
getColumnLimit(State) ||
CurrentState.BreakBeforeParameter) &&
(!Current.isTrailingComment() || Current.NewlinesBefore > 0) &&
(Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon ||
Style.ColumnLimit > 0 || Current.NewlinesBefore > 0)) {
((!Current.isTrailingComment() && Style.ColumnLimit > 0) ||
Current.NewlinesBefore > 0)) {
return true;
}

Expand Down
24 changes: 3 additions & 21 deletions clang/lib/Index/IndexTypeSourceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Sema/HeuristicResolver.h"
#include "llvm/ADT/ScopeExit.h"

using namespace clang;
Expand Down Expand Up @@ -207,27 +208,8 @@ class TypeIndexer : public RecursiveASTVisitor<TypeIndexer> {
}

bool VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
const DependentNameType *DNT = TL.getTypePtr();
const NestedNameSpecifier *NNS = DNT->getQualifier();
const Type *T = NNS->getAsType();
if (!T)
return true;
const TemplateSpecializationType *TST =
T->getAs<TemplateSpecializationType>();
if (!TST)
return true;
TemplateName TN = TST->getTemplateName();
const ClassTemplateDecl *TD =
dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl());
if (!TD)
return true;
CXXRecordDecl *RD = TD->getTemplatedDecl();
if (!RD->hasDefinition())
return true;
RD = RD->getDefinition();
DeclarationName Name(DNT->getIdentifier());
std::vector<const NamedDecl *> Symbols = RD->lookupDependentName(
Name, [](const NamedDecl *ND) { return isa<TypeDecl>(ND); });
std::vector<const NamedDecl *> Symbols =
IndexCtx.getResolver()->resolveDependentNameType(TL.getTypePtr());
if (Symbols.size() != 1)
return true;
return IndexCtx.handleReference(Symbols[0], TL.getNameLoc(), Parent,
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4803,7 +4803,8 @@ bool Sema::checkVarDeclRedefinition(VarDecl *Old, VarDecl *New) {
(New->getFormalLinkage() == Linkage::Internal || New->isInline() ||
isa<VarTemplateSpecializationDecl>(New) ||
New->getDescribedVarTemplate() || New->getNumTemplateParameterLists() ||
New->getDeclContext()->isDependentContext())) {
New->getDeclContext()->isDependentContext() ||
New->hasAttr<SelectAnyAttr>())) {
// The previous definition is hidden, and multiple definitions are
// permitted (in separate TUs). Demote this to a declaration.
New->demoteThisDefinitionToDeclaration();
Expand Down
31 changes: 31 additions & 0 deletions clang/test/Modules/pr127943.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/repro.cppm -fdeclspec -emit-module-interface -o %t/repro.pcm
// RUN: %clang_cc1 -std=c++20 %t/source.cpp -fdeclspec -fsyntax-only -verify -fprebuilt-module-path=%t

//--- repro_decl.hpp
#pragma once

extern "C"
{
__declspec(selectany) int foo = 0;
}

//--- repro.cppm
module;
#include "repro_decl.hpp"

export module repro;

export inline int func()
{
return foo;
}

//--- source.cpp
// expected-no-diagnostics
import repro;

#include "repro_decl.hpp"
53 changes: 31 additions & 22 deletions clang/unittests/Format/FormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8292,31 +8292,40 @@ TEST_F(FormatTest, BreakConstructorInitializersAfterColon) {
Style);

Style.ColumnLimit = 0;
verifyFormat("SomeClass::Constructor() :\n"
" a(a) {}",
Style);
verifyFormat("SomeClass::Constructor() noexcept :\n"
" a(a) {}",
Style);
verifyFormat("SomeClass::Constructor() :\n"
" a(a), b(b), c(c) {}",
Style);
verifyFormat("SomeClass::Constructor() :\n"
" a(a) {\n"
" foo();\n"
" bar();\n"
"}",
verifyNoChange("SomeClass::Constructor() :\n"
" a(a) {}",
Style);
verifyNoChange("SomeClass::Constructor() noexcept :\n"
" a(a) {}",
Style);
verifyNoChange("SomeClass::Constructor() :\n"
" a(a), b(b), c(c) {}",
Style);
verifyNoChange("SomeClass::Constructor() :\n"
" a(a) {\n"
" foo();\n"
" bar();\n"
"}",
Style);
verifyFormat("struct Foo {\n"
" int x;\n"
" Foo() : x(0) {}\n"
"};",
"struct Foo {\n"
" int x;\n"
" Foo():x(0) {}\n"
"};",
Style);

Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
verifyFormat("SomeClass::Constructor() :\n"
" a(a), b(b), c(c) {\n"
"}",
Style);
verifyFormat("SomeClass::Constructor() :\n"
" a(a) {\n"
"}",
Style);
verifyNoChange("SomeClass::Constructor() :\n"
" a(a), b(b), c(c) {\n"
"}",
Style);
verifyNoChange("SomeClass::Constructor() :\n"
" a(a) {\n"
"}",
Style);

Style.ColumnLimit = 80;
Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
Expand Down
5 changes: 3 additions & 2 deletions compiler-rt/test/orc/TestCases/Generic/lazy-link.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
; RUN: %clang -c -o %t/bar.o %S/Inputs/bar-ret-void-weak.ll
; RUN: %clang -c -o %t/baz.o %S/Inputs/baz-ret-void-hidden.ll
; RUN: %clang -c -o %t/main.o %s
; RUN: %llvm_jitlink -noexec -show-linked-files %t/main.o -lazy %t/foo.o \
; RUN: -lazy %t/x.o -lazy %t/bar.o -lazy %t/baz.o | FileCheck %s
; RUN: %llvm_jitlink -num-threads=0 -noexec -show-linked-files %t/main.o \
; RUN: -lazy %t/foo.o -lazy %t/x.o -lazy %t/bar.o -lazy %t/baz.o \
; RUN: | FileCheck %s
;
; UNSUPPORTED: system-windows
; REQUIRES: target={{(arm|aarch|x86_)64.*}}
Expand Down
1 change: 1 addition & 0 deletions flang/include/flang/Optimizer/Builder/IntrinsicCall.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ struct IntrinsicLibrary {
template <typename Shift>
mlir::Value genMask(mlir::Type, llvm::ArrayRef<mlir::Value>);
mlir::Value genMatchAllSync(mlir::Type, llvm::ArrayRef<mlir::Value>);
mlir::Value genMatchAnySync(mlir::Type, llvm::ArrayRef<mlir::Value>);
fir::ExtendedValue genMatmul(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>);
fir::ExtendedValue genMatmulTranspose(mlir::Type,
llvm::ArrayRef<fir::ExtendedValue>);
Expand Down
Loading