[clang] Simplify the overload resolution logic for operator new and new[]
This PR replaces the current spec-equivalent argument list mutation with
direct iteration of the correctly ordered set of argument lists for a
given allocation.
This adds a bit of architectural work around the argument list construction
but the overall effect is substantially simplified search of the overload
candidates.
* We now simply enumerate correctly ordered candidates for the implicit
arguments. This means no more re-entrant modification of the argument
list to handle addition and removal of type-identity or alignment
parameters.
* We no longer mutate the primary LookupResult when attempting the MSVC
array fallback. This also lays the groundwork for correct diagnostics
of such cases. For now we have a minor improvement of correctly
reporting the operator we were trying to resolve originally, and tell
the user that we have attempted the MSVC fallback if applicable.
[16 lines not shown]
[libc] Fix Atan2f128 and add tests for all versions (#215023)
It fixes the THREE_PI_OVER_4 value in atan2f128 and adds a small smoke
test against the failure.
The result or comparison value is directly taken from the failure while
comparing with core math :
```CPP
FAIL x=inf y=-inf ref=0x1.2d97c7f3321d234f272993d1414ap+1 z=0x1.2d97c7f3321d234f272993d1414ap-1
```
Additionally it adds some more smoke tests for all atan2 versions.
[LifetimeSafety] Use ImmutableList for buildOriginFlowChain DFS nodes (#208890)
This commit mainly address the suggestion in
https://github.com/llvm/llvm-project/pull/204592#discussion_r3523582077
to use `ImmutableList` for the DFS nodes in `buildOriginFlowChain`, and
also updates the `llvm_unreachable` messages.
---------
Signed-off-by: Yuan Suo <suoyuan666 at s5n.xyz>
Co-authored-by: Utkarsh Saxena <usx at google.com>
[CodeGen] Remove dead declarations (#215013)
The corresponding function definitions were removed on Jan 12, 2022 in
commit 6a605b97a2006bd391f129a606483656b7c6fb28.
[CIR] Accept _Complex and all float formats in x86_64 callconv lowering
The CallConvLowering bridge accepted only float and double, so a function taking
a _Complex, or a float in any other format, failed the pass instead of being
classified. An all-float aggregate failed for a different reason: its SSE
eightbyte coerces to a vector, and the bridge had no way to represent one, so it
reported the coercion NYI rather than emitting a wrong signature.
Mapping every CIR floating-point type through FPTypeInterface covers all of them
at once. A _Complex maps to the library's complex type and a vector coercion
now converts back to a CIR vector.
Accepting a long double also makes a union holding one classifiable. That
exposes the ABI-compatibility flags, which the pass left at the library
defaults. They now come from the triple and the compatibility version, which is
what lets a long double union reach registers on Darwin instead of memory.
updateArgAttrs appended argument attributes instead of setting them, so a name
already present landed in the dictionary twice. CIRGen marks a _Complex long
[8 lines not shown]
[docs] Prefer colon fences to delineate blocks containing markup (#214921)
Myst has an extension,
[colon_fence](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-colon-fence),
that we enable in our docs. There are many Markdown-aware tools out
there that know to interpret triple backtick as a code block fence, so
they highlight them as pre-formatted text. Colon fences are an
unrecognized Myst extension, and if the Sphinx directive contains a
block of markdown formatted text, that's the desired behavior.
Therefore, at some point during the migration, I started using them.
However, I didn't document this guideline, and I didn't apply it
consistently to the early docs. This PR does that: documents the
guideline, and applies it to our docs.
After this change:
```
❯ rg '```\{(option|note|todo|admonition|warning)\}' | cut -d / -f 1 | sort | uniq -c
72 clang-tools-extra
```
[6 lines not shown]
[llvm][LoopVectorize] Avoid nondeterministic iteration (#214886)
The Transforms/LoopVectorize/AArch64/cmp_cost.ll test fails under
LLVM_RERERSE_ITERATION, because iterating over a SmallPtrSet is
nondeterministic. Addresses part of #214872.
[VPlan] Use i64 for constant lane indices in insertelement (NFC) (#214664)
Update code to generate insertelement instruction to use i64 as index
type, matching the canonical form instcombine produces.
This is in line with previous changes making sure LVs output is as
canonical as possible.
PR: https://github.com/llvm/llvm-project/pull/214664
[SLP]Fix unscheduled-deps assert for copyable operands in reassociated nodes
For a non-commutative user in a reassociated (flattened) node, the
copyable operand may be modeled on a flattened operand column rather
than at the instruction's operand number, so the direct lookup misses
it and the def-use dependency is counted but never released. Scan the
flattened operand columns at the user's lane for the copyable data.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/215016
[Offload][OMPT][NFCI] Call ompt_libomp_connect instead of dlopen libomp (#214556)
connectLibrary() reached libomp's ompt_libomp_connect through
OmptLibraryConnectorTy, which dlopens "libomp.so" and resolves the
symbol at run time. That cannot do anything the linker has not already
done: libomptarget links libomp and imports seven __kmpc_* symbols from
it, so libomp.so is a DT_NEEDED entry, and libomp defines and exports
ompt_libomp_connect unconditionally -- as a stub in kmp_utility.cpp when
built without OMPT support. Declare it, call it, and delete Connector.h.
AI-assisted.