[VPlan] Inline WidenSelect::isInvariantCond (NFC) (#166742)
VPWidenSelectRecipe::isInvariantCond has a sole use: inline it in the
use-site, as it is not meant to be used standalone.
[libcxxabi][ItaniumDemangle] Separate GtIsGt counter into more states (#166578)
Currently `OutputBuffer::GtIsGt` is used to tell us if we're inside
template arguments and have printed a '(' without a closing ')'. If so,
we don't need to quote '<' when printing it as part of a binary
expression inside a template argument. Otherwise we need to. E.g.,
```
foo<a<(b < c)>> // Quotes around binary expression needed.
```
LLDB's `TrackingOutputBuffer` has heuristics that rely on checking
whether we are inside template arguments, regardless of the current
parentheses depth. We've been using `isGtInsideTemplateArgs` for this,
but that isn't correct. Resulting in us incorrectly tracking the
basename of function like:
```
void func<(foo::Enum)1>()
```
Here `GtIsGt > 0` despite us being inside template arguments (because we
[12 lines not shown]
[clang-doc] remove indentation for preformatted text
Text that is in between <pre> tags is formatted verbatim. Thus, the
text that was correctly indented in relation to its depth in HTML was
being indented incorrectly when rendered. That resulted in bad looking pages.
[libc++] Simplify most of the segmented iterator optimizations (#164797)
This patch does two things.
(1) It replaces SFINAE with `if constexpr`, avoiding some overload
resolution and unnecessary boilerplate.
(2) It removes an overload from `__for_each_n` to forward to
`__for_each`, since `__for_each` doesn't provide any further
optimizations.
[clang-doc] remove indentation for preformatted text
Text that is in between <pre> tags is formatted verbatim. Thus, the
text that was correctly indented in relation to its depth in HTML was
being indented incorrectly when rendered. That resulted in bad looking pages.
[orc-rt] Add endian_read/write operations. (#166892)
The endian_read and endian_write operations read and write unsigned
integers stored in a given endianness.
[NFCI][lldb][test] Avoid unnecessary GNU extension for assembly call (#166769)
`asm()` on function declarations is used for specifying the mangling. But it's a GNU extension and
very much unnecessary here since the name matches.
Fixes compiling if the compiler defaults to non-extensions mode.
[RISCV] Support outlining of CFI instructions in the machine outliner (#166149)
Add support for outlining CFI instructions if
a) the outlined function is being tail called
b) all of the CFI instructions in the function are being outlined
This is similar to what is being done on AArch64 and X86.
---------
Co-authored-by: Craig Topper <craig.topper at sifive.com>
[AMDGPU] Add liverange split instructions into BB Prolog
The COPY inserted for liverange split during sgpr-regalloc
pipeline currently breaks the BB prolog during the subsequent
vgpr-regalloc phase while spilling and/or splitting the vector
liveranges. This patch fixes it by correctly including the
the LR split instructions during sgpr-regalloc and wwm-regalloc
pipelines into the BB prolog.
[bazel] Add missing deps for AlignmentAttrInterface.h (#166899)
Commit 4a7d3df added `#include "AlignmentAttrInterface.h"` in three
places: MemRef.h, SPIRVOps.h, and VectorOps.h; my previous bazel fix
7e9db96 only covered MemRef.h, but not the other two.
AArch64: support extended spills in SEH on WoS (#166849)
When lowering code for Windows, we might be using a non-standard calling
convention (e.g. `preserve_most`). In such a case, we might be spilling
registers which are unexpected (i.e. x9-x15). Use the ARM64EC opcodes to
indicate such spills.
This adds support for the handling for these spills but is insufficient
on its own. The encoded results are incorrect due to the expectation
that the pair wise spills are always 16-byte aligned which we currently
do not enforce. Fixing that is beyond the scope of emitting the SEH
directives for the spill.
[RISCV] Use SLLI.UW in double-SHL_ADD multiplications (#166728)
Similarily to muls by 3/5/9 << N, emit the SHL first for other SHL_ADD
multiplications, if it can be fold into SLLI.UW.
[CodeGen] Introduce MI flag for Live Range split instructions
For some targets, it is required to identify the COPY instruction
corresponds to the RA inserted live range split. Adding the new
flag `MachineInstr::LRSplit` to serve the purpose.
[Option] Fix simple subcommand with positional arguments (#166859)
Fix subcommand detection when subcommand used with positional arguments.
When there is only one valid subcommand passed,
`ArgList::getSubCommand()` should return the correct subcommand even
there are other positionals passed.
[WIP][IR][Constants] Change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer
The value of a `nullptr` is not always `0`. For example, on AMDGPU, the `nullptr` in address spaces 3 and 5 is `0xffffffff`. Currently, there is no target-independent way to get this information, making it difficult and error-prone to handle null pointers in target-agnostic code.
We do have `ConstantPointerNull`, but it might be a little confusing and misleading. It represents a pointer with an all-zero value rather than necessarily a real `nullptr`. Therefore, to represent a real `nullptr` in address space `N`, we need to use `addrspacecast ptr null to ptr addrspace(N)` and it can't be folded.
In this PR, we change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer. Here is the detailed changes.
* `ptr addrspace(N) null` will represent the actual `nullptr` in address space `N`.
* `ptr addrspace(N) zeroinitializer` will represent a zero-value pointer in address space `N`.
* `Constant::getNullValue` will return a _null_ value. It is same as the current semantics except for the `PointerType`, which will return a real `nullptr` pointer.
* `Constant::getZeroValue` will return a zero value constant. It is completely same as the current semantics. To represent a zero-value pointer, a `ConstantExpr` will be used (effectively `inttoptr i8 0 to ptr addrspace(N)`).
* Correspondingly, there will be both `Constant::isNullValue` and `Constant::isZeroValue`.
The RFC is https://discourse.llvm.org/t/rfc-introduce-sentinel-pointer-value-to-datalayout/85265. It is a little bit old and the title might look different, but everything eventually converges to this change. An early attempt can be found in https://github.com/llvm/llvm-project/pull/131557, which has many valuable discussion as well.
This PR is still WIP but any early feedback is welcome. I'll include as many necessary code changes as possible in this PR, but eventually this needs to be carefully split into multiple PRs, and I'll do it after the changes look good to every one.
Use `llvm::unique_function` in the async APIs (#166727)
This is needed to allow using these APIs with callable objects that
transitively capture move-only constructs. These come up very widely
when writing concurrent code such a `std::future`, `std::promise`,
`std::unique_lock`, etc.
[LoongArch] Initial implementation for `enableMemCmpExpansion` hook
After overriding `TargetTransformInfo::enableMemCmpExpansion`
in this commit, `MergeICmps` and `ExpandMemCmp` passes will be
enabled on LoongArch.
[RISCV] Move remat.ll test from riscv32 to riscv64. NFC
This is to allow us to test rematting i64 lds in #166774. Checked and
we're still rematting the same lis on rv64 in this test.