[CIR] Implement cleanup handling for destructor ILE initializers (#192172)
This adds EH cleanup handling for C++ initializer list expressions
containing destructed types. The necessary support for deferred
deactivation cleanups was already in place, so this just needed to push
the deferred destroy cleanup when the init list element is constructed.
[clang-format] Skip protected data blocks in Verilog (#190695)
A Verilog file can have encrypted stuff (sections 34 and O in the spec).
This patch makes the formatter skip it. Previously the formatter could
mess it up by treating it as ordinary code.
Now the entire block following the `pragma protect` line is treated as a
single token.
The keywords added in this patch only mean special things in the pragma
lines. Thus they are not added to `VerilogExtraKeywords`.
While the files containing the stuff are machine generated, it is a bad
idea for a formatter to break code. For example, one may wish to run the
formatter on an entire project containing both ordinary and encrypted
files. Another use case is formatting the prototypes in files that
contain clear text prototypes in and encrypted implementation.
[CIR] Add nofpclass for fast-math flags (#191455)
When `-menable-no-infs` or `-menable-no-nans` is set, OGCG adds
`nofpclass(nan inf)` to FP arguments and return values. CIR was missing
this.
Adds the check in `constructFunctionReturnAttributes` and
`constructFunctionArgumentAttributes`, gated on
`hasFloatingRepresentation()` (same condition classic codegen uses in
`canApplyNoFPClass`).
The MLIR LLVM dialect already has `llvm.nofpclass` from #188374, so only
the CIRGen side is needed here.
Test covers float, double, `_Complex double`, and a non-FP control case.
Made with [Cursor](https://cursor.com)
[clang][ssaf] Fix plugin crash on AIX by adding `SUPPORT_PLUGINS` to `clang-ssaf-format` (#192292)
This change fixes a crash when running the `with-plugin.test` lit tests
on AIX. The crash is caused by a missing `-Wl, -brtl` linker flag.
Without this flag, the dynamic linker cannot resolve symbols from the
host executable when loading shared libraries via `dlopen`. So when the
plugin's static initializer runs and tries to register into the
`llvm::Registry` (calling `getRegistryLinkListInstance` defined in the
host via `LLVM_INSTANTIATE_REGISTRY`), the symbol resolves to `null`,
crashing the process.
The fix is to use `SUPPORT_PLUGINS` flag in `add_llvm_executable`, like
other tools in llvm. For AIX, this flag adds `-Wl, -brtl` to enable
runtime linking; for Non-AIX platforms, it sets `LLVM_NO_DEAD_STRIP` to
prevent the linker from stripping symbols that plugins reference at load
time.
[Clang] Add default arguments to the parameter mapping (#192071)
We were not adding default argument to the parameter mapping as such,
two constraint which only differed by the mapping of a parameter only
referenced in a default argument were considered identical.
Fixes #188640
[flang][NFC] Converted five tests from old lowering to new lowering (part 45) (#192265)
Tests converted from test/Lower: io-statement-2.f90, io-statement-3.f90,
io-statement-big-unit-checks.f90, io-statement-open-options.f90,
io-write.f90
[lldb] Declare return type of lldbutil.run_to_source_breakpoint (#190028)
Helpful for remembering the types of the four return values (and their
order).
[HLSL] Mark vector and matrix constructor-turned-InitListExprs as ListInitializations (#192151)
Fixes #189086
This PR fixes a bug for HLSL where vector and matrix constructors that
have been turned into initializer lists via
https://github.com/llvm/llvm-project/blob/18519f34650db7fc8e1885ac0293c1e9a5f1b071/clang/lib/Sema/SemaInit.cpp#L6993-L7000
were not marked with ListInitialization = true, which causes template
re-instantiation to fail because the initialization with a InitListExpr
gets classified as a InitializationKind::IK_Direct instead of a
InitializationKind::IK_DirectList when ListInitialization is false.
Assisted-by: Claude Opus 4.6
[lldb][windows] recommend building with Python 3.11 (#191159)
As of https://github.com/llvm/llvm-project/pull/176387 and release 22,
official builds of lldb on Windows use Python 3.11 both on x64 and
arm64.
The Windows lldb build bots use 3.11+ versions of Python:
[lldb-x86_64-win](https://lab.llvm.org/buildbot/#/builders/211) -
`3.12.7`
[lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197) -
`3.12.7`
[lldb-aarch64-windows](https://lab.llvm.org/buildbot/#/builders/141) -
`3.11.9`
This patch changes the cmake config and documentation to recommend
building lldb on Windows with Python 3.11 or more recent.
In the future, given the reduced number of lldb maintainers on Windows
compared to other platforms, bumping the Python version on Windows would
help reduce the surface area of Python related bugs.
[AMDGPU] Fix .Lfunc_end label placement (#191526)
Now it is placed after the kernel descriptor, even the section is
.rodata, which is wrong. This allows proper code size calculation in MC.
Don't pass RecipeBuilder
Legacy calls `setRecipe` on all processed recipes but really queries `getRecipe`
for memory operations only, that we don't touch in the scalarization as that
happens after all memory recipes has been processed.
[VPlan] Scalarize to first-lane-only directly on VPlan
This is needed to enable subsequent https://github.com/llvm/llvm-project/pull/182595.
I don't think we can fully port all scalarization logic from the legacy
path to VPlan-based right now because that would require us to introduce
interleave groups much earlier in VPlan pipeline, and without that we
can't really `assert` this new decision matches the previous CM-based
one. And without those `assert`s it's really hard to ensure we properly
port all the previous logic.
As such, I decided just to implement something much simpler that would
be enough for #182595. However, we perform this transformation before
delegating to the old CM-based decision, so it **is** effective
immediately and taking precedence even for consecutive loads/stores
right away.
Depends on https://github.com/llvm/llvm-project/pull/182592 but is stacked on
top of https://github.com/llvm/llvm-project/pull/182594 to enable linear
stacking for https://github.com/llvm/llvm-project/pull/182595.
[clang][modules] Don't prune the top level module cache for implicitly built modules (#192171)
There are build systems that put explicitly built modules in the same
module cache directory as implicitly built modules. Pruning those in an
implicit build can cause the build to fail due to missing modules.
rdar://174790709
[MachineScheduler] Improve handling of phys regs in GenericScheduler. (NFC). (#187572)
Factor out the handling of coalesced preg COPYs from SystemZMachineScheduler.cpp into MachineScheduler.cpp.
This extends the handling to other types of instructions than COPYs or immediate
loads, such as Load Address and takes care of maintaining the original input
order if both SUs are biased the same way in the same zone.
Another target that uses GenericScheduler can enable this by setting the new
MachineSchedPolicy member BiasPRegsExtra to true (default false). In a derived
scheduling strategy, this could be used either by passing /*BiasPRegsExtra=*/true
to biasPhysReg() (extra instruction detection), or by calling tryBiasPhysRegs()
instead which also preserves the original order if biased the same way.
[llvm-otool] Add -a option to print archive headers (#189411)
Wire up llvm-otool's -a to the existing --archive-headers machinery with
a default of displaying all architectures to match classic otool
behaviour.
[lldb][windows] use a marker to drain the ConPTY's init sequence (#191472)
This patch improves the ConPTY method that drains the init sequence. It
uses a string marker to ensure that the init sequence has been received.
The previous implementation was prone to race condition, because the
method could return before all the init sequence was received.
This only seems to reproduce on windows-server-2019.