520563 Commits

Author SHA1 Message Date
Anutosh Bhat
da24c02466
[clang-repl] Remove redundant shared flag while running clang-repl in browser (#118107)
While running clang-repl in the browser, we would be interested in this
cc1 command

`
"" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free
-clear-ast-before-backend -disable-llvm-verifier -discard-value-names
-main-file-name "<<< inputs >>>" -mrelocation-model static
-mframe-pointer=none -ffp-contract=on -fno-rounding-math
-mconstructor-aliases -target-cpu generic -debugger-tuning=gdb
-fdebug-compilation-dir=/ -v -fcoverage-compilation-dir=/ -resource-dir
/lib/clang/19 -internal-isystem /include/wasm32-emscripten/c++/v1
-internal-isystem /include/c++/v1 -internal-isystem
/lib/clang/19/include -internal-isystem /include/wasm32-emscripten
-internal-isystem /include -std=c++17 -fdeprecated-macro -ferror-limit
19 -fvisibility=default -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf
-fcxx-exceptions -fexceptions -fincremental-extensions -o "<<< inputs
>>>.o" -x c++ "<<< inputs >>>"
`

As can be seen `shared` is anyway overwritten by `static` which is also
what would be provided by default. Hence we can get rid of the shared
flag here.
2024-12-06 08:35:00 +01:00
Owen Pan
e25c556abe [clang-format][NFC] Reformat git-clang-format with black -l80 2024-12-05 23:18:24 -08:00
WANG Rui
dca2ed3127 [LoongArch][NFC] Pre-commit tests for sign-extension removal with vectors 2024-12-06 15:02:55 +08:00
Pengcheng Wang
35619c791d
[RISCV] Add tune info for mem* expansion (#118439)
So that CPUs can tune these options.
2024-12-06 14:48:37 +08:00
Jonas Devlieghere
f7261e9bbe
[dsymutil] Emit a warning instead of an error when using fat64 header (#118898)
Universal Mach-O files can't have an archicture slice that starts beyond
the 4GB boundary. However, we support generating universal binaries with
a fat64 header, but older tools may not understand this format.

Currently, unless -fat64 is passed, dsymutil will error out when it
encounters a slice that would exceeds the 4GB limit. Now that more tools
(like LLDB and CoreSymbolication) understand the fat64 header format,
this patch changes the default behavior to use the fat64 header and
emits a warning instead. The warning can be silenced by passing the
-fat64 flag. The goal is to eventually remove the warning altogether.

rdar://140998416
2024-12-05 21:20:07 -08:00
Fangrui Song
c7caab2238 [lld-link] Simplify some << toString 2024-12-05 20:56:19 -08:00
Fangrui Song
983f88c1ec [lld-link] Use COFFSyncStream
Add a operator<< overload for Symbol *.
2024-12-05 20:41:37 -08:00
Owen Pan
fb2cbc00e0 [clang-format] Reformat Python script git-clang-format with black 2024-12-05 20:26:02 -08:00
vporpo
eeb55d3af6
[SandboxVec][DAG] Update MemDGNode chain upon instr creation (#116896)
The DAG maintains a chain of MemDGNodes that links together all the
nodes that may touch memroy.
Whenever a new instruction gets created we need to make sure that this
chain gets updated. If the new instruction touches memory then its
corresponding MemDGNode should be inserted into the chain.
2024-12-05 20:23:06 -08:00
Fangrui Song
8b844de3c9 [lld-link] Replace fatal(...) with Fatal 2024-12-05 20:18:01 -08:00
Owen Pan
9a5946cdba [clang-format] Add --directory option to dump_format_help.py 2024-12-05 20:16:09 -08:00
Han-Kuan Chen
94fbe7e3ae
[SLP] NFC. Replace TreeEntry::setOperandsInOrder with VLOperands. (#113880)
To reduce repeated code, TreeEntry::setOperandsInOrder will be replaced
by VLOperands.
Arg_size will be provided to make sure other operands will not be
reorderd when VL[0] is IntrinsicInst (because APO is a boolean value).
In addition, BoUpSLP::reorderInputsAccordingToOpcode will also be
removed since it is simple.
2024-12-06 12:03:23 +08:00
Fangrui Song
36c294013c [lld-link] Remove unneeded Twine when using COFFSyncStream 2024-12-05 19:49:53 -08:00
Fangrui Song
8d225f10ef [lld-link] Replace error(...) with Err 2024-12-05 19:44:26 -08:00
Owen Pan
f0b09dfd4c [clang-format] Add cmake target clang-format-style-options
This new custom target is for running dump_format_style.py to update
ClangFormatStyleOptions.rst if any of its dependencies changes.
2024-12-05 19:38:34 -08:00
Dave Lee
398f3b368a
[lldb] Add synthetic formatter for llvm::Expected (#118758)
Adds a synthetic formatter for `llvm::Expected<T>`. The synthetic value
will have a single child, either `value` or `error`.
2024-12-05 19:31:20 -08:00
Owen Pan
74d29c6393 [clang-format] Open plurals.txt in read-only mode in dump_format_style.py 2024-12-05 19:25:32 -08:00
Michał Górny
b54ba5361e
[offload] Add gfx1012 (Navi 14) to AMDGPU models list (#118857)
Fixes #118824
2024-12-06 03:24:55 +00:00
Michał Górny
5e0844a969
[llvm] Pass FFI CMake options through to runtimes (for offload) (#118807)
Pass the FFI-related CMake options through to runtimes, since offload is
building against libffi. This is needed when the system requires custom
`LIBFFI_INCLUDE` to build (e.g. on Gentoo where the headers are
installed to `/usr/lib*/libffi/include`).
2024-12-06 03:24:28 +00:00
LLVM GN Syncbot
548678ef84 [gn build] Port b5bd19211118 2024-12-06 02:54:53 +00:00
Chuanqi Xu
b5bd192111 [Serialization] Support load lazy specialization lazily
Currently all the specializations of a template (including
instantiation, specialization and partial specializations)  will be
loaded at once if we want to instantiate another instance for the
template, or find instantiation for the template, or just want to
complete the redecl chain.

This means basically we need to load every specializations for the
template once the template declaration got loaded. This is bad since
when we load a specialization, we need to load all of its template
arguments. Then we have to deserialize a lot of unnecessary
declarations.

For example,

```
// M.cppm
export module M;
export template <class T>
class A {};

export class ShouldNotBeLoaded {};

export class Temp {
   A<ShouldNotBeLoaded> AS;
};

// use.cpp
import M;
A<int> a;
```

We should a specialization ` A<ShouldNotBeLoaded>` in `M.cppm` and we
instantiate the template `A` in `use.cpp`. Then we will deserialize
`ShouldNotBeLoaded` surprisingly when compiling `use.cpp`. And this
patch tries to avoid that.

Given that the templates are heavily used in C++, this is a pain point
for the performance.

This patch adds MultiOnDiskHashTable for specializations in the
ASTReader. Then we will only deserialize the specializations with the
same template arguments. We made that by using ODRHash for the template
arguments as the key of the hash table.

To review this patch, I think `ASTReaderDecl::AddLazySpecializations`
may be a good entry point.

The patch was reviewed in
https://github.com/llvm/llvm-project/pull/83237 but that PR is a stacked
PR. But I feel the intention of the stacked PRs get lost during the
review process. So I feel it is better to merge the commits into a
single commit instead of merging them in the PR page. It is better for
us to cherry-pick and revert.
2024-12-06 10:52:35 +08:00
Kazu Hirata
d88a0c7322
[memprof] Rename Inline to IsInlineFrame in YAML (#118901)
This patch makes the YAML field name match the struct field name.
2024-12-05 18:39:03 -08:00
Renaud Kauffmann
27e458c8cb
[flang][cuda] Distinguish constant fir.global from globals with a #cuf.cuda<constant> attribute (#118912)
1. In `CufOpConversion` `isDeviceGlobal` was renamed
`isRegisteredGlobal` and moved to the common file. `isRegisteredGlobal`
excludes constant `fir.global` operation from registration. This is to
avoid calls to `_FortranACUFGetDeviceAddress` on globals which do not
have any symbols in the runtime. This was done for
`_FortranACUFRegisterVariable` in #118582, but also needs to be done
here after #118591
2. `CufDeviceGlobal` no longer adds the `#cuf.cuda<constant>` attribute
to the constant global. As discussed in #118582 a module variable with
the #cuf.cuda<constant> attribute is not a compile time constant. Yet,
the compile time constant also needs to be copied into the GPU module.
The candidates for copy to the GPU modules are
- the globals needing regsitrations regardless of their uses in device
code (they can be referred to in host code as well)
       - the compile time constant when used in device code 

3. The registration of "constant" module device variables (
#cuf.cuda<constant>) can be restored in `CufAddConstructor`
2024-12-05 18:36:48 -08:00
abhishek-kaushik22
d20731ce6b
[CGData][GlobalIsel][Legalizer][DAG][MC][AsmParser][X86][AMX] Use std::move to avoid copy (#118068) 2024-12-06 09:46:15 +08:00
Shilei Tian
eb49788bd9
[Offload][AMDGPU] Allow COV6 images (#118909) 2024-12-05 20:05:39 -05:00
Lang Hames
8201ae2aa6 [ORC] Provide default MemoryAccess in SimpleRemoteEPC, add WritePointers impl.
Make EPCGenericMemoryAccess the default implementation for the MemoryAccess
object in SimpleRemoteEPC, and add support for the WritePointers operation to
OrcTargetProcess (previously this operation was unimplemented and would have
triggered an error if accessed in a remote-JIT setup).

No testcase yet: This functionality requires cross-process JITing to test (or a
much more elaborate unit-test setup). It can be tested once the new top-level
ORC runtime project lands.
2024-12-06 11:55:46 +11:00
Nathan Ridge
9ccde12f5e
[clang] Compute accurate begin location for CallExpr with explicit object parameter (#117841)
The explicit object parameter is written before the callee expression,
so the begin location should come from the explicit object parameter.

Fixes https://github.com/llvm/llvm-project/issues/116335
2024-12-05 19:52:23 -05:00
Craig Topper
2b855dd970 [RISCV] Correct the pass name for RISCVPostRAExpandPseudo.
riscv-expand-pseudolisimm32 -> riscv-post-ra-expand-pseudoa
2024-12-05 16:43:30 -08:00
Mehdi Amini
a9b399aeef
[MLIR][GPU] Fix memref.dim folding with out-of-bound index (#118890)
Fixes #118760
2024-12-05 16:36:33 -08:00
Philip Reames
e60a939a51
[RISCV] Use zext and shift for spread(4,8) when types allow (#118893)
For a spread with an element type small enough, we can use a zext and
shift to perform the shuffle. For e8, this covers spread(2,4,8), and for
e16 covers spread(2,4). Note that spread(2) is already covered by the
existing interleave logic, and is simply listed for completeness in the
prior description.
2024-12-05 16:34:15 -08:00
Lang Hames
6410edcb67 [examples] Add missing dependence on OrcShared.
Hopefully this will fix the linker error in
https://lab.llvm.org/buildbot/#/builders/80/builds/7248.
2024-12-06 00:33:45 +00:00
Ellis Hoag
e33b00a218
[InstrProf][lld] Extend test to confirm order_file takes precedense over BP (#118889)
When both `-order_file` and `--irpgo-profile-sort=` (soon to be
`-bp-startup-sort=function` in
https://github.com/llvm/llvm-project/pull/118594) are used, we want to
confirm that symbols in the orderfile take precedence.
2024-12-05 16:27:55 -08:00
Jonas Devlieghere
244b207d3c
[lldb-dap] Add attach & corefile templates (#118894) 2024-12-05 16:20:11 -08:00
Brox Chen
1a89604901
[AMDGPU][True16][MC] create true16/fake16 mc tests for more vop3 test file (#118859)
This is a NFC.

Create and duplicate test file for true16/fake16 mc test and update with
+real-true16/-real-true16 flags properly.

This is for preparing more test changes for true16 flows
2024-12-05 19:04:46 -05:00
Craig Topper
37b10af6a0 [RISCV][GISel] Use correct shift width for GIShiftMask32 ComplexOperandMatcher.
We should use 32 instead of XLen. This allows us to remove
'and X, 31' from the shift amount.
2024-12-05 15:52:41 -08:00
Lang Hames
794afe0b86 [ORC] Remove an unused variable. 2024-12-06 10:31:17 +11:00
Schrodinger ZHU Yifan
2dba66b853
[libc] document supported os ranges (#118863) 2024-12-05 18:25:07 -05:00
Jared Wyles
2ccf7ed277
[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning
on the boundary between JITLink and ORC, and allows pointer comparisons (rather
than string comparisons) between Symbol names. This should improve the
performance and readability of code that bridges between JITLink and ORC (e.g.
ObjectLinkingLayer and ObjectLinkingLayer::Plugins).

To enable use of SymbolStringPtr a std::shared_ptr<SymbolStringPool> is added to
LinkGraph and threaded through to its construction sites in LLVM and Bolt. All
LinkGraphs that are to have symbol names compared by pointer equality must point
to the same SymbolStringPool instance, which in ORC sessions should be the pool
attached to the ExecutionSession.
---------

Co-authored-by: Lang Hames <lhames@gmail.com>
2024-12-06 10:22:09 +11:00
Schrodinger ZHU Yifan
e6cf5d2863
Reapply "[libc][windows] start time API implementation (#117775)" (#118886) 2024-12-05 18:21:03 -05:00
Congcong Cai
63dfe70b22
[clang-tidy][NFC] move AST_MATCHER to anonymous namespace in InfiniteLoopCheck (#118820) 2024-12-06 06:46:03 +08:00
Maryam Moghadas
68e75eebec
[PPC] Custom lower ssubo for i64 (#118711)
This is a follow-up patch to improve the codegen for ssubo node for i64
in 64-bit mode by custom lowering.
2024-12-05 17:22:44 -05:00
Sergei Barannikov
426aecb7e9
[libunwind] Fix a typo in debug print (#118856) 2024-12-06 01:22:14 +03:00
Nick Desaulniers
7329086d4e
[libc][docs] stub out assert, errno, and locale (#118852)
[libc][docs] stub out assert, errno, and locale

These were the remaining c89 library headers (besides string.h and
stdlib.h; I
will split strings.rst in a follow up commit).

The macro support detection in docgen doesn't quite work for some of
these
headers. Add the stubs for these headers for now, and fix up docgen
later.

See the "NIST publication":
Link: https://www.open-std.org/jtc1/sc22/wg14/www/projects.html
2024-12-05 14:20:03 -08:00
Nick Desaulniers
a9aff440d9
[libc][docs] reorganize documentation (#118836)
This commit does a few things:
* creates libc/docs/headers/ and moves all user API related headers under it.
* updates paths and docgen
* updates the top level index to put these headers under a new "Implementation
  Status" tab.
* rename some of the files to be foo.rst for foo.h (except strings, which is
  currently a mix of string.h and stdlib.h)
* update the heading of some files to be in the form foo.h.
2024-12-05 13:54:09 -08:00
Owen Anderson
cfa582e8aa
SimplifyLibCalls: Use default globals address space when building new global strings. (#118729)
Writing a test for this transitively exposed a number of places in
BuildLibCalls where
we were failing to propagate address spaces properly, which are
additionally fixed.
2024-12-06 10:51:14 +13:00
Vitaly Buka
6f21401ae9
Remove fixme about BFD and Android
Follow up to #118858
2024-12-05 13:23:50 -08:00
Kazu Hirata
dbd920b290 Reapply [memprof] Update YAML traits for writer purposes (#118720)
For Frames, we prefer the inline notation for the brevity.

For PortableMemInfoBlock, we go through all member fields and print
out those that are populated.

This iteration works around the unavailability of
ScalarTraits<uintptr_t> on macOS.
2024-12-05 13:19:19 -08:00
Tristan Ross
3a7d1b5c16
[libc] Include CheckCXXCompilerFlag when checking compiler features (#118862)
Includes `CheckCXXCompilerFlag` so when building LLVM libc is built
standalone, it actually works and doesn't complain about
`check_cxx_compiler_flag` not being defined.
2024-12-05 15:12:36 -06:00
Owen Anderson
698d832185
DataLayout: Fix latent issues with getMaxIndexSizeInBits (#118740)
Because it was implemented in terms of getMaxIndexSize, it was always
rounding the values up to a multiple of 8. Additionally, it was using
the PointerSpec's BitWidth rather than its IndexBitWidth, which was
self-evidently incorrect.

Since getMaxIndexSize was only used by getMaxIndexSizeInBits, and its
name and function seem niche and somewhat confusing, go ahead and remove
it until a concrete need for it arises.
2024-12-06 10:01:59 +13:00
Craig Topper
1d3f9f8862
[SelectionDAG] Stop storing EVTs in a function scoped static std::set. (#118715)
EVTs potentially contain a Type * that points into memory owned by an
LLVMContext. Storing them in a function scoped static means they may
outlive the LLVMContext they point to.

This std::set is used to unique single element VT lists containing a
single extended EVT. Single element VT list with a simple EVT are
uniqued by a separate cache indexed by the MVT::SimpleValueType enum. VT
lists with more than one element are uniqued by a FoldingSet owned by
the SelectionDAG object.

This patch moves the single element cache into SelectionDAG so that it
will be destroyed when SelectionDAG is destroyed.

Fixes #88233
2024-12-05 12:56:36 -08:00