[SYCL][Driver] Set -std=c++17 as default for SYCL compilations (#194014)
This PR ensures SYCL compilations default to C++17 when no explicit
standard is specified, and validates that user-provided standards meet
SYCL's C++17 minimum requirement. It also fixes Windows MSVC compilation
by enabling -fms-extensions for SYCL device code.
[AMDGPU][NFC] Remove redundant Args.size() assertions from AMDGPUMCExpr (#194488)
Remove redundant `Args.size()` assertions from `AMDGPUMCExpr` evaluate
functions (`evaluateExtraSGPRs`, `evaluateTotalNumVGPR`,
`evaluateAlignTo`, `evaluateOccupancy`).
These assertions are redundant with the `zip_equal` size checking
performed in the `evaluateMCExprs` helper function introduced in
#193859.
---
*This PR was developed with AI assistance (GitHub Copilot).*
[SLP][NFC]Cache IsExternallyUsed by Value in cost computation
Same V is commonly seen in multiple TEs (shared scalars), and the
expensive part of IsExternallyUsed walks V->users() with multiple
match() pattern checks plus per-user getTreeEntries lookups - all
V-only-dependent. Split out the V-dependent body and memoize by
Value pointer, leaving the TE-specific copyable check at the call
site. DeletedNodes is read-only during the cost loop, so caching
is safe.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/194637
[PAC][lld] Do not emit AUTH relocs against undef weak non-preemptible symbols
Undefined weak non-preemptible symbols should be statically resolved to
the addend value and not signed. Previously, a dynamic relocation
against such symbols was emitted, which is not a correct behavior.
See also docs: https://github.com/ARM-software/abi-aa/pull/391
Resolves #173296
[PhaseOrdering][X86] vector-reductions-expanded.ll - use passes list instead of piped opt stages (#194608)
Cleanup to make it easier to regenerate checks for #194473
[Docs] Fixes indents for InstrRefDebugInfo and KeyInstructionsDebugInfo (#194532)
This distinguishes the doc title from the headers.
Fixes navigation indents for Furo theme update (see
https://github.com/llvm/llvm-project/pull/184440).
[TableGen] Emit constexpr versions of some directive/clause functions
A variant of https://github.com/llvm/llvm-project/pull/176253 with a
change to reduce compile-time impact.
Since "llvm_unreachable" is actually allowed in constexpr functions,
simply emit the bodies of the selected functions in the header file.
In the previous PR the `isAllowedClauseForDirective` function was made
constexpr, but since it was very long it had a significant impact on
compilation time. In this PR that function is no longer constexpr.
[SPIR-V] Matrix in struct pointer legalization (#193073)
When looking to load an object at the start of a struct, the types do
not always match exactly. When we have an HLSL matrix the type in the
load will not match the type in memory. We need to improve the pointer
legalization pass to look for any "compatible" type at the start of an
aggragate.
A compatible are two types that the pass knows know to convert from one
to another.
This involves a refactoring of the code to make the check more general.
Assisted-by: Gemini
<!-- branch-stack-start -->
<!-- branch-stack-end -->
Revert "[PowerPC] Enable using HwMode for instructions (#191051)" (#194464)
This reverts commit 2a83068537786696d4950ce694e7d34480631f48.
It causes test suite failures in the 7zip benchmark.
[SLP][NFC]Cache MightBeIgnored result in gather-shuffle analysis
Each V in VL is queried up to 3 times for MightBeIgnored (direct +
NeighborMightBeIgnored from both neighbors), and the underlying
areAllUsersVectorized walks the instruction's user list. Memoize per
Value pointer to avoid the redundant walks.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/194619
[libc][NFC] Move sys/ucontext.h to YAML generation (#194573)
Renamed sys/ucontext.h to sys/ucontext.h.def and created a corresponding
sys/ucontext.yaml, following the pattern used by sys/prctl. Updated
CMakeLists.txt to use add_header_macro.
Also removed the orphaned top-level ucontext.h.def which was never
referenced by ucontext.yaml.
[clang][modules-driver] Further constrain import-std test (#194604)
The root cause for the failing test was found in
https://github.com/llvm/llvm-project/pull/194475#issuecomment-4335023585.
The test uses `--target=x86_64-linux-gnu` which is only available with
`-DLLVM_TARGETS_TO_BUILD=all` or on native x86 targets.
[llvm] Mark IOSandbox::ScopedSetting nodiscard and maybe_unused (#194602)
The goal is to have the same attributes on ScopedSetting regardless if
this cmake setting is enabled or not.
Both of these should have nodiscard and maybe_unused attributes.
[Clang] fix assertion failure in ::template operator parsing (#194097)
when parsing an invalid `::template operator`, the parser incorrectly
kept the consumed tokens on error. This caused the token cache to go out
of sync and crash. This patch fixes it by reverting the tokens and
properly returning the error
fixes #186582
[SLP][NFC]Cache isUsedOutsideBlock results in gather-shuffle analysis
Hoist loop-invariant predicates and memoize per-UserTE
all_of(Scalars, isUsedOutsideBlock) in
isGatherShuffledSingleRegisterEntry and vectorizeTree to avoid
redundant walks over scalar user lists in the gather-shuffle hot path.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/194612
[flang] allow rebox/embox of OPTIONAL (#194319)
Delay materialization of branches when building local temporary
descriptor for OPTIONAL from hlfir-to-fir until pre-cg-rewrite.
This makes the IR easier to analyze with OPTIONAL (for instance alias
analysis does not need to handle the branches to find the source).
This is done by adding an "optional" attribute to fir.embox, fir.rebox,
and fir.rebox_assumed_rank to indicate that their cogeneration must be
conditional.
The conditional aspect is implemented in pre-cg-rewrite to avoid
complexifying codegen and the fir.cg dialect.
Assisted by: Claude
[clang][bytecode] Don't start record field lifetime by default (#193496)
Even though we have per-field lifetime information we did not previously
diagnose this test:
```c++
struct R {
struct Inner { constexpr int f() const { return 0; } };
int a = b.f();
Inner b;
};
constexpr R r;
```
because the life time was started by default.
This patch makes record members be `Lifetime::NotStarted` by default
(unless they are primitive arrays) and then starts the lifetime when in
`Pointer::initialize()`.
[PhaseOrdering][X86] Copy backend horizontal min/max reduction tests to phaseordering (#194601)
As discussed on #194473 - add middleend test coverage to ensure we're
creating vXi8/vXi16 llvm.vector.reduce calls to ensure we can lower to
PHMINPOS instructions
Also demonstrates that we're still not matching partial reduction
patterns in vectorcombine
[LoongArch] Support VBIT{CLR,SET,REV}I patterns for non-native element sizes (#193719)
Extend vsplat_uimm_{pow2,inv_pow2} matching to allow specifying an
explicit element bit width, enabling recognition of splat patterns whose
logical element size differs from the vector's native element type.
Introduce templated selectVSplatUimm{Pow2,InvPow2} helpers with an
optional EltSize parameter, and add corresponding ComplexPattern
definitions for i8/i16/i32 element widths. This allows TableGen patterns
to match cases such as operating on v8i32/v4i64 vectors with masks
derived from smaller element sizes.
With these changes, AND/OR/XOR operations using inverse power-of-two or
power-of-two splat masks are now correctly selected to VBITCLRI,
VBITSETI, and VBITREVI instructions instead of falling back to vector
logical operations with materialized constants.
[llubi] Implement vector reduction/manipulation intrinsics (#194345)
This PR implements vector reduction and manipulation intrinsics.
Note that floating-point vector reduction intrinsics are not covered by
this change; they will be added in a follow-up PR after #188453 is
merged.
[flang][NFC] Converted five tests from old lowering to new lowering (part 51) (#194522)
Converted Lower/associate-construct.f90,
Lower/default-initialization.f90, Lower/select-type-2.f90,
Lower/statement-function.f90, and Lower/submodule.f90 from legacy
lowering (-hlfir=false) to new lowering (-emit-hlfir).