AArch64: Look through copies in CCMP converter.
The usual IR pattern for llvm.ptrauth.auth involves creating an
inttoptr for the auth operation to convert the result into a pointer.
CodeGenPrepare will copy these inttoptr operations into the user basic
blocks as this generally results in more efficient code. However, this is
not the case for the CCMP converter as it will encounter a COPY created
by the inttoptr and inhibit the optimization. Fix it by looking through
copies in the CCMP converter pass.
Assisted-by: gemini (wrote test)
Reviewers: davemgreen, fmayer, atrosinenko
Reviewed By: fmayer
Pull Request: https://github.com/llvm/llvm-project/pull/186842
[ValueTracking] frem in computeKnownFPClass can not return +/-Inf (#186748)
`frem` only produces finite numbers or NaN, never +/-Inf. Before the
patch `computeKnownFPClass` failed to clear the `fcInf` mask for
`Instruction::FRem`, causing potential missed optimizations.
Fix #186746.
[mlir][Interfaces][NFC] Improve time complexity of RegionBranchOpInterface canonicalization patterns (#186114)
Optimize RemoveDuplicateSuccessorInputUses in
`ControlFlowInterfaces.cpp`:
- Replace O(n² * k) pairwise comparison of successor inputs with O(n * k
* max(log k, log n)) signature-based grouping using `std::map`, where
_n_ is the number of successor inputs and _k_ is the number of
predecessors per input.
Assisted-by: Claude Code
---------
Co-authored-by: Yang Bai <yangb at nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[llvm-ir2vec] Refactoring the ir2vec python bindings testing (#180664)
This is order to make it more thorough and cover the API and possible
exceptions better
[clang][OpenMP] Parse/Sema for OpenMP 6.0 declare_target 'local' clause (#186281)
Parse and perform semantic checks for declare_target 'local' clause.
When compiling for device offloading, generate a warning that 'local' is
not yet fully supported. On the host, 'local' is/will be a no-op, so no
warning is generated.
NOTE: The minimal CodeGen changes allow 'local' to flow through as
equivalent to the 'enter' clause after warning is generated.
Testing:
- Updated messages and ast tests for declare target/declare_target
- ninja check-all.
[AMDGPU] Add s_sethalt to hasUnwantedEffectsWhenEXECEmpty (#186745)
We don't want to execute s_sethalt when all lanes want to skip it.
Co-authored-by: Junda Liu <Junda.Liu at amd.com>
[clang] Backport: use canonical arguments for checking function template constraints
Backport from #186889
This is a partial revert of #161671, restoring the original behaviour
where the canonical template arguments are used for function template
constraint checking in diagnostics.
This reverts the fix from #183010, which attempted to fix #182344
but it causes regressions. These regressions now have test cases
included.
The attempt at #183010 is flawed because in the general case we can't
check satisfaction for constraints which have unsubstituted template
arguments, even if they don't affect the canonical type (ie they are
purely
syntactical), because these types can still turn out to be invalid after
substitution.
[20 lines not shown]
[libclc][CMake] Use clang/llvm-ar on Windows (#186726)
When LLVM_TARGETS_TO_BUILD contains host target, runtime build sets
CMAKE_C_COMPILER to clang-cl on Windows.
Changes to fix build on Windows:
- libclc struggles to pass specific flags to clang-cl MSVC-like interface.
- compile flag handling will be consistent across all host systems.
- libclc build is cross-compilation for offloading targets.
[clang] Backport: use canonical arguments for checking function template constraints
Backport from #186889
This is a partial revert of #161671, restoring the original behaviour
where the canonical template arguments are used for function template
constraint checking in diagnostics.
This reverts the fix from #183010, which attempted to fix #182344
but it causes regressions. These regressions now have test cases
included.
The attempt at #183010 is flawed because in the general case we can't
check satisfaction for constraints which have unsubstituted template
arguments, even if they don't affect the canonical type (ie they are
purely
syntactical), because these types can still turn out to be invalid after
substitution.
[20 lines not shown]
[clang] use canonical arguments for checking function template constraints (#186889)
This is a partial revert of #161671, restoring the original behaviour
where the canonical template arguments are used for function template
constraint checking in diagnostics.
This reverts the fix from #183010, which attempted to fix #182344
but it causes regressions. These regressions now have test cases
included.
The attempt at #183010 is flawed because in the general case we can't
check satisfaction for constraints which have unsubstituted template
arguments, even if they don't affect the canonical type (ie they are
purely
syntactical), because these types can still turn out to be invalid after
substitution.
This is a problem when directly evaluating a concept specialization, but
it's not a problem with other template specializations because the
[18 lines not shown]
[ssaf][UnsafeBufferUsage] Add support for extracting unsafe pointers from all kinds of contributors
- Generalize the -Wunsafe-buffer-usage API for finding unsafe pointers in all kinds of Decls
- Add support in SSAF-based UnsafeBufferUsage analysis for extracting from various contributors
- Mock implementation of HandleTranslationUnit
rdar://171735836
[Clang] Fix a concept subsumption bug when template depths are adjusted (#186735)
We cannot reuse the cached normalization results if any template depth
adjustments (in subsumption checking) are involved.
Fixes https://github.com/llvm/llvm-project/issues/186624
[X86] Improve illegal return type handling in FastISel (#186723)
Previously, FastISel would fall back to DAG ISel for any illegal return
type. This change adds a more precise check to determine if the ABI
requires a type conversion that FastISel cannot handle.
For example, bfloat is returned as f16 in XMM0, but FastISel would
assign f32 register type and store it in FuncInfo.ValueMap, causing DAG
to incorrectly perform type conversion from f32 to bfloat later.
However, i1 is promoted to i8 and returned as i8 per the ABI, so
FastISel
can safely lower it without switching to DAGISel. This change enables
FastISel to handle such cases properly.
---------
Co-authored-by: Yuanke Luo <ykluo at birentech.com>