[SLP][NFC]Cache some results to improve compile time, NFC
Try to avoid some recalculations, if possible to cache some previous
results
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/194599
[clang][bytecode] Check method accessibility in `GetMemberPtrDecl` (#194560)
The decl saved in the `MemberPointer` needs to be accessible from its
Base.
[libc] Add the MSG_ flags (#194375)
I've included all of the flags defined on linux, even those not
documented in POSIX (or the manpage). I've also added tests to exercise
the flags, for cases where this can be done with domain sockets.
[AsmPrinter][debug] Materialize abstract lexical blocks referenced by global vars (#193986)
After 63074da2 moved global variable emission from beginModule() to
endModule(), getOrCreateContextDIE() is called after abstract scope DIEs
have been built. However, skipLexicalScope() may have elided an abstract
lexical block that has no local variables. When a global variable (e.g.,
a function-scope static) is scoped to such a block,
getOrCreateContextDIE() returns nullptr causing an assertion. This PR
keeps abstract lexical blocks when they are the scope target of a global
variable in the compile unit.
Derived via LLM usage.
[clang][CodeGenCoroutine] Emit missing cleanup scope for lazy GRO conversion (#194281)
In #151067, we promoted GRO ahead of `coro.end`. However, there is a
regression that GRO cleanup might go into coroutine resume and destroy
parts. This patch introduces a dedicated cleanup scope for GRO, ensuring
that GRO cleanup does not interfere with other logic.
Close #193412
[clang][test] Fix test failures when LLVM_WINDOWS_PREFER_FORWARD_SLASH is ON (#193156)
This commit addresses several test failures in Clang that occur on
Windows when
the CMake option -DLLVM_WINDOWS_PREFER_FORWARD_SLASH=ON is enabled.
Key changes:
- unit tests: Normalized expected paths to native style using
llvm::sys::path::native
(Basic/FileManagerTest, Frontend/ReparseWorkingDirTest) or updated
diagnostic matching
to be separator-agnostic (Driver/ToolChainTest).
- regression tests: Updated FileCheck patterns to use flexible regex
{{[/\\\\]}} or
{{[/\\\\]+}} to match both path separator styles.
- absolute-paths-windows.test: Skipped when forward slashes are
preferred because
mklink does not support forward slashes in directory paths and
interprets them
as command-line switches. Added 'windows-prefer-forward-slash' lit
feature.
[clang][bytecode] Check builtins for number integers (#194324)
This is unfortunate, but since integers can now also be pointers, we
need to check for this everywhere when evaluating builtin functions.
[Clang][AArch64] Fix codegen for SVE vector compare operations (#194013)
Overloaded operartors `<`, `>`, `<=`, `>=`, `==`, and `!=` with SVE
integer vector operands emitted LLVM IR with a couple of issues:
* The `icmp` instruction always performed unsigned comparison, even for
signed operands.
* The result of the comparison was zero-extended, whereas the intent is
to follow established NEON conventions and sign-extend it.
This patches fixes these issues.
[clang][CIR] Add lowering for vrshr_ and vrshrq_ rounding intrinsics (#194229)
This PR adds lowering for the vector rounding shift right intrinsice,
i.e. `vrshr_*` and `vrshrq_*` [1]. It also moves the corresponding tests
from:
* clang/test/CodeGen/AArch64/neon_intrinsics.c
to:
* clang/test/CodeGen/AArch64/neon/intrinsics.c
The lowering follows the existing implementation in
CodeGen/TargetBuiltins/ARM.cpp.
Part of #185382.
Reference:
[1] https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#vector-rounding-shift-right
Co-authored-by: Md Mouzam Arfi Hussain <arfihussain27 at gmail.com>
[InstCombine] Combine llvm.sin/llvm.cos libcall pairs into llvm.sincos (#184760)
Teach InstCombine to recognize pairs of `llvm.sin(x)` and `llvm.cos(x)`
intrinsic calls that share the same argument and replace them with a
single `llvm.sincos(x)` call, extracting the individual results.
The optimization works in two phases:
1. **SimplifyLibCalls**: Convert `sin`/`cos` C library calls (e.g.
`sinf`, `cosf`, `sin`, `cos`, `sinl`, `cosl`) into `llvm.sin` /
`llvm.cos` intrinsics when the call does not access memory (i.e. does
not set `errno`). This normalization step brings library calls into
the same form as compiler-generated intrinsics.
2. **InstCombineCalls**: When visiting an `llvm.sin` or `llvm.cos`
intrinsic, scan the users of the shared argument for a matching
counterpart. If found, emit a single `llvm.sincos` call placed right
after the argument definition, replace both original calls, and erase
the matched instruction.
Also remove the completed sincos TODO from Target/README.txt.
[OpenMP] Rename ompx_taskgraph->omp_taskgraph_experimental
This patch renames the option to enable taskgraph support in the
runtime from OMPX_TASKGRAPH to OMP_TASKGRAPH_EXPERIMENTAL, to reflect
the feature's official status in OpenMP 6.0, but also the feature's
current work-in-progress nature.
commit-id:fa62775a
Reviewers: ro-i
Reviewed By: ro-i
Pull Request: https://github.com/llvm/llvm-project/pull/194045
[X86] Add constant pool comments for (V)GF2P8AFFINEQB instructions (#194572)
Still need to do predicate/broadcast handling, but that's true for most instructions and we need a decent general mechanism to handle them
Revert "[Flang][OpenMP] Clear close on descriptor members for box parents in USM" (#194568)
Reverts llvm/llvm-project#194287
Buildbot errors in https://lab.llvm.org/buildbot/#/builders/67/builds/3464
local revert fixed the issues.
[AArch64][ISel] Remove zero instruction for `rev` all true predicates (#192925)
This patch removes the redundant instruction to zero inactive lanes for
SVE2p1 `rev` intrinsics when all lanes are active.
[mlir][arith] Remove redundant lambdas (NFC) (#194376)
Replace trivial lambda wrappers with direct function references. The
lambdas simply forwarded their arguments to existing functions, so
passing the function directly is clearer and more concise.
[Clang][OpenMP] Validate omp_initial_device omp_invalid_device as device IDs (#193688)
The counterpart fix for clang (as too done here:
[flang-fix](https://github.com/llvm/llvm-project/pull/193669))
The incorrectly interpreted device values in the `target` directive
throws:
```
error: argument to 'device' clause must be a non-negative integer value
#pragma omp target device(-1)
^~
error: argument to 'device' clause must be a non-negative integer value
#pragma omp target device(omp_invalid_device)
^~~~~~~~~~~~~~~~~~
```
[LoongArch] Support VBIT{CLR,SET,REV}I patterns for non-native element sizes
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 (e.g. i16).
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.