[libc++] Resolve LWG4366: Heterogeneous comparison of `expected` may be ill-formed (#185342)
Resolves #171362
- Implement proposed resolution
- Refactor `operator==` code to be more in line with the standard as the
current way was making an explicit `bool()` conversion in the `x.meow()
== y.meow()` cases
- Add test cases
- Update issues paper
---------
Co-authored-by: A. Jiang <de34 at live.cn>
[orc-rt] Fix unused function warning in testcase. (#206894)
Fixes -Wunused-function warning on peekAtErrorMessage by only defining
that function when ORC_RT_ENABLE_EXCEPTIONS has been turned on.
[TargetParser][AArch64][NFC] Reference ArchInfo via index (#206699)
This removes all relocations from CpuInfos so that the 3-4 kiB structure
can be stored in .rodata. Additionally, the ArchInfos pointer array is
replaced by an ArchInfos value array and the architecture names are
replaced by constexpr references.
[orc-rt] Silence an unneeded-internal-decl warning in testcase. (#206892)
Add an ODR-use of freeVoidVoidNoexcept to silence clang's
-Wunneeded-internal-declaration warning.
[MC][TableGen] Make MCRegisterClasses relocation-free (#206753)
MCRegisterClasses currently store pointers to the register list and the
bit set. Store these three types together in one data structure and use
relative offsets to avoid these relocations and move the large
MCRegisterClasses array from .data.rel.ro into .data. This reduces the
amount of data that needs to be relocated by 86 KB.
This has two side effects: first, MCRegisterClass is not copyable and
the few uses that did copy were changed. Second, the MCRegisterClasses
array is no longer easily accessible as a global (well, it *technically*
is, but that requires the type of the entire storage struct, which I
don't want to expose). Therefore, these accesses need to go through a
function; which shouldn't be too costly and be inlined in an LTO build.
[orc-rt] CallableTraitsHelper - record operator()'s noexcept-specifier (#206891)
Adds a `bool IsNoexcept` template parameter to CallableTraitsHelper's
impl-class template argument (after the existing IsConst from
4bab60f2c63). It records the noexcept-specification on the callable's
function type.
Specializations are added for noexcept-qualified forms. Existing
specializations propagate `IsNoexcept = false`. CallableArgInfoImpl
exposes the captured bool as `static constexpr bool is_noexcept`.
Existing pass-through adapters (ErrorHandlerTraitsImplAdapter,
ErrorWrapImplAdapter, WFHandlerTraitsImplAdapter) are updated to accept
and discard the additional argument.
[X86] Insert WAIT before fnstenv/fnsave and skip meta-instructions (#204108)
fnstenv/fnsave (FSTENVm/FSAVEm) are non-waiting, so they don't
synchronize a pending FP exception; the WAIT pass shouldn't skip the
WAIT before them.
Also skip meta-instructions when finding the next op so WAIT placement
doesn't depend on -g.
Added a new X87ControlKind enum class to classify x87 control
instructions in the pass, replacing the existing ad-hoc switches.
Found via @jlebar's X86 LLVM bug-hunt / FuzzX effort:
https://github.com/SemiAnalysisAI/FuzzX/blob/master/x86/bugs/047-x87-insertwait-too-eager-skip
cc @jlebar
[flang][OpenMP] Lower target in_reduction for host fallback
Enable host-fallback lowering for target in_reduction in Flang and MLIR OpenMP translation.
Model target in_reduction through the matching map entry, force address-preserving implicit mapping for Flang in_reduction list items, and emit the host-side task-reduction lookup with __kmpc_task_reduction_get_th_data. The runtime entry point takes and returns a generic, default-address-space pointer, so normalize a non-default-address-space captured pointer to the generic address space before the call and cast the returned private pointer back to the map block argument's address space, mirroring the in_reduction handling on omp.taskloop. Unsupported device/offload-entry and richer reduction forms remain diagnosed.
Add Flang lowering, MLIR verifier/translation, and LLVM IR tests for the supported host-fallback path, including a non-default-address-space case, and the remaining unsupported cases.
[TargetParser][AArch64][NFC] Use StringTable (#206698)
Store strings in a StringTable instead of referencing them via pointers.
This permits some data structures to be stored in .rodata instead of
.data.rel.ro, as they no longer require relocations. In particular this
affects the 16 kiB AArch64::Extensions.
[orc-rt] CallableTraitsHelper - record call operator's const-qualifier (#206889)
Adds a leading `bool IsConst` template parameter to
CallableTraitsHelper's impl-class template argument to record the
const-qualifier on the callable's function type.
Existing specializations are updated to report their const qualifiers,
and a new specialization handles `RetT(ArgTs...) const`.
CallableArgInfo is updated to expose the captured bool as `static
constexpr bool is_const`.
Existing impls that do not consume the new parameter are adapted via
pass-through wrappers (ErrorHandlerTraitsImplAdapter,
ErrorWrapImplAdapter, WFHandlerTraitsImplAdapter) that discard the
leading bool.
Revert "[flang][openacc] Skip implicit global declare constructor in managed mode" (#206884)
Reverts llvm/llvm-project#206610 as this might not be the right approach
[flang][OpenMP] Lower target in_reduction for host fallback
Enable host-fallback lowering for target in_reduction in Flang and MLIR OpenMP translation.
Model target in_reduction through the matching map entry, force address-preserving implicit mapping for Flang in_reduction list items, and emit the host-side task-reduction lookup with __kmpc_task_reduction_get_th_data. The runtime entry point takes and returns a generic, default-address-space pointer, so normalize a non-default-address-space captured pointer to the generic address space before the call and cast the returned private pointer back to the map block argument's address space, mirroring the in_reduction handling on omp.taskloop. Unsupported device/offload-entry and richer reduction forms remain diagnosed.
Add Flang lowering, MLIR verifier/translation, and LLVM IR tests for the supported host-fallback path, including a non-default-address-space case, and the remaining unsupported cases.
[llvm-debuginfo-analyzer] Add support for LLVM IR format. (#202120)
llvm-debuginfo-analyzer is a command line tool that processes debug
info contained in a binary file and produces a debug information
format agnostic “Logical View”, which is a high-level semantic
representation of the debug info, independent of the low-level format.
Add support for the LLVM IR format and be able to generate logical
views. Both textual representation (.ll) and bitcode (.bc) formats
are supported.
This relands https://github.com/llvm/llvm-project/pull/135440,
which was:
reverted in: https://github.com/llvm/llvm-project/pull/199890
relanded in: https://github.com/llvm/llvm-project/pull/200603
reverted in: https://github.com/llvm/llvm-project/pull/201019
It includes the fixes for the buildbots problems.
[orc-rt] Simplify CallableTraitsHelper specialization inheritance NFC. (#206869)
Make CallableTraitsHelper specializations inherit directly from ImplT.
This is a no-op, but will simplify upcoming patches that will capture
more information about the callable type.
[RISCV] Disable combineVectorSizedSetCCEquality when fixed length vectors are disabled. (#206829)
With VLEN=32 we don't support fixed vectors even if vector instructions are
enabled.
Fixes #206788
[AMDGPU] Apply target flag specifier when lowering MO_ExternalSymbol operands (#202389)
The MO_ExternalSymbol case in AMDGPUMCInstLower dropped the operand
target flags emitting the wrong relocation type
[Clang][Modules] Skip anonymous declaration numbering for local tags in dependent contexts (#202248)
Local tag declarations (classes, structs, enums, and lambdas) defined
within function template bodies or class templates do not require ODR
merging at the local declaration level across different modules. ODR
consistency is already guaranteed because the instantiator only walks
the canonical template definition body, which instantiates its own copy
of the local class.
Merging them across different modules causes their member definitions
(like methods or call operators) to be canonicalized to one module,
while the instantiator walks the template body from another module.
Since local variables within template bodies are not merged, this
mismatch leads to assertion crashes during template instantiation in
`LocalInstantiationScope::findInstantiationOf`.
Fixes https://github.com/llvm/llvm-project/issues/206203.
Co-authored-by: ipopov <ipopov at google.com>
[X86] Verify inline-asm register operands against the subtarget
Inline asm can name physical registers that require a subtarget feature
the selected subtarget lacks: zmm and mask (k) registers need AVX-512,
ymm registers need AVX. The subtarget is derived from the function's
target-cpu/target-features, so no MachineFunction is required.
Fix Windows Path Separator issues in create_symlink and readlink (#206665)
- Force create_symlink target path to use backslashes on Windows, as
NTFS reparse points require backslashes.
- Normalize readlink output to native path separators to match preferred
style.
This fixes the following test failure:
```
PS C:\src\chromium\src\third_party\llvm> .\build_repro\unittests\Support\SupportTests.exe --gtest_filter=FileSystemTest.CreateRelativeDirectorySymlink
[ RUN ] FileSystemTest.CreateRelativeDirectorySymlink
Test Directory: C:/src/temp/file-system-test-a3fd42
C:\src\chromium\src\third_party\llvm\llvm\unittests\Support\Path.cpp(896): error: Value of: fs::is_directory(Link) Actual: false
Expected: true
```
[AsmMatcher] Report a near-miss when all candidates mismatch multiple operands (#206390)
In the ReportMultipleNearMisses path, an opcode that mismatches more
than one operand is dropped, and its first near-miss is dropped with it. If
every opcode is dropped this way, the parser only reports a generic
"invalid instruction".
Now keep the first near-miss of each such opcode, and use it only when
no other opcode gives a near-miss.
Assisted-by: claude-opus
[TargetParser][NFC] Make FeatureBitset iterable (#206394)
FeatureBitset had no way to iterate its bits, so callers scanned all
MAX_SUBTARGET_FEATURES positions by hand.
This adds begin()/end() that yield the index of each set bit, skipping
unset bits with countr_zero.
Callers can now write `for (unsigned Feature: Features)`.
Assisted-by: claude-opus