[NSan] Fix null-pointer crash on unsupported vector element sizes (#202270)
In propagateNonFTStore, BitcastTy is left null when a ConstantDataVector
has an element width other than 32/64/80 bits (e.g., f16, bf16, fp128).
Passing a null element type into VectorType::get crashes. Guard the
VectorType::get call so the unsupported case falls through to the "reset
shadow to unknown" path.
---------
Co-authored-by: Alexander Shaposhnikov <ashaposhnikov at google.com>
[Instrumentor] Add runtime examples: [3/N] Pointer tracking
The example shows how globals and stack allocations can be tracked. For
each we record if it was read/written and how long the time was between
creation and first use, and last use and deallocation. This is reported
at the end.
[flang][cuda] Prefer valid intrinsics over host-only generics in device code (#205376)
In CUDA device code, a host-only generic can shadow an intrinsic with
the same name and cause a valid call such as maxloc(a, 1) to be rejected
as non-device-callable. Retry intrinsic resolution for host-only generic
function calls in device context, preserving normal diagnostics when no
valid intrinsic matches.
linuxkpi ioctl handler: restore the user data pointer
instead of trying to hack around it with LINUX_IOCTL_MIN_PTR. Since
linux file ioctl methods expect the user address in the data argument,
this should work for all ioctls, including the variable-length cases
like ibcore.
Only do it for the FreeBSD ABI, where we know how to reliably access the
original syscall arguments.
Reviewed by: Ariel Ehrenberg <aehrenberg at nvidia.com>, markj
Discussed with: zishun.yi.dev at gmail.com
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57612
ifconfig: Fix handling of unsupported -j option with MK_JAIL=no
The ifconfig(8) utility built with MK_JAIL=no does not support the
-j option. When the option is specified, Perror() is called without
setting errno, which can result in errno being reported as zero and
a misleading error message being displayed.
Also remove "[-j jail]" from the usage message when built with
MK_JAIL=no.
Event: Halifax Hackathon 202606
[mlir][tosa] Add support for matmul_t (#203894)
Adds support for matmul_t added to the specification in
https://github.com/arm/tosa-specification/pull/50.
This includes:
- Operator definition
- Verification logic for the operator
- Output shape inference for the operator
- Validation checks to ensure compliance with the TOSA specification
including profile compliance and level checks.
- Support for matmul_t to matmul in the downgrade pass.
Note that MXFP support will be added in a follow-up commit.
usb: Add missing mtx lock and unlock in pushing dma queue
Accessing usb_xfer_queue requires bus lock, we added this missing lock
in here to prevent racing issue.
Reviewed by: adrian
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57293
(cherry picked from commit df5e9e3da5b9b3fe63ed4aaaa19b824fd18ae0f2)
xhci: Do not drop and add bits in xhci
Drop and Add bits reset the data toggle for high-speed devices in XHCI.
The toggle bit represents the sequence number in USB 2.0 transfers. However,
a device can only recognize that the toggle bit has been reset while in
the HALT state. As a result, the host and device toggle values may
become mismatched, causing xHCI to reject the packet. This issue was
observed while testing the EZ-USB FX2 device.
The transfer may then return to the original value after a
bi-directional TD because the toggle field is only one bit wide. This
explains the reson that we can only receive packets bi-transfer in some
case. Therefore, we do not reset the toggle bit here.
Reviewed by: adrian
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57146
(cherry picked from commit 28d85db46b484589e2ee74cf4b270db066821de1)
libc: Use slow path in fenv in C++
C++ exposes cfenv functions via using ::func. Our name-mangling
mechanism rewrites all function calls causing symbols such as
std::feclearexcept to be transformed into std::__feclearexcept_int.
Since no such function exists, compilation fails.
The using ::feclearexpect declarations themselves are unaffected because
they are not function calls, which further exposes the mismatch
As a result, enable the fast path only for C and fall back to the slow
path in C++.
Reviewed by: kib
Fixes: 5bc64b7d417d
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57450
(cherry picked from commit 9c0489508695fde3bdd742edfd1b4b681aab4d19)
hwpstate_intel: Disable package control on hybrid CPU
In package control mode, the performance of all cores depends on the
most recent value written to the request field. If the last write comes
from an E-core, all cores are forced to align with the E-core
performance level, resulting in significant performance degradation.
Therefore, package control is disabled on hybrid-core systems.
Reviewed by: olce
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Framework Computer Inc
Differential Revision: https://reviews.freebsd.org/D57377
(cherry picked from commit 7b26353a59d66dc1bc611fd042a49b9e3bd13699)
xhci: Do not drop and add bits in xhci
Drop and Add bits reset the data toggle for high-speed devices in XHCI.
The toggle bit represents the sequence number in USB 2.0 transfers. However,
a device can only recognize that the toggle bit has been reset while in
the HALT state. As a result, the host and device toggle values may
become mismatched, causing xHCI to reject the packet. This issue was
observed while testing the EZ-USB FX2 device.
The transfer may then return to the original value after a
bi-directional TD because the toggle field is only one bit wide. This
explains the reson that we can only receive packets bi-transfer in some
case. Therefore, we do not reset the toggle bit here.
Reviewed by: adrian
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57146
(cherry picked from commit 28d85db46b484589e2ee74cf4b270db066821de1)
usb: Add missing mtx lock and unlock in pushing dma queue
Accessing usb_xfer_queue requires bus lock, we added this missing lock
in here to prevent racing issue.
Reviewed by: adrian
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57293
(cherry picked from commit df5e9e3da5b9b3fe63ed4aaaa19b824fd18ae0f2)
fusefs: proofread an error message in the tests
Reported by: otis
Fixes: 2c1482e3053 ("fusefs: fix a race in the pre-init tests")
MFC after: 2 weeks
Sponsored by: ConnectWise
[clang-index][USR] GenLoc prints file entry at most once, allow repeated offsets
GenLoc previously printed the source location at most once per USR,
gated by a member flag toggled on the first call. During the
recursive visit, if both an outer and an inner decl needed to print
the location, only the outer one was printed. When the outer decl did
not need the offset, no offset was ever printed. For example, the USR
of `Holder<decltype([]{})>::method` depends on the location of the
type of the lambda but the outer decl prints the file entry only,
which disables offset printing.
Change the logic so the file-entry part of the location is printed at
most once (it must be identical), while offsets of sub-decl locations
may be printed multiple times.
[docs] Enforce unambiguous toctree in llvm/docs
It seems like using a non-`hidden` `toctree` for page navigation is a
bit of a trap, in that every doc must have a single unique path through
the global toctree to the root doc, and it is very easy to end up with
multiple.
This patch tries to address the warnings (actually infos, hence why it
does not fail the build) in llvm/docs/, namely:
$ sphinx-build -b html -jauto llvm/docs/ /tmp/sphinx-out
checking consistency...
llvm/docs/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack.md: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack
llvm/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionsForHeterogeneousDebugging
llvm/docs/CommandGuide/llvm-reduce.rst: document is referenced in multiple toctrees: ['CommandGuide/index', 'CommandGuide/index', 'Reference'], selecting: Reference <- CommandGuide/llvm-reduce
llvm/docs/GitHub.rst: document is referenced in multiple toctrees: ['GettingInvolved', 'UserGuides'], selecting: UserGuides <- GitHub
llvm/docs/GlobalISel/IRTranslator.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/IRTranslator
llvm/docs/GlobalISel/InstructionSelect.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/InstructionSelect
llvm/docs/GlobalISel/Legalizer.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/Legalizer
[35 lines not shown]
[docs] Create utils/docs
llvm-project is home to many sphinx documentation sites, each with
configuration quirks and bespoke extensions.
The sphinx config model makes sharing code somewhat difficult. There
are options like sphinx-multiproject, but some of our docs builds are
out of the source tree while some are done out of the binary tree, so
the multiproject configuration itself would need to be generated. It
also would impose more uniformity around extensions than required.
This change instead creates a python package at utils/docs/llvm_sphinx
and makes it available to all sphinx-build processes via PYTHONPATH.
Each conf.py does not modify its own sys.path because not all builds are
out of the source tree, so there isn't a stable relative path to use to
refer to the utils/docs/ directory.
Type checking via pyright in new package is pinned to being python 3.8
compatible.
[29 lines not shown]
Bump minimum required sphinx Python to 3.8
There seems to be de-facto use of at least 3.6 in docs, namely:
* Use of pathlib (3.4) in various places
* Format f-strings (3.6) and used in clang/docs/ghlinks.py
I don't see a strong reason to maintain the divide in minimum version
between test/docs, especially considering the "FIXME" indicating
the 3.0 lower bound was just a guess to begin with.
Change-Id: I11e00295ae0a13ec0f1c5cefbb2fdd2db272b152
[docs] Add BOLTAArch64OptimizationStatus to toctree
Building docs-bolt-html fails with:
Warning, treated as error:
/home/slinder1/llvm-project/scratch/bolt/docs/BOLTAArch64OptimizationStatus.rst:document isn't included in any toctree
Just add the orphan document to the toctree in the index to silence
this. If there is a better parent it can be moved somewhere else in the
tree.
Change-Id: I1d26d96d5485d97d29231da89f8c8408b375c41f