[libclang/python] Fix Type.get_offset annotation (#187841)
As discussed in
https://github.com/llvm/llvm-project/pull/180876#discussion_r2934372753,
`Type.get_offset` can process `bytes` arguments as well. For consistency
with other functions taking `str` arguments, its type annotation is
adapted to reflect this.
[OpenMP][flang] Fix crash in host offload
Guard `getGridValue` in `OMPIRBuilder` to avoid reaching the
`unreachable` in `getGridValue` when offloading to host device without
an explicit num_threads clause.
Reproducer (`-fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu`):
```
program test
implicit none
!$omp target
!$omp end target
end program test
```
(Note: the linker still fails, but that's another issue.)
[lldb] Fix LLVMSupportHTTP linkage against libLLVM (#187848)
Regression introduced in 39d6bb21804d21abe2fa0ec019919d72104827ac.
Signed-off-by: Michał Górny <mgorny at gentoo.org>
[flang][OpenMP] Provide reasons for calculated sequence length
If the length was limited by some factor, include the reason for what
caused the reduction.
Issue: https://github.com/llvm/llvm-project/issues/185287
[SLP]Do not consider copyable node with SplitVectorize parent
If the copyables are schedulable and the parent node is plit vectorize,
need to skip the scheduling analysis for such nodes to avoid a compiler
crash
[CIR] Add RecursiveMemoryEffects to region-bearing ops
Add the RecursiveMemoryEffects trait to cir.if, cir.case, loop ops
(cir.while/cir.do/cir.for), cir.ternary, cir.await,
cir.array.ctor, cir.array.dtor, and cir.try. Without this trait,
MLIR conservatively assumes unknown memory effects for ops with
regions, preventing DCE of ops whose bodies are provably pure.
Also fix a crash in ConditionOp::getSuccessorRegions where the
missing early return after the loop-op case would fall through to
cast<AwaitOp>(...), which asserts when the parent is a loop rather
than an await op.
Add tests verifying that region ops with pure bodies are eliminated
and ops with stores or calls are preserved, including two-level nested
propagation (cir.if inside cir.while).
[libclang/python] export libclang version to the bindings (#86931)
It's useful to know which clang library the python bindings are running.
---------
Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
[lldb] Fix linking liblldb in a dylib build after 39d6bb21804d21ab
Referencing libSupportHTTP under LINK_LIBS of add_lldb_library() pulls
in the static archive even in a build configuration with
LLVM_LINK_LLVM_DYLIB=On, where libSupportHTTP is part of libLLVM. This
patch moves it to LINK_COMPONENTS to fix the issue.
This is the same fix as in
036429881f8d3037894042c6268b2a94eac8c950, applied on another
library.
[CIR] Fix reference alignment to use pointee type (#186667)
getNaturalTypeAlignment on a reference type returned pointer alignment
instead of pointee alignment. Pass the pointee type with
forPointeeType=true to match traditional codegen's
getNaturalPointeeTypeAlignment behavior. Fix applies to both argument
and return type attribute construction paths.
InstCombine: Fold out nanless canonicalize pattern
Pattern match a wrapper around llvm.canonicalize which
weakens the semantics to not require quieting signaling
nans. Depending on the denormal mode and FP type, we can
either drop the pattern entirely or reduce it only to
a canonicalize call. I'm inventing this pattern to deal
with LLVM's lax canonicalization model in math library
code.
The math library code currently has explicit checks for
the denormal mode, and conditionally canonicalizes the
result if there is flushing. Semantically, this could be
directly replaced with a simple call to llvm.canonicalize,
but doing so would incur an additional cost when using
standard IEEE behavior. If we do not care about quieting
a signaling nan, this should be a no-op unless the denormal
mode may flush. This will allow replacement of the
conditional code with a zero cost abstraction utility
[17 lines not shown]
[CIR] Fix reference alignment to use pointee type
getNaturalTypeAlignment on a reference type returned pointer alignment
instead of pointee alignment. Pass the pointee type with
forPointeeType=true to match traditional codegen's
getNaturalPointeeTypeAlignment behavior. Fix applies to both argument
and return type attribute construction paths.
[OpenMP][flang] Fix crash in host offload
Guard `getGridValue` in `OMPIRBuilder` to avoid reaching the
`unreachable` in `getGridValue` when offloading to host device without
an explicit num_threads clause.
Reproducer (`-fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu`):
```
program test
implicit none
!$omp target
!$omp end target
end program test
```
(Note: the linker still fails, but that's another issue.)
[clang][AST] Preserve qualifiers in getFullyQualifiedType for AutoType (#187717)
A previous change (86c4e96) did not preserve qualifiers attached to the
AutoType QualType when the type was deduced.
For an AutoType after `getDeducedType()`, qualifiers from the original
QualType were dropped. Preserve and reapply them to the deduced type.
[mlir][SPIRV] Add alignment calculation to support `PhysicalStorageBuffer` with vector types (#187698)
This allows to lower `memref.load`/`store` operations on
`PhysicalStorageBuffer`-typed resources with the underlying type being a
vector type. This improves support for the `PhysicalStorageBuffer`
capability in pipelines that use the Vector dialect for distribution.
Signed-off-by: Artem Gindinson <gindinson at roofline.ai>
[clang-tidy] Speed up `bugprone-suspicious-semicolon` (#187558)
```txt
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
Status quo: 0.4743 (100.0%) 0.3802 (100.0%) 0.8546 (100.0%) 0.8567 (100.0%) bugprone-suspicious-semicolon
With this change: 0.0103 (100.0%) 0.0027 (100.0%) 0.0130 (100.0%) 0.0133 (100.0%) bugprone-suspicious-semicolon
```
Continuing the trend of registering one `anyOf` matcher being slower
than registering each of its matchers separately (see #178829 for a
previous example).
(This PR also changes the traversal mode, but I only saw a small speedup
from that. Most of it came from registering the matchers separately.)
This check wasn't super expensive to begin with, but the speedup is
still pretty nice.
[NFC][clang] Remove dead code in HandleCXXModuleDirective (#187737)
Remove the dead code in `Preprocessor::HandleCXXModuleDirective`.
Signed-off-by: yronglin <yronglin777 at gmail.com>