[WebAssembly] Disallow Wasm EH + Emscripten SjLj in backend (#232559)
This combination has long been disallowed in Emscripten
(https://github.com/emscripten-core/emscripten/pull/18692) and in Clang
(#122466) but the backend code assumed it was possible. This removes
code that handled this in LowerEmscriptenEHSjLj and explicitly errors
out if the combination is given.
Revert "[ProfileSummaryInfo] Honor the hot function attribute in hotness queries" (#233334)
Reverts llvm/llvm-project#232085
Looks like https://github.com/llvm/llvm-project/pull/233298 broke one of
the tests. I'll fix it tomorrow and resubmit then.
[libc] Add Kushal Pal(quic-k) as the maintainer for Hexagon (#232009)
@michaelrj-google @androm3da
Hexagon port for libc merged
https://github.com/llvm/llvm-project/pull/217528
Signed-off-by: Kushal Pal <kushpal at qti.qualcomm.com>
Co-authored-by: Brian Cain <brian.cain at oss.qualcomm.com>
[ProfileSummaryInfo] Honor the hot function attribute in hotness queries (#232085)
LangRef documents the `hot` function attribute as taking precedence over
profile information and acting as a manual alternative to PGO hotness
data when training inputs lack coverage for hot functions. However,
ProfileSummaryInfo only checked `Attribute::Cold` (in
isFunctionEntryCold) and never consulted `Attribute::Hot`. As a result,
functions marked `hot` that had zero entry counts in PGO profiles (for
example, newly introduced functions not executed during profile
collection) were still treated as cold by PSI queries, causing passes
such as TailCallElim and PGOForceFunctionAttrs to apply cold-function
heuristics.
Check `Attribute::Hot` in `isFunctionEntryHot`,
`isFunctionHotInCallGraph`, `isFunctionColdInCallGraph`, and
`isFunctionEntryCold` before checking `hasProfileSummary()` or
`Attribute::Cold`. This matches the precedence in CodeGenPrepare and
ensures the attribute is honored both with and without profile data.
Assisted-by: Gemini
[X86] Expand FCANONICALIZE for v8f16/v16f16 without AVX512F (#232129)
Without AVX512F, `llvm.canonicalize` on `<8 x half>` or `<16 x half>`
made llc abort with "Cannot select: v8f16 = fcanonicalize". That covers
default x86-64, `-mattr=+sse4.1` and haswell. v8f16 is legal from SSE2
and v16f16 from AVX, but the FCANONICALIZE Expand for these two types
was only set in the AVX512F block. Below AVX512F the node stayed Legal
and had no isel pattern.
The first commit is the patch I offered in the issue. It moves the two
Expand actions to where the types become legal: the SSE2 block for v8f16
and the AVX block for v16f16. Without F16C they then use the generic
expansion, which multiplies each element by 1.0 in f32, as v32f16
already does.
The second commit, from review here, adds FCANONICALIZE to the F16C
promote-to-f32 list next to FADD, FSUB, FMUL and FDIV. With F16C and
without AVX512FP16, v8f16 and v16f16 are then canonicalized as f32
vectors (vcvtph2ps, vmulps, vcvtps2ph) instead of element by element.
[15 lines not shown]
[RISCV][GlobalISel] Use Zfhmin for G_FPTRUNC to f16 (#231370)
Zfhmin includes `FCVT.H.S` and (with D) `FCVT.H.D`, so `G_FPTRUNC` from
f32/f64 to f16 only requires Zfhmin.
Use libcalls when the required extensions are unavailable. This also
completes legalization of half-precision `G_FREM`.
[RISCV][P-ext] Restructure scalar tests to increase testing and reduce duplicaton. NFC (#232613)
Rename rv32p.ll to rvp-scalar.ll and add RV64 RUN line. This improves
coverage of some operations like i8/i16 saturating adds/subs that don't
have direct P extension instructions but might use some P instructions
in their lowering like sati. Or it may show cases where we should insert
a scalar into a packed instruction to reduce the code.
Rename rv64p.ll to rvp-scalar-rv64.ll and remove anything thats in
rvp-scalar.ll.
Revert "[SimplifyCFG] Mark branch weights unknown in masked switch to lookup" (#233325)
Reverts llvm/llvm-project#233321
Breaks the profcheck bot and needs more investigation.
[SimplifyCFG] Mark branch weights unknown in masked switch to lookup (#233321)
We cannot infer the branch weights because this transformation splits
the default case into two (values fully out of range, and holes inside
the range), which we cannot infer without additional value profiling.
[mlir][arith] Drop invalid overflow flags when narrowing
Preserve nsw only when narrowing preserves signed operand and result
values, and nuw only when it preserves unsigned values. Flags proven
at the original width may otherwise introduce poison after narrowing.
Add concrete regression cases for addi, subi, muli, and shli, covering
both overflow flags and retention of valid flags.
[mlir][arith] Preserve unsigned values when narrowing operations
Require unsigned representability for divui, ceildivui, remui, and shrui.
A signed range fitting the narrower type does not preserve the unsigned
operand values, even when the result fits.
Add concrete counterexamples and coverage for safe narrowing of
zero-extended and proven nonnegative operands.
[SLP] Handle REVEC when costing expanded compress mask
With REVEC the scalars are vectors. The masked-load-compress shuffle that is
emitted uses the compress mask expanded to the elements of those vectors
(transformScalarShuffleIndiciesToVector), but the cost was computed with the
unexpanded per-vector mask, so a shuffle such as <24 x i8> -> <16 x i8> was
costed as a <2 x i8> shuffle. This made the compress sequence looked cheaper
than it is.
Assisted-By: Claude Sonnet 5.5
[flang][OpenMP] Switch clause verification to descriptor-based
Delete all the scattered pieces of clause verification that are now
replaced by the unified handling.
[flang][OpenMP] Improve diagnostics about modifier properties
Use OpenMPDeprecated and OpenMPFuture warning categories for modifier
diagnostics as well, analogously to how they are used for clauses.
[flang][OpenMP] Account for using different versions for modifier checks (#229525)
When a modifier from a past/future version is accepted, use its
properties
from the nearest version in which it is allowed.
[flang][OpenMP] Create generic interfaces for "container" entities (#229524)
In short, clauses are containers of modifiers, and directives are
containers of clauses. With the abstractions in place, clauses and
modifiers look almost the same from the point of view of syntactic
properties.
Use these functions to implement generic GetAllowedElements and
GetElementVersionRange functions.
[IR] Reject IR functions that have hot and cold attributes (#233298)
These are mutually exclusive and clang already enforces this. We should
just reject this in the verifier so that passes don't have to think
about precedence of these two attributes.
[LAA] Reject calls with operand bundles that may access memory. (#233304)
Calls to vectorizable intrinsics and vector-variant calls skipped the
memory check, so bundles that may access memory (e.g. deopt) were
ignored. In LV this hoisted, removed or mis-widened such calls.
Reject bundles conservatively for now to fix miscompiles. We can make
this more fine-grained if needed in practice.
[SLP]Allow non-power-of-2 VF for partial register buildvectors
The buildvector, not filling the whole registers (e.g. <3 x float>),
was vectorized as the power-of-2 part plus the scalar remainder. The
type is widened to the full registers anyway, so vectorize it as a
whole.
Partially fixes #56332
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/233314