518493 Commits

Author SHA1 Message Date
Johannes Doerfert
2edfa50e7f
[Offload][NFC] Update README.md 2024-11-17 07:32:29 -08:00
Nikolas Klauser
7c010bfdc5
[libc++] Remove some unnecessary boilerplate in <__chrono/duration.h> (#116238) 2024-11-17 12:23:05 +01:00
Brandon Wu
206ee71918
[RISCV] Change vector tuple type's TypeSize to scalable (#114329)
Vector tuple is basically multiple grouped vector, so its size is also
determined by vscale, we need not to model it as a vector type but its
size need to be scalable.
2024-11-17 18:52:49 +08:00
Nikolas Klauser
811186764d [libc++] Fix a few problems found by clang-tidy 2024-11-17 11:07:41 +01:00
Matthias Springer
f0b8025ca2
[mlir][Quant][NFC] Apply clang-format to StripFuncQuantTypes.cpp (#116535) 2024-11-17 17:45:04 +09:00
David Green
49b29368f7 [AArch64][GlobalISel] Expand handling of phi operations
Like other operations, non-power-2 vectors are widened to a power-2, larger
vectors with i128 elements are scalarized and smaller vectors are widened to be
at least 64bit.
2024-11-17 08:25:53 +00:00
Fangrui Song
5b1b6a62b8 [ELF] Make elfHeader/programHeaders unique_ptr
This removes some SpecificAlloc instantiations, makes lld smaller, and
drops the small memory waste due to the separate BumpPtrAllocator.
2024-11-17 00:25:42 -08:00
Fangrui Song
53dc4e7600 [ELF] createSyntheticSections: replace some make<> with unique_ptr
This removes some SpecificAlloc instantiations and makes lld smaller.
This drops the small memory waste due to the separate BumpPtrAllocator.
2024-11-17 00:09:06 -08:00
Fangrui Song
dbf37e956a [ELF] Move InputFile storage from make<> to LinkerDriver::files 2024-11-16 23:50:35 -08:00
Fangrui Song
2991a4e209 [ELF] Replace functions bAlloc/saver/uniqueSaver with member access 2024-11-16 22:34:13 -08:00
Fangrui Song
8f238f662c [ELF] Make Ctx inherit from CommonLinkerContext
link calls `new CommonLinkerContext`. Now that `Ctx ctx` is a local
variable, we can make it inherit from CommonLinkerContext.
2024-11-16 22:28:55 -08:00
Craig Topper
b3230dd452 [Mips] Remove roots from ComplexPatterns that are never used as roots. NFC 2024-11-16 21:42:18 -08:00
Craig Topper
275bcd0238 [Mips] Remove some duplicate PatFrags. NFC 2024-11-16 21:42:18 -08:00
Craig Topper
34712c3455 [Mips] Remove unnecessary casts from some isel patterns. NFC 2024-11-16 21:42:18 -08:00
Craig Topper
3c5f33717c [Mips] Remove unused tablegen class. NFC 2024-11-16 21:42:18 -08:00
Fangrui Song
fcb6b132fa [lld] Use context-aware outs() and errs()
For COFF and ELF that are mostly free of global states, lld::errs() and
lld::outs() should not be used. This migration change allows us to
remove lld::errs, which uses the global errorHandler().
2024-11-16 21:37:34 -08:00
Craig Topper
2f4572f5e7
[Mips] Change vsplat_imm_eq_1 to a ComplexPattern. (#116471)
Resolves a FIXME and avoids needing to workaround #116075.

Adding parentheses around the (vsplat_imm_eq_1) fixes the error cited in
the FIXME by changing the ComplexPattern from a leaf node to an
operator.
2024-11-16 20:55:33 -08:00
Fangrui Song
ddc0eb70c8 [lld,MinGW] Use context-aware outs() and errs()
lld::outs() and lld::errs() use the global errorHandler() and should be
avoided.
2024-11-16 20:43:42 -08:00
Fangrui Song
834457a134 [ELF] Simplify relocateNonAlloc diagnostic 2024-11-16 20:38:27 -08:00
Craig Topper
a6140af4f0
[Mips] Reduce number of selectVSplatUimm/Simm functions by using templates. (#116475)
The implementaton of methods only vary by what arguments they pass to
selectVSplatCommon.

Turn selectVSplatCommon into a virtual function and use template methods
in the base class to pass the immediate size.
2024-11-16 20:37:28 -08:00
Fangrui Song
483516fd83 [ELF] Remove unneeded Twine() 2024-11-16 20:32:44 -08:00
Fangrui Song
c1a6defd9f [ELF] Make RelType a struct type
otherwise operator<<(const ELFSyncStream &s, RelType type) applies to
non-reloc-type uint32_t, which can be confusing.
2024-11-16 20:26:34 -08:00
Fangrui Song
e57331ec63 [ELF] Move global relocMutex/undefs into Ctx 2024-11-16 19:22:11 -08:00
Fangrui Song
9664ce6d59 [ELF] Simplify complex diagnostics 2024-11-16 19:11:58 -08:00
Kazu Hirata
fd9f3beb0f
[memprof] Upgrade a unit test to Version 3 (#116516)
I'm planning to remove MemProf Version 1, which is a maintenance
burden because it uses a different set of struct fields in
IndexedAllocationInfo and IndexedMemProfRecord compared to Version 2
and 3.  (FWIW, Version 2 and 3 are much closer to each other.)

Before we remove the old version, we need to upgrade
test_memprof_merge to Version 3.  Here are some remarks:

- Without this patch, we call Writer.addMemProfFrame, which I don't
  think is correct.  This way, we are adding IndexedMemProfRecord to
  Writer2 without any frame.  I'm changing that to
  Writer2.addMemProfFrame.

- This patch adds a call to getCallStackMapping.  Version 2 and 3
  require a map from call stack IDs to call stacks.

- I'm calling makeRecordV2 instead of makeRecord to populate the
  struct fields used by Version 2 and 3.

- Version 1 uses MemProfRecord::MemProfRecord (that is, a constructor)
  to convert IndexedMemProfRecord to MemProfRecord.  Version 2 and 3
  use MemProfRecord::toMemProfRecord, a member function, to do the
  same task.
2024-11-16 19:06:10 -08:00
Fangrui Song
8c7c8eaa19 [lld-link] Replace global lld::errs() with ctx.e.errs() 2024-11-16 18:45:47 -08:00
Aiden Grossman
5bb9465d35 [llvm-exegesis] Reserve members in array
This patch reserves members in the RegisterSetUp vector as we statically
know the size.
2024-11-17 02:32:04 +00:00
Fangrui Song
1bfe55aff5 [lld-link] Replace errorHandler() with ctx.e
errorHandler() uses the global state, which should be avoided in
lld/COFF code.
2024-11-16 18:31:58 -08:00
Fangrui Song
dc6229bd66 [lld] Use context-aware outs() and errs() 2024-11-16 18:25:51 -08:00
Fangrui Song
73bb022b46 [ELF] Remove global ctx
This commit completes the work that eliminates global variables like
config/target/inputSections/symTab from lld/ELF.

Key changes:

* Introduced `lld:🧝:ctx` to encapsulate global state.
* Moved global variables into `Ctx lld:🧝:ctx`
* Updated many functions to accept `Ctx &ctx`
* Made `ctx` a local variable (this commit)

If we don't count `static std::mutex`, this is the last major global
state within lld/ELF (minor ones like `SharedFile::vernauxNum`
(33ff9e43b4c5bdc3da31c6b11ad51d35a69bec5f) might not all be eliminated
yet).
2024-11-16 17:24:11 -08:00
Fangrui Song
7379a194d5 [ELF] Replace PPC64 writeSequence static variables with bAlloc
to reduce global state.
2024-11-16 17:14:29 -08:00
Fangrui Song
33ff9e43b4 [ELF] Move SharedFile::vernauxNum to Ctx 2024-11-16 17:00:51 -08:00
Fangrui Song
abbb0d9c94 [ELF] Remove unneeded toStr(ctx, x) when using ELFSyncStream
This patch removes the last use of the global `elf::ctx` outside of
elf::link.
2024-11-16 16:28:48 -08:00
Fangrui Song
6f87d1437e [ELF] Initialize Ctx members
Prevent use of uninitialized memory when `ctx` becomes a local variable.
2024-11-16 16:22:59 -08:00
Fangrui Song
7d13775486 [ELF] Pass ctx & 2024-11-16 15:48:01 -08:00
Fangrui Song
4a67b93fe8 [ELF] Make checkError context-aware 2024-11-16 15:43:05 -08:00
Fangrui Song
3b75a5c4c8 [ELF] Replace message(...) with Msg(ctx) 2024-11-16 15:34:42 -08:00
Fangrui Song
ce13dd1f7e [ELF] Replace fatal with Fatal(ctx) 2024-11-16 15:24:53 -08:00
Fangrui Song
a626eb2a2f [ELF] Pass ctx to bAlloc/saver/uniqueSaver 2024-11-16 15:20:21 -08:00
Sergei Barannikov
baf59be89b
[SelectionDAG] Fix return types of TC_RETURN for several targets (#116504)
TC_RETURN nodes do not have a glue result.
2024-11-17 02:14:05 +03:00
Fangrui Song
24c7d97cff [ELF] Replace context-less errorHandler() and error() with ctx.errHandler 2024-11-16 14:14:54 -08:00
Tom Honermann
3f6a1d1793
Guard against self-assignment in the DominatorTreeBase move assignment operator. (#116464)
The `DominatorTreeBase` move assignment operator was not self-assignment
safe because the last thing it does before returning is to release all
resources held by the source object. This issue was reported by a static
analysis tool; no self-assignment is known to occur in practice.
2024-11-16 16:39:30 -05:00
Fangrui Song
4a6f59ac3c [ELF] Replace lld::warn with Warn(ctx) 2024-11-16 13:38:43 -08:00
Fangrui Song
6c19fa4bfc [ELF] Remove unneeded toString(Error) when using ELFSyncStream 2024-11-16 13:31:05 -08:00
Fangrui Song
38870fe124 [ELF] Remove unneeded toString(Error) when using ELFSyncStream 2024-11-16 13:22:06 -08:00
Fangrui Song
be5dad012e [ELF] Replace internalLinkerError(getErrorLoc(ctx, buf) + ...) with InternalErr(ctx, buf)
and simplify `+ toStr(ctx, x)` to `<< x`.
The trailing '\n' << llvm::getBugReportMsg() is not very useful and
therefore removed.
2024-11-16 13:07:17 -08:00
Kazu Hirata
7642759498
[Lex] Remove unused includes (NFC) (#116460)
Identified with misc-include-cleaner.
2024-11-16 12:14:06 -08:00
Kazu Hirata
73e89cf66d
[Mips] Remove unused includes (NFC) (#116499)
Identified with misc-include-cleaner.
2024-11-16 12:13:26 -08:00
Fangrui Song
a6755bdad1 [ELF] Replace global ctx with getCtx() 2024-11-16 12:11:00 -08:00
Lee Wei
64b9753d03
[llvm] Replace UndefValue placeholders with PoisonValue in unit tests [NFC] (#116453)
This PR replaces all `UndefValue` act as placeholders with `PoisonValue`
in `llvm/unittests`.
2024-11-16 20:01:27 +00:00