Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
61b877a
cmake: Filter dangling symlinks from add_td_sources glob (#211051)
arsenm Jul 21, 2026
f63615b
[AMDGPU] Fix wrong min/max for amdgcn.fmed3 NaN 3rd operand (#203822)
aobolensk Jul 21, 2026
879db2f
[AMDGPU] Fix ISel crash on llvm.amdgcn.class with bf16 operand (#210971)
aobolensk Jul 21, 2026
35d69e3
[Analysis] Use CycleInfo for BranchProbabilityInfo (#210301)
aengelke Jul 21, 2026
c2fac16
Revert "[IR] Make semantics of strictfp consistent" (#211057)
aeubanks Jul 21, 2026
48883c5
[WebAssembly] Swap encoding bits for HAS_MEMORY_ORDER for relaxed ato…
dschuff Jul 21, 2026
15de5a2
[Driver] Remove SUSE SLES special casing for hash-style (#210223)
brad0 Jul 21, 2026
d81e22d
[SLP][NFC]Add extra tests for blended loads vectorization, NFC
alexey-bataev Jul 21, 2026
0aa8e45
[CIR] Lower _BitInt to its in-memory storage integer (#206606)
adams381 Jul 21, 2026
49d568a
[DTLTO] Forward loop interchange to DTLTO remote compilations (#208591)
bd1976bris Jul 21, 2026
b35c1aa
Revert "[clang] Update diagnostics to include matrices as accepted ty…
Icohedron Jul 21, 2026
18220e7
[SelectionDAG][GlobalISel] Move `to_tframeindex` & `renderFrameIndex`…
QuantumSegfault Jul 21, 2026
0ee0b97
[mlir][openacc] Support already existing global in GPU module (#210806)
clementval Jul 21, 2026
3f928ae
[SLP]Make the instruction-count check loop-aware
alexey-bataev Jul 21, 2026
1f1fcb9
[Analysis][NFC] Remove LoopBlock in BranchProbabilityInfo (#211083)
aengelke Jul 21, 2026
4bf0d28
[OpenACC/CIR] Remove std::transform_inclusive_scan use (#211076)
erichkeane Jul 21, 2026
5009f54
[flang][OpenMP] Reland implement collapse for imperfectly nested loop…
cenewcombe Jul 21, 2026
12e1c7f
[PAC][libc++] Fix build with `ptrauth_calls` feature (#211033)
kovdan01 Jul 21, 2026
c7e1531
[HLSL][SPIRV] Support Flat and Location decorators in the frontend (#…
farzonl Jul 21, 2026
bf42992
Revert "[SLP]Make the instruction-count check loop-aware"
alexey-bataev Jul 21, 2026
16e009f
[ConstraintElim] Derive signed facts for post-increment inductions. (…
fhahn Jul 21, 2026
e328d6e
[libc++] Use github-script instead of pygithub for benchmark jobs, an…
ldionne Jul 21, 2026
5b6ebc2
[flang][cuda][openacc] Support CUDA calls to ACC routines (#210165)
nvptm Jul 21, 2026
5df4aa1
[flang][acc] Emit unified declare globals as extern. (#210757)
nvptm Jul 21, 2026
5697319
[NVPTX] Simplify BRX emission avoiding pseduo-instruction chain (#209…
AlexMaclean Jul 21, 2026
e8b684a
[SLP]Make the instruction-count check loop-aware
alexey-bataev Jul 21, 2026
f1685cb
workflows/issue-release-workflow: Allow multiple URLs in /cherry-pick…
efriedma-quic Jul 21, 2026
8dc94a5
[CIR] Fix avx512vlbw builtin test run lines (#211063)
andykaylor Jul 21, 2026
ded4902
Revert "[dsymutil] Add support for pseudo probes (#186877)" (#206789)
mustartt Jul 21, 2026
009e841
[flang][cuda] Add option for allocator registration function to CUFAd…
clementval Jul 21, 2026
db816fe
[DirectX][Driver] Add /Qpdb_in_private flag support (#204903)
dzhidzhoev Jul 21, 2026
9a729e7
[Bazel] Fixes db816fe (#211109)
forking-google-bazel-bot[bot] Jul 21, 2026
3421dc2
[MC][AArch64] Add .cfi_set_ra_state for PAuth_LR (#209949)
jroelofs Jul 21, 2026
866832a
[SPIRV] Fix legalization of widened cbuffer vector loads (#209912)
farzonl Jul 21, 2026
e55d3bc
[MC] Emit Mach-O pseudo-probe sections in the __LLVM segment (#206793)
mustartt Jul 21, 2026
c337318
[libc] Migrate printf_core from stdio/ to __support/. (#208303)
strel-12 Jul 21, 2026
96b1003
Reland "[Fuchsia] Stack analysis flags for runtimes" (#211072)
Prabhuk Jul 21, 2026
5503126
[CIR] Flatten loop ops with a cleanup region (#210472)
andykaylor Jul 21, 2026
8bbaac6
TargetParser: Add Triple::getDefaultFloatABI (#210899)
arsenm Jul 21, 2026
8775feb
[clang] Drop stale `*-buildattr` module flag emission (#211021)
kovdan01 Jul 21, 2026
db4d75e
[Xtensa] Add fp16 conversion support (#208206)
gerekon Jul 21, 2026
aace063
[SPIR-V] Erase dead functions in shader modules (#209672)
farzonl Jul 21, 2026
9cfbe4a
[llvm-reduce] Run AssignGUIDPass when loading BC
boomanaiden154 Jul 21, 2026
24586da
[llvm-reduce] Unconditionally initialize targets
boomanaiden154 Jul 21, 2026
fcbf28f
[CIR] Report NYI for defaulted union copy/move assignment
adams381 Jul 21, 2026
4fff13b
[CIR] Classify empty records as Ignore in x86_64 callconv (#211078)
adams381 Jul 21, 2026
3782c00
[clang-sycl-linker] Forward all --ocloc-options occurrences to ocloc …
bader Jul 21, 2026
aef1e4f
[NVPTX] Support short entry param pointers (#206512)
AlexMaclean Jul 21, 2026
b11881e
[BranchFolding] Fold away subsequent identical branches
boomanaiden154 Jul 21, 2026
8b9cce3
Make result variables obey their dynamic values in subsequent express…
jimingham Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/issue-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# If there are multiple /cherry-pick commands they will all be included in the output.
# This is fine since the github-automation.py script can handle multiple cherry-pick commands.
validated_comment=$(\
grep -o -e '/cherry-pick \(https://github.com/llvm/llvm-project/commit/\)\?[a-f0-9 ]\+' <<< $COMMENT_BODY \
grep -o -e '/cherry-pick \(\(https://github.com/llvm/llvm-project/commit/\)\?[a-f0-9]\+ *\)\+' <<< $COMMENT_BODY \
)
echo "Validated Comment is:"
echo ${validated_comment}
Expand Down
140 changes: 79 additions & 61 deletions .github/workflows/libcxx-pr-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,38 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.14'

- name: Setup virtual environment
run: |
python3 -m venv .venv
source .venv/bin/activate
python -m pip install pygithub==2.8.1

- name: Extract information from the PR
id: vars
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
source .venv/bin/activate
cat <<EOF | python >> ${GITHUB_OUTPUT}
import github
repo = github.Github(auth=github.Auth.Token("${{ github.token }}")).get_repo("${{ github.repository }}")
pr = repo.get_pull(${{ github.event.issue.number }})
print(f"pr_base={pr.base.sha}")
print(f"pr_head={pr.head.sha}")
EOF
BENCHMARKS=$(echo "$COMMENT_BODY" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
echo "benchmarks=${BENCHMARKS}" >> ${GITHUB_OUTPUT}
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
core.setOutput('pr_base', pr.data.base.sha);
core.setOutput('pr_head', pr.data.head.sha);
const match = context.payload.comment.body.match(/\/libcxx-bot benchmark (.+)/);
core.setOutput('benchmarks', match ? match[1] : '');

- name: Update comment with link to the run
run: |
source .venv/bin/activate
cat <<EOF | python
import github
repo = github.Github(auth=github.Auth.Token("${{ github.token }}")).get_repo("${{ github.repository }}")
pr = repo.get_pull(${{ github.event.issue.number }})
comment = pr.get_issue_comment(${{ github.event.comment.id }})
add_text = "> _Running benchmarks in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
comment.edit('\n\n'.join([comment.body, add_text]))
EOF
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { data: comment } = await github.rest.issues.getComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
});
const run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const note = `> _Running benchmarks in ${run_url}_`;
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
body: [comment.body, note].join('\n\n'),
});
outputs:
pr_base: ${{ steps.vars.outputs.pr_base }}
pr_head: ${{ steps.vars.outputs.pr_head }}
Expand Down Expand Up @@ -139,7 +134,6 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r libcxx/utils/requirements.txt
python -m pip install pygithub==2.8.1

- name: Build the baseline and the candidate
env:
Expand Down Expand Up @@ -178,30 +172,54 @@ jobs:
./libcxx/utils/compare-benchmarks baseline.lnt candidate.lnt | tee results.txt

- name: Update comment with results
run: |
source .venv/bin/activate
cat <<EOF | python
import github
repo = github.Github(auth=github.Auth.Token("${{ github.token }}")).get_repo("${{ github.repository }}")
pr = repo.get_pull(${{ github.event.issue.number }})
comment = pr.get_issue_comment(${{ github.event.comment.id }})
with open('results.txt', 'r') as f:
benchmark_results = f.read()

new_comment_text = f"""
{comment.body}

<details>
<summary>
Benchmark results for ${{ matrix.platform }}:
</summary>

\`\`\`
{benchmark_results}
\`\`\`

</details>
"""

comment.edit(new_comment_text)
EOF
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
PLATFORM: ${{ matrix.platform }}
with:
script: |
const fs = require('fs');
const results = fs.readFileSync('results.txt', 'utf8');
const { data: comment } = await github.rest.issues.getComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
});
const details = [
'<details>',
'<summary>',
`Benchmark results for ${process.env.PLATFORM}:`,
'</summary>',
'',
'```',
results,
'```',
'',
'</details>',
].join('\n');
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
body: [comment.body, details].join('\n\n'),
});

- name: Report failure in the comment
if: failure()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
PLATFORM: ${{ matrix.platform }}
with:
script: |
const { data: comment } = await github.rest.issues.getComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
});
const run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const note = `> _:x: Benchmarks for ${process.env.PLATFORM} failed. See ${run_url} for details._`;
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
body: [comment.body, note].join('\n\n'),
});
3 changes: 3 additions & 0 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,7 @@ struct CFISnapshot {
case MCCFIInstruction::OpLabel:
case MCCFIInstruction::OpValOffset:
case MCCFIInstruction::OpNegateRAState:
case MCCFIInstruction::OpLLVMSetRAState:
reportFatalUsageError("unsupported CFI opcode");
case MCCFIInstruction::OpLLVMRegisterPair:
case MCCFIInstruction::OpLLVMVectorRegisters:
Expand Down Expand Up @@ -3019,6 +3020,7 @@ struct CFISnapshotDiff : public CFISnapshot {
case MCCFIInstruction::OpLabel:
case MCCFIInstruction::OpValOffset:
case MCCFIInstruction::OpNegateRAState:
case MCCFIInstruction::OpLLVMSetRAState:
reportFatalUsageError("unsupported CFI opcode");
case MCCFIInstruction::OpLLVMRegisterPair:
case MCCFIInstruction::OpLLVMVectorRegisters:
Expand Down Expand Up @@ -3174,6 +3176,7 @@ BinaryFunction::unwindCFIState(int32_t FromState, int32_t ToState,
case MCCFIInstruction::OpLabel:
case MCCFIInstruction::OpValOffset:
case MCCFIInstruction::OpNegateRAState:
case MCCFIInstruction::OpLLVMSetRAState:
reportFatalUsageError("unsupported CFI opcode");
case MCCFIInstruction::OpLLVMRegisterPair:
case MCCFIInstruction::OpLLVMVectorRegisters:
Expand Down
10 changes: 5 additions & 5 deletions clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ if(FUCHSIA_SDK)
set(FUCHSIA_x86_64-unknown-fuchsia_NAME x64)
set(FUCHSIA_riscv64-unknown-fuchsia_NAME riscv64)
foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;arm-unknown-fuchsia;riscv64-unknown-fuchsia)
set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/sync/include -I${FUCHSIA_SDK}/pkg/fdio/include")
set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/sync/include -I${FUCHSIA_SDK}/pkg/fdio/include -fstack-size-section -fexperimental-call-graph-section")
set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
endforeach()
Expand Down Expand Up @@ -326,7 +326,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
if(${target} STREQUAL "armv8.1m.main-none-eabi")
set(BUILTINS_${target}_CMAKE_${lang}_local_flags "${BUILTINS_${target}_CMAKE_${lang}_local_flags} -mfloat-abi=hard -march=armv8.1-m.main+mve.fp+fp.dp -mcpu=cortex-m55")
endif()
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "${BUILTINS_${target}_CMAKE_${lang}_local_flags}" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "${BUILTINS_${target}_CMAKE_${lang}_local_flags} -fstack-size-section -fexperimental-call-graph-section" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand All @@ -352,7 +352,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
if(${target} STREQUAL "armv8.1m.main-none-eabi")
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "${RUNTIMES_${target}_CMAKE_${lang}_local_flags} -mfloat-abi=hard -march=armv8.1-m.main+mve.fp+fp.dp -mcpu=cortex-m55")
endif()
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "${RUNTIMES_${target}_CMAKE_${lang}_local_flags}" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "${RUNTIMES_${target}_CMAKE_${lang}_local_flags} -fstack-size-section -fexperimental-call-graph-section" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand Down Expand Up @@ -394,7 +394,7 @@ foreach(target riscv32-unknown-elf)
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "")
foreach(lang C;CXX;ASM)
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -fstack-size-section -fexperimental-call-graph-section" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand All @@ -410,7 +410,7 @@ foreach(target riscv32-unknown-elf)
foreach(lang C;CXX;ASM)
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
# These should be addressed and removed over time.
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment -fstack-size-section -fexperimental-call-graph-section" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand Down
3 changes: 1 addition & 2 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -13393,8 +13393,7 @@ def err_builtin_is_within_lifetime_invalid_arg : Error<
def err_builtin_invalid_arg_type: Error<
"%ordinal0 argument must be a "
// First component: scalar or container types
"%select{|scalar|vector|matrix|vector of|scalar or vector of|"
"scalar, vector, or matrix of}1"
"%select{|scalar|vector|matrix|vector of|scalar or vector of}1"
// A comma after generic vector/matrix types if there are non-empty second
// and third components, to initiate a list.
"%plural{[2,3]:%plural{0:|:%plural{0:|:,}2}3|:}1"
Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,9 @@ def CIR_WhileOp : CIR_WhileOpBase<"while"> {
mlir::Region *maybeGetCleanup() {
return getCleanup().empty() ? nullptr : &getCleanup();
}
cir::CleanupKindAttr maybeGetCleanupKind() {
return getCleanupKindAttr();
}
llvm::SmallVector<mlir::Region *> getRegionsInExecutionOrder() {
llvm::SmallVector<mlir::Region *> regions{&getCond(), &getBody()};
if (mlir::Region *cleanup = maybeGetCleanup())
Expand Down Expand Up @@ -2386,6 +2389,9 @@ def CIR_ForOp : CIR_LoopOpBase<"for"> {
mlir::Region *maybeGetCleanup() {
return getCleanup().empty() ? nullptr : &getCleanup();
}
cir::CleanupKindAttr maybeGetCleanupKind() {
return getCleanupKindAttr();
}
llvm::SmallVector<mlir::Region *> getRegionsInExecutionOrder() {
llvm::SmallVector<mlir::Region *> regions{&getCond(), &getBody(),
&getStep()};
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/CIR/Interfaces/CIRLoopOpInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
#ifndef CLANG_CIR_INTERFACES_CIRLOOPOPINTERFACE_H
#define CLANG_CIR_INTERFACES_CIRLOOPOPINTERFACE_H

#include "llvm/ADT/APInt.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/Operation.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
#include "llvm/ADT/APInt.h"

using llvm::APInt;
namespace cir {
Expand Down
11 changes: 11 additions & 0 deletions clang/include/clang/CIR/Interfaces/CIRLoopOpInterface.td
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ def LoopOpInterface : OpInterface<"LoopOpInterface", [
/*methodBody=*/"",
/*defaultImplementation=*/"return nullptr;"
>,
InterfaceMethod<[{
Returns the cleanup-kind attribute for the loop's per-iteration
cleanup region, or a null attribute if the loop has no cleanup kind
(e.g. do-while, or a for/while without a cleanup region).
}],
/*retTy=*/"::cir::CleanupKindAttr",
/*methodName=*/"maybeGetCleanupKind",
/*args=*/(ins),
/*methodBody=*/"",
/*defaultImplementation=*/"return {};"
>,
InterfaceMethod<[{
Returns the first region to be executed in the loop.
}],
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Options/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -9923,6 +9923,9 @@ def dxc_gis : DXCFlag<"Gis">,
def : Option<["/", "-"], "Qembed_debug", KIND_FLAG>, Group<dxc_Group>,
Flags<[Ignored]>, Visibility<[DXCOption]>,
HelpText<"Embed PDB in shader container (ignored)">;
def dxc_Qpdb_in_private : DXCFlag<"Qpdb_in_private">,
Flags<[HelpHidden]>,
HelpText<"Store PDB in private user data">;
def spirv : DXCFlag<"spirv">,
HelpText<"Generate SPIR-V code">;
def metal : DXCFlag<"metal">, HelpText<"Generate Metal library">;
Expand Down
14 changes: 14 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,20 @@ void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) {
assert(!cir::MissingFeatures::incrementProfileCounter());
assert(!cir::MissingFeatures::runCleanupsScope());

// A defaulted union copy/move assignment has an empty synthesized body:
// Sema skips union fields (the FIXME in SemaDeclCXX::buildSingleCopyAssign),
// so there is no AST expression for the implied whole-object memcpy.
// Emitting that body would silently drop the copy, so report NYI instead.
// Struct/array memcpy-equivalent assignments carry the implicit memberwise
// copies in the AST (per-field assignment expressions, or a builtin memcpy
// call for array members) and lower correctly through the loop below.
if (assignOp->isMemcpyEquivalentSpecialMember(getContext()) &&
assignOp->getParent()->isUnion()) {
cgm.errorNYI(assignOp->getSourceRange(),
"defaulted union copy/move assignment operator");
return;
}

// Classic codegen uses a special class to attempt to replace member
// initializers with memcpy. We could possibly defer that to the
// lowering or optimization phases to keep the memory accesses more
Expand Down
7 changes: 4 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,10 @@ mlir::Attribute ConstantEmitter::emitForMemory(CIRGenModule &cgm,
cgm.errorNYI("emitForMemory: zero-extend HLSL bool vectors");
}

if (destType->isBitIntType()) {
cgm.errorNYI("emitForMemory: _BitInt type");
}
// CIR represents source types as literally as possible. Some types, such as
// bool and _BitInt(N), are kept at their literal width here and expanded to
// their wider "in memory" types during lowering to the LLVM dialect, so the
// constant is already in the right form and needs no adjustment.

return c;
}
Expand Down
9 changes: 5 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ mlir::Value OpenACCRecipeBuilderBase::makeBoundsAlloca(
// Collect the 'do we have any allocas needed after this type' list.
llvm::SmallVector<bool> allocasLeftArr;
llvm::ArrayRef<QualType> resultTypes = boundTypes.drop_front();
std::transform_inclusive_scan(
resultTypes.begin(), resultTypes.end(),
std::back_inserter(allocasLeftArr), std::plus<bool>{},
[](QualType ty) { return !ty->isConstantArrayType(); }, false);
bool accumulator = false;
for (QualType ty : resultTypes) {
accumulator = accumulator || !ty->isConstantArrayType();
allocasLeftArr.push_back(accumulator);
}

// Keep track of the number of 'elements' that we're allocating. Individual
// allocas should multiply this by the size of its current allocation.
Expand Down
12 changes: 6 additions & 6 deletions clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ static bool isSupportedType(mlir::Type ty) {
// Unions and packed / padded records each need classification this bridge
// does not implement (a union widen fixup and pad-aware eightbyte
// classification), so reject them here and report NYI rather than
// misclassify. Empty-for-ABI records classify as Ignore, which is also
// deferred: a C empty struct is a zero-field record, and CIRGen lays out
// an empty C++ class as a single padded byte (caught by the padded check).
// misclassify. A zero-field record (a C empty struct) classifies as
// Ignore and is dropped from the lowered signature. CIRGen lays out an
// empty C++ class as a single padded byte, which the padded check rejects.
// A real one-byte struct such as `{char[1]}` has a field and is not
// padded, so it is classified normally.
if (recTy.isUnion() || !recTy.isComplete() || recTy.getPacked() ||
recTy.getPadded() || recTy.getMembers().empty())
recTy.getPadded())
return false;
return llvm::all_of(recTy.getMembers(),
[](mlir::Type m) { return isSupportedType(m); });
Expand Down Expand Up @@ -257,8 +257,8 @@ static const llvm::abi::Type *mapCIRType(mlir::Type type,
/// Indirect: an aggregate that does not fit in registers is passed via a
/// pointer (sret for returns, byval for arguments).
///
/// Ignore: a void return has no register or stack slot. (Empty-for-ABI
/// records are rejected by isSupportedType, so they never reach here.)
/// Ignore: a void return has no register or stack slot, and a zero-field
/// (empty) record is dropped from the signature.
static std::optional<ArgClassification>
convertABIArgInfo(const llvm::abi::ArgInfo &info, MLIRContext *ctx,
mlir::Type origTy) {
Expand Down
Loading
Loading