Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f63d33d
Reland "[clang] Refactor option-related code from clangDriver into ne…
naveen-seth Nov 10, 2025
4ae7348
[DirectX] Teach DXILResourceAccess about cbuffers (#164554)
bogner Nov 10, 2025
793ab6a
X86: Enable terminal rule (#165957)
arsenm Nov 10, 2025
2fc2e1f
[LLDB] Fix darwin shell tests under ASAN
adrian-prantl Nov 10, 2025
f8e9723
ARM: Enable terminal rule (#165958)
arsenm Nov 10, 2025
2aa629d
AArch64: Enable terminal rule (#165959)
arsenm Nov 10, 2025
067f155
[AMDGPU] remove clamp and omod for trans bf16 insts (#165819)
broxigarchen Nov 10, 2025
826cadd
[Hexagon] Clean-up Instrprof test (#166990)
fhossein-quic Nov 10, 2025
17e2641
[bazel][clang] Port #167374: split clang options/driver (#167387)
rupprecht Nov 10, 2025
a37c4e0
[NFC][SpecialCaseList] Hide Section internals in private section (#16…
vitalybuka Nov 10, 2025
b4a6151
[CIR][NFC] Re-land: Add test for Complex imag literal GNU extension (…
AmrDeveloper Nov 10, 2025
540250c
[OpenMP][Clang] Add codegen support for dyn_groupprivate clause (#152…
kevinsala Nov 10, 2025
20e1a12
[LLDB] Fix (more) darwin shell tests under ASAN
adrian-prantl Nov 10, 2025
fb2fa21
[AMDGPU] Remove calling conv check on entry function (#162080)
jofrn Nov 10, 2025
4b9d7e1
Reapply "[libc] Return errno from OFD failure paths in fcntl." (#1666…
jtstogel Nov 10, 2025
8c86bc8
AMDGPU/GlobalISel: Fix AGPR regbank check for mfma_scale (#167393)
arsenm Nov 10, 2025
0767c64
[VPlan] Use getDefiningRecipe instead of directly accessing Def. (NFC)
fhahn Nov 10, 2025
a1934ee
[NFC][SpecialCaseList] Replace callback with return value (#165943)
vitalybuka Nov 10, 2025
046ae85
[scudo] Small cleanup of memory tagging code. (#166860)
cferris1000 Nov 10, 2025
8b1cc2d
[VPlan] Update canNarrowLoad to check WidenMember0's op first (NFCI).
fhahn Nov 10, 2025
95db31e
Treat specifying a function in the bbsection profile without any dire…
rlavaee Nov 10, 2025
d5125b3
[flang][CUDA] Unify element size computation in CUF helpers (#167398)
wangzpgi Nov 10, 2025
7b12a08
[AArch64] Allow peephole to optimize AND + signed compare with 0 (#15…
AZero13 Nov 10, 2025
bf3b704
[flang][NFC] Characterize allocation based on MemAlloc effect instead…
SusanTan Nov 10, 2025
ad9eb0d
Add default empty header filter regex to root .clang-tidy (#167386)
vbvictor Nov 10, 2025
11ab23c
CodeGen: Keep reference to TargetRegisterInfo in TargetInstrInfo (#15…
arsenm Nov 10, 2025
da996a3
[NFC][SpecialCaseList] Refactor error handling (#167277)
vitalybuka Nov 10, 2025
5b8e869
[llc] Fix save-stats test in read only directories (#167403)
michaelrj-google Nov 10, 2025
c5ce802
[libc] fwrite_unlocked: only return errno if an actual error occurred…
Sterling-Augustine Nov 10, 2025
b1b1257
merge main into amd-staging
ronlieb Nov 11, 2025
3a73595
Revert "Reland "[clang] Refactor option-related code from clangDriver…
ronlieb Nov 11, 2025
fa81402
merge main into amd-staging
ronlieb Nov 11, 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
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
HeaderFilterRegex: ''
Checks: >
-*,
clang-diagnostic-*,
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/Diagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ WarningsSpecialCaseList::create(const llvm::MemoryBuffer &Input,
void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
static constexpr auto WarningFlavor = clang::diag::Flavor::WarningOrError;
for (const auto &SectionEntry : sections()) {
StringRef DiagGroup = SectionEntry.SectionStr;
StringRef DiagGroup = SectionEntry.name();
if (DiagGroup == "*") {
// Drop the default section introduced by special case list, we only
// support exact diagnostic group names.
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/ProfileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ProfileSpecialCaseList : public llvm::SpecialCaseList {

bool hasPrefix(StringRef Prefix) const {
for (const auto &It : sections())
if (It.Entries.count(Prefix) > 0)
if (It.hasPrefix(Prefix))
return true;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Basic/SanitizerSpecialCaseList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void SanitizerSpecialCaseList::createSanitizerSections() {
SanitizerMask Mask;

#define SANITIZER(NAME, ID) \
if (S.SectionMatcher.matchAny(NAME)) \
if (S.matchName(NAME)) \
Mask |= SanitizerKind::ID;
#define SANITIZER_GROUP(NAME, ID, ALIAS) SANITIZER(NAME, ID)

Expand All @@ -68,7 +68,7 @@ SanitizerSpecialCaseList::inSectionBlame(SanitizerMask Mask, StringRef Prefix,
if (S.Mask & Mask) {
unsigned LineNum = S.S.getLastMatch(Prefix, Query, Category);
if (LineNum > 0)
return {S.S.FileIdx, LineNum};
return {S.S.fileIndex(), LineNum};
}
}
return NotFound;
Expand Down
51 changes: 38 additions & 13 deletions clang/lib/CodeGen/CGOpenMPRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10083,19 +10083,44 @@ static llvm::Value *emitDeviceID(
return DeviceID;
}

static llvm::Value *emitDynCGGroupMem(const OMPExecutableDirective &D,
CodeGenFunction &CGF) {
llvm::Value *DynCGroupMem = CGF.Builder.getInt32(0);

if (auto *DynMemClause = D.getSingleClause<OMPXDynCGroupMemClause>()) {
CodeGenFunction::RunCleanupsScope DynCGroupMemScope(CGF);
llvm::Value *DynCGroupMemVal = CGF.EmitScalarExpr(
DynMemClause->getSize(), /*IgnoreResultAssign=*/true);
DynCGroupMem = CGF.Builder.CreateIntCast(DynCGroupMemVal, CGF.Int32Ty,
/*isSigned=*/false);
static std::pair<llvm::Value *, OMPDynGroupprivateFallbackType>
emitDynCGroupMem(const OMPExecutableDirective &D, CodeGenFunction &CGF) {
llvm::Value *DynGP = CGF.Builder.getInt32(0);
auto DynGPFallback = OMPDynGroupprivateFallbackType::Abort;

if (auto *DynGPClause = D.getSingleClause<OMPDynGroupprivateClause>()) {
CodeGenFunction::RunCleanupsScope DynGPScope(CGF);
llvm::Value *DynGPVal =
CGF.EmitScalarExpr(DynGPClause->getSize(), /*IgnoreResultAssign=*/true);
DynGP = CGF.Builder.CreateIntCast(DynGPVal, CGF.Int32Ty,
/*isSigned=*/false);
auto FallbackModifier = DynGPClause->getDynGroupprivateFallbackModifier();
switch (FallbackModifier) {
case OMPC_DYN_GROUPPRIVATE_FALLBACK_abort:
DynGPFallback = OMPDynGroupprivateFallbackType::Abort;
break;
case OMPC_DYN_GROUPPRIVATE_FALLBACK_null:
DynGPFallback = OMPDynGroupprivateFallbackType::Null;
break;
case OMPC_DYN_GROUPPRIVATE_FALLBACK_default_mem:
case OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown:
// This is the default for dyn_groupprivate.
DynGPFallback = OMPDynGroupprivateFallbackType::DefaultMem;
break;
default:
llvm_unreachable("Unknown fallback modifier for OpenMP dyn_groupprivate");
}
} else if (auto *OMPXDynCGClause =
D.getSingleClause<OMPXDynCGroupMemClause>()) {
CodeGenFunction::RunCleanupsScope DynCGMemScope(CGF);
llvm::Value *DynCGMemVal = CGF.EmitScalarExpr(OMPXDynCGClause->getSize(),
/*IgnoreResultAssign=*/true);
DynGP = CGF.Builder.CreateIntCast(DynCGMemVal, CGF.Int32Ty,
/*isSigned=*/false);
}
return DynCGroupMem;
return {DynGP, DynGPFallback};
}

static void genMapInfoForCaptures(
MappableExprsHandler &MEHandler, CodeGenFunction &CGF,
const CapturedStmt &CS, llvm::SmallVectorImpl<llvm::Value *> &CapturedVars,
Expand Down Expand Up @@ -10640,7 +10665,7 @@ static void emitTargetCallKernelLaunch(
llvm::Value *RTLoc = OMPRuntime->emitUpdateLocation(CGF, D.getBeginLoc());
llvm::Value *NumIterations =
OMPRuntime->emitTargetNumIterationsCall(CGF, D, SizeEmitter);
llvm::Value *DynCGGroupMem = emitDynCGGroupMem(D, CGF);
auto [DynCGroupMem, DynCGroupMemFallback] = emitDynCGroupMem(D, CGF);
llvm::OpenMPIRBuilder::InsertPointTy AllocaIP(
CGF.AllocaInsertPt->getParent(), CGF.AllocaInsertPt->getIterator());

Expand All @@ -10650,7 +10675,7 @@ static void emitTargetCallKernelLaunch(

llvm::OpenMPIRBuilder::TargetKernelArgs Args(
NumTargetItems, RTArgs, NumIterations, NumTeams, NumThreads,
DynCGGroupMem, HasNoWait);
DynCGroupMem, HasNoWait, DynCGroupMemFallback);

llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
cantFail(OMPRuntime->getOMPBuilder().emitKernelLaunch(
Expand Down
39 changes: 39 additions & 0 deletions clang/test/CIR/CodeGen/complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,3 +1495,42 @@ void calling_function_that_return_complex() {
// OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
// OGCG: store float %[[RESULT_REAL]], ptr %[[A_REAL_PTR]], align 4
// OGCG: store float %[[RESULT_IMAG]], ptr %[[A_IMAG_PTR]], align 4

void imag_literal_gnu_extension() {
float _Complex a = 3.0fi;
double _Complex b = 3.0i;
int _Complex c = 3i;
}

// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a", init]
// CIR: %[[B_ADDR:.*]] = cir.alloca !cir.complex<!cir.double>, !cir.ptr<!cir.complex<!cir.double>>, ["b", init]
// CIR: %[[C_ADDR:.*]] = cir.alloca !cir.complex<!s32i>, !cir.ptr<!cir.complex<!s32i>>, ["c", init]
// CIR: %[[COMPLEX_A:.*]] = cir.const #cir.const_complex<#cir.fp<0.000000e+00> : !cir.float, #cir.fp<3.000000e+00> : !cir.float> : !cir.complex<!cir.float>
// CIR: cir.store{{.*}} %[[COMPLEX_A]], %[[A_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
// CIR: %[[COMPLEX_B:.*]] = cir.const #cir.const_complex<#cir.fp<0.000000e+00> : !cir.double, #cir.fp<3.000000e+00> : !cir.double> : !cir.complex<!cir.double>
// CIR: cir.store{{.*}} %[[COMPLEX_B]], %[[B_ADDR]] : !cir.complex<!cir.double>, !cir.ptr<!cir.complex<!cir.double>>
// CIR: %[[COMPLEX_C:.*]] = cir.const #cir.const_complex<#cir.int<0> : !s32i, #cir.int<3> : !s32i> : !cir.complex<!s32i>
// CIR: cir.store{{.*}} %[[COMPLEX_C]], %[[C_ADDR]] : !cir.complex<!s32i>, !cir.ptr<!cir.complex<!s32i>>

// LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 4
// LLVM: %[[B_ADDR:.*]] = alloca { double, double }, i64 1, align 8
// LLVM: %[[C_ADDR:.*]] = alloca { i32, i32 }, i64 1, align 4
// LLVM: store { float, float } { float 0.000000e+00, float 3.000000e+00 }, ptr %[[A_ADDR]], align 4
// LLVM: store { double, double } { double 0.000000e+00, double 3.000000e+00 }, ptr %[[B_ADDR]], align 8
// LLVM: store { i32, i32 } { i32 0, i32 3 }, ptr %[[C_ADDR]], align 4

// OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 4
// OGCG: %[[B_ADDR:.*]] = alloca { double, double }, align 8
// OGCG: %[[C_ADDR:.*]] = alloca { i32, i32 }, align 4
// OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 0
// OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
// OGCG: store float 0.000000e+00, ptr %[[A_REAL_PTR]], align 4
// OGCG: store float 3.000000e+00, ptr %[[A_IMAG_PTR]], align 4
// OGCG: %[[B_REAL_PTR:.*]] = getelementptr inbounds nuw { double, double }, ptr %[[B_ADDR]], i32 0, i32 0
// OGCG: %[[B_IMAG_PTR:.*]] = getelementptr inbounds nuw { double, double }, ptr %[[B_ADDR]], i32 0, i32 1
// OGCG: store double 0.000000e+00, ptr %[[B_REAL_PTR]], align 8
// OGCG: store double 3.000000e+00, ptr %[[B_IMAG_PTR]], align 8
// OGCG: %[[C_REAL_PTR:.*]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[C_ADDR]], i32 0, i32 0
// OGCG: %[[C_IMAG_PTR:.*]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[C_ADDR]], i32 0, i32 1
// OGCG: store i32 0, ptr %[[C_REAL_PTR]], align 4
// OGCG: store i32 3, ptr %[[C_IMAG_PTR]], align 4
4 changes: 3 additions & 1 deletion clang/test/CodeGen/Inputs/basic-block-sections.funcnames
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
!world
v1
f world
c 0
6 changes: 4 additions & 2 deletions clang/test/CodeGen/basic-block-sections.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ int another(int a) {
//
// BB_WORLD: .section .text.world,"ax",@progbits{{$}}
// BB_WORLD: world:
// BB_WORLD: .section .text.world,"ax",@progbits,unique
// BB_WORLD: world.__part.1:
// BB_ALL: .section .text.world,"ax",@progbits,unique
// BB_ALL: world.__part.1:
// BB_LIST: .section .text.split.world,"ax",@progbits
// BB_LIST: world.cold:
// BB_ALL: .section .text.another,"ax",@progbits
// BB_ALL: another.__part.1:
// BB_LIST-NOT: .section .text.another,"ax",@progbits
Expand Down
Loading