[analyzer][NFC] Reorg and add clang::suppress tests (#186447)
This reorganizes the current clang suppression tests; and adds quite a
few more cases to the corpus.
This prepares the ground for #183727
While the test cases were generated by AI, I've personally checked every
single line and expectation.
Assisted-by: claude
[clang][bytecode][NFC] Add Function::dump() taking no arguments (#186819)
Instead of relying on the default value. That one doesn't work properly
in lldb and I have to pass the `{}` explicitly every time.
[lldb] When LLDB_ENABLE_MTE is ON always run the driver with MTE (#186322)
When LLDB_ENABLE_MTE is set to ON, we should always run the driver with
MTE by signing with the checked-allocations entitlement.
[ForceFunctionAttrs] Fix handling of conflicts for more attributes (#186304)
Fixes #185277
ForceFunctionAttrs currently only checks the `alwaysinline`/`noinline`
conflict when forcing function attributes. This is incomplete, because
LLVM verifier rules define additional incompatible function attribute
combinations.
Extend hasConflictingFnAttr() to reject more conflicting function
attributes, including combinations involving `optnone`, `minsize`,
`optsize`, and `optdebug`.
Also add required companion attributes when forcing function attributes:
`optnone` requires `noinline`, so forceattrs now adds `noinline`
automatically when needed.
[flang] Reorder messages wrt line number before diff(actual, expect) (#186812)
When messages are attached together, the source locations to which they
refer are not necessarily monotonically increasing. For example
```
error: foo.f90:10: There is a problem here # line 10
because: foo.f90:12: This thing is invalid # line 12 (attached)
error: foo.f90:11: There is another problem here # line 11
```
There is no way to represent that in the source file via ERROR
annotations, so before running unified_diff "canonicalize" the list of
messages into an order that corresponds to the line numbers.
---------
Co-authored-by: Michael Kruse <llvm-project at meinersbur.de>
[AMDGPU][GlobalIsel] Add register bank legalization rules for amdgcn_wqm amdgcn_softwqm amdgcn_strict_wqm (#186214)
This patch adds register bank legalization rules for amdgcn_wqm
amdgcn_softwqm amdgcn_strict_wqm in the AMDGPU GlobalISel pipeline.
[AMDGPU] Fix setreg handling in the VGPR MSB lowering
There are multiple issues with it:
1. It can skip inserting S_SET_VGPR_MSB if we set the mode via
piggybacking. We are now relying on the HW bug for correct
behavior. If/when the bug is fixed lowering will be incorrect.
2. We should just unconditionally update MSBs if immediate allows it.
We shall set correct bits and keep the rest of the immediate
(that is done). There is no reasonable way for an user to change
MSBs nor does it do anything good to set it with SETREG and then
immediately overwrite with S_SET_VGPR_MSB.
3. We can always update immediate if Offset is zero.
4. Redundant mode changes created as seen in the
hazard-setreg-vgpr-msb-gfx1250.mir.
5. Decoding of the immediate was also wrong with non-zero offset
and did not factor MSB fixup offset handling.
With unconditional immediate update most of time and not relying on
[12 lines not shown]
[lldb] Include stdio.h in synthetic subscript test (#186847)
The [lldb-aarch64-windows](https://lab.llvm.org/buildbot/#/builders/141)
buildbot failed with:
```
lld-link: error: undefined symbol: printf
>>> referenced by main.o:(main)
```
I'm assuming that's because of the use of `__builtin_printf`. In other
tests, we use `printf` form `stdio.h` and these build fine, so I added
an include and used `printf`.
Reapply "[clang][ssaf] Add --ssaf-extract-summaries= and --ssaf-tu-summary-file= options" (#186463)
This reverts commit 3548ec95178c00a2895a65b435945ce318396c8e and adapts
the code to the new ScalableStaticAnalysisFramework/ directory layout.
Re-adds:
- `TUSummaryExtractorFrontendAction` and its integration into `ExecuteCompilerInvocation`
- `--ssaf-extract-summaries=` and `--ssaf-tu-summary-file=` CLI options
- SSAFForceLinker / SSAFBuiltinForceLinker headers and anchor symbols
- Diagnostics under -Wscalable-static-analysis-framework
- Lit tests for the CLI and unit tests for the frontend action
- Changes the Formats to be lowercase - and match their spellings in the file paths.
[X86] Add test showing failure to fold compress(splat(x),splat(x),mask) -> splat(x) (#186823)
Noticed while working on i512 shift expansion - if we end up with repeated splat args, we fail to remove the compress node
[flang][parser] Add a feature flag for multiple program units on one line. (#186533)
This PR adds a feature flag `MultipleProgramUnitsOnSameLine` that by
default allows program units to be terminated by semicolons, and then
allow the next program unit to follow on the same line.
It also adds some test programs to demonstrate using programming units
and showing the portability warning with "-pedantic".
[CIR][AArch64] Lower BF16 vduph lane builtins (#185852)
Part of #185382.
Lower `__builtin_neon_vduph_lane_bf16` and
`__builtin_neon_vduph_laneq_bf16` in ClangIR to `cir.vec.extract`,
and add dedicated AArch64 Neon BF16 tests.
This is my first LLVM PR, so I'd really appreciate any suggestions on
the implementation, test structure, or general LLVM contribution style.