[clang][StaticAnalysis] Fix an false negative bug in handling '__builtin*overflow' (#214553)
For a binary operation 'A op B' and a result type 'T', these builtins
return true/false for whether the operation's result is a value 'T'
cannot hold. CSA models this by computing the operation's result in a
temporary type and comparing it against the bounds of 'T'. However, the
temporary type is only twice as wide as 'T', not the operands. When
either operand is wider than 'T's doubled width, the result of 'A op B'
can silently wrap around before the comparison, producing a false
negative.
The solution is to find the proper type to temporarily hold the result
of 'A op B' from types of 'A' and 'B'.
rdar://184263112
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
[flang][semantic] Implement semantic checks and new data structure for explicit-shape-bounds-spec (#203030)
Since Lower and large parts of Semantics depend on ShapeSpec being a scalar bound, implement a class RankOneBoundElement that does just this. Since there is no syntactic representation for this node kind, have both unparse.cpp and mod-file.cpp emit the original rank-1 integer array expression instead of scalarized versions.
Analyze does semantic checks, then repackages into an array of scalarized ShapeSpec pairs instead of a pair of arrays.
Lower implementation in follow-up stack PR.
Also, fix pre-existing bug where overriding dimension spec in entity-decl throws away and fails to type check the array-spec provided in dimension spec.
[CIR] Implement alwaysinline/noinline on call sites (#214789)
When these appear in an AttributedStmt, we have to annotate the call
with these attributes. This patch implements them for all of the
CallOpInterface types.
libc: tests: add static to resolve -Wmissing-prototypes
The function create_staticobj() is only used inside this translation unit.
Clang produces a -Wmissing-prototypes warning during standard buildworld.
This warning will become a fatal compile error if MK_WERROR is enabled for hardened builds.
PR: 285870
Fixes: ee9ce1078 ("libc: tests: add some tests for __cxa_atexit...")
Signed-off-by: Zhang Qiyue <peter-open-source.probing805 at aleeas.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2321
(cherry picked from commit 64038db825d64fb4827fc8ee264ea0fa1a046d82)
libc: tests: add static to resolve -Wmissing-prototypes
The function create_staticobj() is only used inside this translation unit.
Clang produces a -Wmissing-prototypes warning during standard buildworld.
This warning will become a fatal compile error if MK_WERROR is enabled for hardened builds.
PR: 285870
Fixes: ee9ce1078 ("libc: tests: add some tests for __cxa_atexit...")
Signed-off-by: Zhang Qiyue <peter-open-source.probing805 at aleeas.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2321
(cherry picked from commit 64038db825d64fb4827fc8ee264ea0fa1a046d82)
[LLVMCAS] libCASPluginTest should link libpthread (#214847)
Fix ppc build after #213331. libCASPluginTest should link libpthread
since the mock implementation uses a threadpool.
Revert "[AMDGPU] Reschedule loads in clauses to improve throughput" (#214836)
Reverts llvm/llvm-project#102595
we are seeing downstream breaks hpc2021 519 535 accel2023 453 460
aborts on device.
will work on a reproducer later today, and send to you, its fortran, you
will enjoy it
ARM TableGen Update (#208380)
- This PR replaces existing ARM builtin functions with TableGen.
- The `.td` file returns identical header names & type signatures as the
`.def` generated headers and types
- The change has been tested via the following:
- `check-clang-tablegen`
- `check-clang-sema`
- `check-clang-codegen-arm`
- `check-clang-codegen`
- `clang-check`
- `check-clang`
- None of the above returned errors or warnings
- The translation is mostly done via a translation script written in
Python
- [Link to translation
script](https://github.com/patricklapgar/python_scripts/blob/main/llvm/clang/arm_tablegen_mig.py)
- [Link to translation script test
suite](https://github.com/patricklapgar/python_scripts/blob/main/llvm/clang/test_arm_tablegen_mig.py)
- Disclaimer: Both the translation script and its test suite were made
w/ assistance from AI (IBM Bob)
linuxkpi: add WLAN_EID_HT_OPERATION to ieee80211_eid
It matches our IEEE80211_ELEMID_HTINFO, that is already in use.
Found with: clang -Werror=assign-enum
[lldb] Let callers of GetSharedModule skip symbol locating (NFC) (#214829)
GetSharedModule falls back on the symbol locator plugins when the spec
does not already name a binary it can open, and it does so while holding
the global module list lock. Locating a binary or symbol file can
potentially be quite slow, so we should have the option to opt out of
that, for example, if we already did the search upfront.
[RISCV][NewPM] Add NewPM Codegen Pipeline Skeleton (#213129)
This follows what has been done for other targets. Follow-up commits
will port each pass and add them to this pipeline.
Assisted-by: AI
Improve imsg code, switch to imsgbuf_get and use more imsg_get_data
Switch the IMSG_HOST_DNS call to use imsg_add_strbuf and imsg_get_strbuf.
Also use NI_MAXHOST for the name length.
Also rework IMSG_PW_ENTRY and IMSG_GRP_ENTRY to use imsg_get_len()
and imsg_get_data() to fetch the record. Ensure that the data length
is large enough but not too large to fit into &ir.
ok jmatthew@
[mlir][affine] Add optional alignment attribute to affine load/store ops (#214532)
Give `affine.load`, `affine.store`, `affine.vector_load` and
`affine.vector_store` the same optional `alignment` attribute that
`memref.load`/`memref.store` and `vector.load`/`vector.store` already
carry, via the same `AlignmentAttrOpInterface` and `IntValidAlignment`
constraint, and keep it standing where those ops are rebuilt:
- `--lower-affine` forwards the alignment onto the `memref`/`vector`
access it creates (previously it was dropped, since the lowering
rebuilds the access without carrying attributes over).
- The map-composition canonicalizer (`SimplifyAffineOp`) carries the
alignment over when it rebuilds an access with a composed map.
**Motivation.** Without a way to state alignment on the affine ops, a
frontend that raises an under-aligned llvm access through affine and
back must either give up on raising it, or watch the alignment silently
upgrade to the element type's ABI alignment on the way back down. That
upgrade is a miscompile: clang emits `load i128, align 8` for a 16-byte
[19 lines not shown]
java-netty: Stop tracking vulnerabilities
It is getting more and more time consuming and it seems that this
package was not updated since it was packaged and so probably not worth
to continue keep track of all the CVEs since then.
clang: Emit "long-double-type" module flag generically (#210819)
Move emission of the "long-double-type" module flag out of PowerPC
and into generic code, so it describes the long double format for all
targets.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Reland "[Clang] Rebuild lambda captures in default member initializers while skipping body (#196597)"
This relands commit 50f30bedaa81919915049474f4350ef19c36b7ca, which was
reverted in 150aa53d48aa because it crashed CodeGen for lambda
init-captures in default member initializers.
This commit restores the original change unmodified; the crash is fixed
by the following commit, which re-runs the capture's initialization when
rebuilding the default member initializer.