528293 Commits

Author SHA1 Message Date
Balazs Benics
6b5bde697b
[analyzer] Refine TimeTrace name for dispatchWorkItem (#128352)
Fixes
https://github.com/llvm/llvm-project/pull/125508#discussion_r1965038954
2025-02-24 08:36:05 +01:00
Andrey Timonin
11fdeadbdf
[mlir][emitc][NFC] Add an example to the description of the emitc.literal operation (#128005)
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
2025-02-24 08:35:52 +01:00
Kristof Beyls
850b492976
[BOLT][binary-analysis] Add initial pac-ret gadget scanner (#122304)
This adds an initial pac-ret gadget scanner to the
llvm-bolt-binary-analysis-tool.

The scanner is taken from the prototype that was published last year at
https://github.com/llvm/llvm-project/compare/main...kbeyls:llvm-project:bolt-gadget-scanner-prototype,
and has been discussed in RFC

https://discourse.llvm.org/t/rfc-bolt-based-binary-analysis-tool-to-verify-correctness-of-security-hardening/78148
and in the EuroLLVM 2024 keynote "Does LLVM implement security
hardenings correctly? A BOLT-based static analyzer to the rescue?"
[Video](https://youtu.be/Sn_Fxa0tdpY)
[Slides](https://llvm.org/devmtg/2024-04/slides/Keynote/Beyls_EuroLLVM2024_security_hardening_keynote.pdf)

In the spirit of incremental development, this PR aims to add a minimal
implementation that is "fully working" on its own, but has major
limitations, as described in the bolt/docs/BinaryAnalysis.md
documentation in this proposed commit. These and other limitations will
be fixed in follow-on PRs, mostly based on code already existing in the
prototype branch. I hope incrementally upstreaming will make it easier
to review the code.

Note that I believe that this could also form the basis of a scanner to
analyze correct implementation of PAuthABI.
2025-02-24 07:26:28 +00:00
Durgadoss R
86cb0bd3a2
[MLIR][NVVM] [NFC] Update test cmd-lines and doc links (#128207)
For the NVVM Dialect tests under Target/LLVMIR/nvvm/ dir,
we verify the lowering to the intrinsics using mlir-translate.
Remove the -verify-diagnostics option from the cmd-line
for these tests since all the verifier checks are tested through
the nvvmir-invalid.mlir file. Similarly, remove the split-input-file
option which is not relevant here.

Update a few remaining links in the NVVMOps.td file.
All the reference links follow the same style now.

Rename the tcgen05-barriers.mlir file to tcgen05-commit.mlir
and move the wait/fence tests to a separate file.

Signed-off-by: Durgadoss R <durgadossr@nvidia.com>
2025-02-24 12:55:11 +05:30
Christian Sigg
9d19105601 [lldb][bazel] Port d0e37d9723 2025-02-24 08:10:33 +01:00
Vitaly Buka
a3093e56fc [NFC][llvm-mt] Move XmlDeleter declaration 2025-02-23 22:38:32 -08:00
Chris Apple
58035b5ef5
Revert "[compiler-rt][rtsan] stat api interception." (#128465)
Reverts llvm/llvm-project#128430

Reverting this as I could repro the failure here:

> Hi @devnexen I believe this change is causing failures on a bot. Any
idea what might be causing the problems?
> https://lab.llvm.org/staging/#/builders/202/builds/1324

https://github.com/llvm/llvm-project/pull/128430#issuecomment-2677298624
2025-02-24 14:21:52 +09:00
Craig Topper
6053ca004a
[MC][CodeGen] Move FirstStackSlot and VirtualRegFlag from MCRegister to Register. NFC (#128444)
These concepts don't exist for MCRegister.

I think there is a need for virtual registers in MCRegister for NVPTX,
SPIR-V and WebAssembly, but those should not be confused with Register's
virtual register. I will try to make a separate proposal for that with a
real interface.
2025-02-23 19:56:49 -08:00
Vitaly Buka
8b1d38480b
[sanitizer] Support "bB" printf GLIBC extension (#128449)
https://www.gnu.org/software/libc/manual/html_node/Table-of-Output-Conversions.html

Without the patch llc triggers non-fatal Asan warning.
2025-02-23 18:46:52 -08:00
Uday Bondhugula
3aef599d07
[MLIR][Affine] NFC. Drop redundant fusion- suffix from fusion pass options (#128405)
NFC. Drop redundant fusion- suffix from fusion pass options. The pass
already has 'fusion' in its name. Shorten the option names avoiding
repetition.
2025-02-24 08:01:37 +05:30
Vitaly Buka
8c917f3ccd
[NFC][sanitizer] Add test for length sub-specifier "z" (#128448) 2025-02-23 18:30:40 -08:00
Jonas Devlieghere
d0e37d9723
[lldb-dap] Refactor request handlers (NFC) (#128262)
Currently, all request handlers are implemented as free functions in
lldb-dap.cpp. That file has grown to over 5000 lines and is starting to
become hard to maintain. This PR moves the request handlers into their
own class (and file), together with their documentation.

This PR migrates about a third of the request handlers and the rest will
be migrated in subsequent commits. I'm merging this in an incomplete
state because almost any lldb-dap change is going to result in merge
conflicts and migrating request handlers one by one is easier to review.
2025-02-23 20:13:55 -06:00
David CARLIER
4d928d5b58
[compiler-rt][rtsan] stat api interception. (#128430) 2025-02-23 23:37:18 +00:00
Ivan Butygin
1794dfbb0f
[mlir] Fix integration test when %host_cc path contains spaces (#128439) 2025-02-24 02:20:26 +03:00
Craig Topper
03610af3d5 [RISCV] Remove Inst bits from Pseudo tablegen class. NFC
Pseudods shouldn't have encoding information so these bits should
never be used.
2025-02-23 15:08:55 -08:00
Vincent Lee
40b0619a53
[FatLTO] Detect LLD linker more reliably (#128285)
It's possible to have an `ld-path` point to a linker that doesn't have
the `ld.lld` filename (e.g. linker wrapper that may emit telemetry
before invoking the linker). This was causing mis-compilations with
fatLTO since the check couldn't reliably detect that it was using lld.
Instead, rely on the value from `-fuse-ld` to determine whether lld is
enabled.
2025-02-23 12:03:37 -08:00
Dmitry Nechitaev
14f33c6bc1
[llvm-objcopy][mach-o] Fix section finding logic for object files (#127604)
Fix section finding logic for object files.
As by product, make --update-section functional when the input is an object file.

This PR fixes #127495
2025-02-23 11:17:58 -08:00
Fangrui Song
78bac7f0a6 [MC] Remove unneeded getMemtagAttr() 2025-02-23 10:56:59 -08:00
Fangrui Song
0b84d72c52
[Driver] Replace /usr/lib/../$OSLibDir with /usr/$OSLibDir (#128428)
The latter is simpler and generalizes the OpenEmbedded special case
introduced in https://reviews.llvm.org/D48862
(they have /usr/lib64 but not /usr/lib)
2025-02-23 10:53:49 -08:00
wldfngrs
3e284554a8
[libc][math][c23] Add acosf16() function (#127731)
- Implementation of acosf16 (inverse cosine) function for 16-bit inputs.
- Exhaustive tests across the 16-bit input range.
2025-02-23 19:46:46 +01:00
lntue
8ea6b735a6
[libc] Fix alignment issue for HermeticTestUtils.cpp. (#128426)
Full build precommit bots were failing due to mis-alignment of atomics
in hermetic tests. This PR enforces the alignment for the bump allocator
of hermetic test framework.

Fixes https://github.com/llvm/llvm-project/issues/128185.
2025-02-23 13:41:51 -05:00
Florian Hahn
65e44b4301 [LV] Add tests with deref assumptions and non-constant sizes. 2025-02-23 18:21:22 +00:00
Fangrui Song
34387fc63b
[AsmPrinter] Simplify $local after D131429. NFC
setType is unneeded (and AsmPrinter tries not to modify symbols).
AsmPrinter. MCSA_ELF_TypeFunction is available on all
targets using getSymbolPreferLocal.

Pull Request: https://github.com/llvm/llvm-project/pull/128138
2025-02-23 10:19:27 -08:00
Nikolas Klauser
15860446a8
[libc++] Fix basic_string not allowing max_size() elements to be stored (#125423)
Without this patch `basic_string` cannot be properly resized to be
`max_size()` elements in size, even if an allocation is successful.
`__grow_by` allocates one less element than required, resulting in an
out-of-bounds access. At the same time, `max_size()` has an off-by-one
error, since there has to be space to store the null terminator, which
is currently ignored.
2025-02-23 19:02:14 +01:00
Kazu Hirata
303825d2ab
[Analysis] Avoid repeated hash lookups (NFC) (#128394) 2025-02-23 08:47:02 -08:00
Veera
9d1fbbd2b9
[SROA][NFC] Remove Unused Parameter in promoteAllocas() (#128382)
Removing it because `Function &F` is not used by `promoteAllocas()`.
2025-02-23 11:17:43 -05:00
Robert Imschweiler
cafad2b75a
[AMDGPU] Add verification for amdgcn.init.exec.from.input (#128172)
Check that the input register is an inreg argument to the parent
function. (See the comment in `IntrinsicsAMDGPU.td`.)

This LLVM defect was identified via the AMD Fuzzing project.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-02-23 10:42:31 -05:00
Florian Hahn
72791fef6d [VPlan] Remove unused buildPlainCFG from unit tests (NFC).
Also clarify the name of buildHCFG -> buildVPlan.
2025-02-23 13:38:42 +00:00
Jonas Hahnfeld
9e82ee5274
[Support] Remove AlignedCharArrayUnion from Expected and ErrorOr, NFCI. (#127407)
They were instantiated with only a single type and union-members
themselves. By putting the types directly into a union, they are still
left uninitialized by default.
2025-02-23 12:34:44 +01:00
Benjamin Kramer
06cc9681b0 [bazel] Add missing dependency for 2ff3b18554b115b17d5085b9a4cd779eeafd278a 2025-02-23 12:31:31 +01:00
Florian Hahn
b72bbfc293 [VPlan] Remove fixHeaderPhis (NFC).
Removes unneeded code after https://github.com/llvm/llvm-project/pull/124432.
2025-02-23 10:51:20 +00:00
Timm Baeder
8102fec00b
[clang][bytecode] Reject calls to pure virtual functions (#128412) 2025-02-23 11:44:37 +01:00
Baranov Victor
0f8769086e
[clang-tidy][NFC][docs] Use single tick for 'false' and 'true' values in options (#128362)
Unify doc style for options that use `true` or `false` as default
values.
2025-02-23 18:43:41 +08:00
Timm Baeder
c38befd94f
[clang][bytecode] Fix delete[] dtor order (#128411)
As always, call array dtors in reverse order.
2025-02-23 11:32:35 +01:00
Yingwei Zheng
2071ea24a2
[LVI] Skip self loops in solveBlockValueNonLocal (#127763)
We cannot infer more information from backedges in
`solveBlockValueNonLocal`. However, since DT is unavailable in LVI,
there is not a precise way to check whether a BB edge is a backedge.
This patch only skips self loops to unblock the range analysis.

The motivating case is extracted from
https://github.com/llvm/llvm-project/pull/127663.

Compile-time impact is high:
https://llvm-compile-time-tracker.com/compare.php?from=84ddda58c870681dd12ed765e9d59d5e00567f94&to=af032f1351358f2f5b5d9f4e87c5601c23b9bd37&stat=instructions:u
2025-02-23 17:52:38 +08:00
Yeaseen
96c723374a
[llvm] Remove br i1 undef from some llvm/test/CodeGen tests (#128272) 2025-02-23 09:23:33 +00:00
Yingwei Zheng
2ebc69a521
[InstCombine] Add support for GEPs in simplifyNonNullOperand (#128365)
Alive2: https://alive2.llvm.org/ce/z/2KE8zG
2025-02-23 17:19:31 +08:00
David CARLIER
a8fb2d0c1c
[compiler-rt][rtsan] adding unlink/unlinkat interception. (#128292) 2025-02-23 09:17:48 +00:00
Kazu Hirata
929d70a38d
[llvm-jitlink] Avoid repeated hash lookups (NFC) (#128399) 2025-02-23 01:05:13 -08:00
Kazu Hirata
fb19bddbc5
[SPIRV] Avoid repeated hash lookups (NFC) (#128398) 2025-02-23 01:04:11 -08:00
Kazu Hirata
9dd8c14443
[IR] Avoid repeated map lookups (NFC) (#128396) 2025-02-23 01:03:46 -08:00
Kazu Hirata
b0d1c51a17
[DebugInfo] Avoid repeated hash lookups (NFC) (#128395) 2025-02-23 01:03:22 -08:00
rchamala
2ff3b18554
Allow option to ignore module load errors in ScriptedProcess (#127153)
Current state in scripted process expects [all the
modules](912b154f3a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp (L498))
passed into "get_loaded_images" to load successfully else none of them
load. Even if a module loads fine, [but has already been
appended](912b154f3a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp (L495))
it still fails. This is restrictive and does not help our usecase.

**Usecase**: We have a parent scripted process using coredump +
tombstone.

1) Scripted process uses child elf-core process to read memory dump

2) Uses tombstones to pass thread names and modules.

We do not know whether the modules will be successfully downloaded
before creating the scripted process. We use [python module
callbacks](a57e58dbfa/lldb/source/Target/Platform.cpp (L1593))
to download a module from symbol server at LLDB load time when the
scripted process is being created. The issue is that if one of the
symbol is not found from the list specified in tombstone, none of the
modules load in scripted process. Even if we ensure symbols are present
in symbol server before creating the scripted process, if the load
address is wrong or if the module is already appended, all module loads
are skipped.

**Solution**: Pass in a custom boolean option arg for every module from
python scripted process plugin which will indicate whether to ignore the
module load error. This will provide the flexibility to user for loading
the successfully fetched modules into target while ignoring the failed
ones

---------

Co-authored-by: rchamala <rachamal@fb.com>
2025-02-23 00:51:43 -08:00
Owen Pan
0968df9c3a
[clang-format] Add the C language instead of treating it like C++ (#128287)
Closes #128120
2025-02-23 00:36:19 -08:00
Uday Bondhugula
8ff4d27fe6
[MLIR][Affine] NFC. Fix outdated comment in affine analysis utils (#128406) 2025-02-23 13:13:39 +05:30
Lang Hames
33f2686bed [llvm-jitlink] Only use candidate library extensions during library search.
While processing library link options that check search paths (-lx, -hidden-lx,
etc.) we shouldn't generate candidate paths with extensions that are invalid
for the option being visited (e.g. -hidden-lx only applies to archives, so we
shouldn't generate candidates with `.so` extensions).

Note: Candidate extensions should probably be further filtered based on the OS
of the executing process. This patch is a step in the right direction though.
2025-02-23 18:16:10 +11:00
Lang Hames
21939c4c2e [ORC] Fix type name in comments. NFC. 2025-02-23 18:16:10 +11:00
Craig Topper
4efad490af [WebAssembly] Use Register instead of unsigned. NFC 2025-02-22 22:45:06 -08:00
Craig Topper
b38d472055 [ARM] Prevent converting a virtual register to MCRegister. NFC 2025-02-22 22:27:14 -08:00
Craig Topper
228dbd254a [RegAllocGreedy] Use MCRegister instead of Register for functions that return a physical register.
The callers of these functions return the value as an MCRegister
so this removes some casts from Register to MCRegister.
2025-02-22 21:39:25 -08:00