[RISCV] Sink instructions so AVL dominates in RISCVVLOptimizer (#184155)
The last feature that RISCVVectorPeephole::tryToReduceVL has that
RISCVVLOptimizer doesn't is that if the vl to reduce to doesn't dominate
a vector pseudo, it can sink the pseudo below the vl definition if it's
safe to do so.
This PR shares the logic to check for physical register clobbering in
RISCVInstrInfo, but there may be a better place for it.
The DemandedVLs DenseMap needs to be switched to a MapVector to get
deterministic ordering, since the order in which we sink instructions
can affect the resulting codegen.
This helps removes a few vsetvli toggles in llvm-test-suite.
[DA] Add tests that represent edge cases for the Weak Zero SIV tests (NFC) (#183735)
This patch adds test cases that capture edge cases for the Weak‑Zero SIV
tests. These cases involve loop‑invariant, non‑constant variables, and
special care is required when those variables may be zero.
[GVN] Fix crash when svcount is used with globals-aa (#184347)
When -globals-aa is used, `analyzeLoadAvailiability` calls
`analyzeLoadClobberringStore` which in turn calls
`isFirstClassAggregateOrScalableType` which is using
`isa<ScalableVectorType>`. Ideally it should use type's isScalableType()
method.
The crash does not occur when default (BasicAA) is used because
`analyzeLoadAvailiability` function does not take the load clobbering
path as BasicAA returns `Def`.
Fixes #159368
[RISCV] Remove OperandType OPERAND_SIMM10_UNSIGNED. Rename OPERAND_SIMM8_UNSIGNED->OPERAND_SIMM8 (#184540)
The UNSIGNED only refers to what we allow in assembly parsing. The
MachineInstr/MCInst should always be canonicalized to signed.
[clang-tidy] Fix false positive in readability-redundant-preprocessor for builtin checks (#181734)
Different `__has_builtin()` checks were incorrectly flagged as redundant
because ConditionRange collapsed after macro expansion. It now reads
condition text directly from source to fix this.
Assisted-by: Claude
Fixes #64825
[clang][CIR] Pass VFS to command-line parsing (#184226)
This explicitly passes Clang's VFS to MLIR command-line parsing that
runs when ClangIR is enabled. This matches the rest of Clang and fixes a
sandbox violation.
[RISCV][GISel] Replace buildInstr with BuildMI (#183714)
As @arsenm mentioned in some of my PRs, such as:
https://github.com/llvm/llvm-project/pull/171092, we should use
`BuildMI` instead of `MachineInstrBuilder::buildInstr` in Selector.
This PR is tring to replace all `MachineInstrBuilder::buildInstr` with
`BuildMI`.
[Hexagon] Ignore formatting of generated proto files (#184427)
hexagon_protos.h, hexagon_circ_brev_intrinsics.h, and
hvx_hexagon_protos.h are generated C header files that consist of
macro definitions and help fields in comments. These files are large.
Automatic formatting of these files breaks their regular structure
and increases maintenance effort.
[Benchmark] Fix warnings around usage of __COUNTER__ (#184524)
Premerge CI is currently failing with the following after the update to
clang v22:
```
/home/gha/llvm-project/clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:92:1: error: '__COUNTER__' is a C2y extension [-Werror,-Wc2y-extensions]
92 | BENCHMARK(dexQueries);
| ^
```
Some original work was done around this in
df1d786c460e0e47c9074f3533f098190ebfbc1b, which was then done in
upstream Google benchmark in
https://github.com/google/benchmark/commit/d8db2f90b643eb28a12976beb4d57bcfb639911d.
The original work done in the patch implementing this feature doesn't
seem to account for as many cases as the upstream patch does. This patch
reverts the diff in df1d786c460e0e47c9074f3533f098190ebfbc1b and applies
the applicable hunks from the upstream patch.
[bazel] Fix building lldb with zlib disabled (#184525)
In cmake this value is set in llvm-config.h, we're not really handling
that the same way in bazel so we can just allow all targets to inherit
this disabled, otherwise it fails since lldb assumes it is always
something
[lld][WebAssembly] Convert more tests to assembly. NFC (#184418)
The only expectations change here is that `__stack_pointer` is
no longer exports in the `archive-export.test` test. This is because
we don't enable the mutable-globals feature (since the assembly files
don't contains all the now-default features of the generic CPU).
[MLIR][XeGPU] Add blocking and subgroup to lane distribution support for ConvertLayout operation (#183837)
This PR refactors blocking support for ConvertLayout op to allow it
unrollable, not just removing it for specialize case.
It also removes the foldable attribute for ConvertLayout op, as we
expect the OP to be explicitly handled by XeGPU lowering.
It adds subgroup to lane distribution support for ConvertLayout op.
[lldb] Wrap LLDBLog Initialize/Terminate in a class (NFC) (#184469)
This matches what we do for all the other log channels (GDB Remote,
POSIX, Windows, KDP, etc).
[NFC][VPlan] Split `makeMemOpWideningDecisions` into subpasses
The idea is to have handling of strided memory operations (either from
https://github.com/llvm/llvm-project/pull/147297 or for VPlan-based
multiversioning for unit-strided accesses) done after some mandatory
processing has been performed (e.g., some types **must** be scalarized)
but before legacy CM's decision to widen (gather/scatter) or scalarize
has been committed.
And in longer term, we can uplift all other memory widening decision to
be done here directly at VPlan level. I expect this structure would also
be beneficial for that.
[lldb] Expose block equality with SBBlock. (#184222)
Adding the `operator==` and `operator!=` for SBBlock. This should allow
us to compare blocks within a frame, like:
```python
block = frame.GetBlock()
while True:
if block == frame.GetFrameBlock():
# we're at the top function scope.
else:
# we're at an inner block scope.
```