Noah Shutty [Thu, 7 Jul 2022 18:48:45 +0000 (18:48 +0000)]
Try to fix shared lib buildbot failures after
36f01909a0e2 (D114846)
Noah Shutty [Thu, 7 Jul 2022 17:55:25 +0000 (17:55 +0000)]
[llvm] [Debuginfod] LLVM debuginfod server.
This implements a debuginfod server in llvm using the `DebuginfodCollection` and `DebuginfodServer` classes. This is tested with lit tests against the debuginfod-find client.
The server scans 0 or more local directories for artifacts. It serves the debuginfod protocol over HTTP. Only the `executable` and `debuginfo` endpoints are supported (no `/source` endpoint).
The server also uses the debuginfod client as a fallback, so it can hit the local debuginfod cache or federate to other known debuginfod servers.
The client behavior is controllable through the standard environment variables (`DEBUGINFOD_URLS`, `DEBUGINFOD_CACHE_PATH`, `DEBUGINFOD_TIMEOUT`)
The server implements on-demand collection updates as follows:
If the build-id is not found by a local lookup, rescan immediately and look up the build-id again before returning 404. To protect against DoS attacks, do not rescan more frequently than once per N seconds (specified by `-m`).
Lit tests are provided which test the `llvm-debuginfod-find` client against the `llvm-debuginfod` server.
Reviewed By: mysterymath
Differential Revision: https://reviews.llvm.org/D114846
Fangrui Song [Thu, 7 Jul 2022 17:51:20 +0000 (10:51 -0700)]
[docs] Move code contribution from GettingStarted.rst to Contributing.rst
For code contribution, GettingStarted.rst duplicates information in Contributing.rst.
The dedicated Contributing.rst is a better place for code contribution, so move
the content there.
Notes:
* D41665 added `Contributing.rst`
* D110976 mentioned `git cherry-pick
e3659d43d8911e91739f3b0c5935598bceb859aa` workaround
Reviewed By: cjdb, fhahn, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D129255
Dominic Chen [Wed, 6 Jul 2022 22:52:32 +0000 (15:52 -0700)]
[scudo] Pass MapPlatformData in more calls
Allow platforms to avoid looking up private data by providing private context
Differential Revision: https://reviews.llvm.org/D129237
theidexisted [Thu, 7 Jul 2022 17:27:56 +0000 (10:27 -0700)]
[NFC][sanitizer] Minor change: eliminate loop
Reviewed By: #sanitizers, fmayer, vitalybuka
Differential Revision: https://reviews.llvm.org/D128873
Zequan Wu [Fri, 13 May 2022 00:46:12 +0000 (17:46 -0700)]
[LLDB][NFC] Decouple dwarf location table from DWARFExpression.
Differential Revision: https://reviews.llvm.org/D125509
Ben Langmuir [Thu, 7 Jul 2022 17:06:49 +0000 (10:06 -0700)]
[clang] Cleanup ASTContext before output files in crash recovery for modules
When we recover from a crash in a module compilation thread, we need to
ensure any output streams owned by the ASTConsumer (e.g. in
RawPCHContainerGenerator) are deleted before we call clearOutputFiles().
This has the same theoretical issues with proxy streams that Duncan
discusses in the commit
2d133867833fe8eb. In practice, this was observed
as a use-after-free crash on a downstream branch that uses such a proxy
stream in this code path. Add an assertion so it won't regress.
Differential Revision: https://reviews.llvm.org/D129220
rdar://
96525032
Jonas Devlieghere [Thu, 7 Jul 2022 16:53:05 +0000 (09:53 -0700)]
[lldb] Improve the error message in run_to_breakpoint_do_run
Improve the error message when we fail to hit the initial breakpoint in
run_to_breakpoint_do_run. In addition to the process state, we now also
report the exit code and reason (if the process exited) as well as the
inferior's output.
Differential revision: https://reviews.llvm.org/D111978
Fangrui Song [Thu, 7 Jul 2022 17:18:45 +0000 (10:18 -0700)]
[ELF] Relax R_RISCV_CALL and R_RISCV_CALL_PLT
A pair of auipc+jalr relocated by R_RISCV_CALL or R_RISCV_CALL_PLT can be
converted to c.j, c.jal, or jal.
* c.j: RVC and displacement is representable as an int12
* c.jal: RV32C and displacement is representable as an int12
* jal: displacement is representable as an int21
Use the D127581 relaxation framework to implement the relaxation. If a shorter
sequence is satisfied, we record the new relocation type in `relocTypes` and
saves the new instruction into `writes`. Finally let `riscvFinalizeRelax` rewrite the
instruction by setting `skip`.
Differential Revision: https://reviews.llvm.org/D127611
Sam McCall [Thu, 7 Jul 2022 17:14:37 +0000 (19:14 +0200)]
[clangd] Disable flaky test
Mogball [Thu, 23 Jun 2022 19:02:58 +0000 (19:02 +0000)]
[mlir] An implementation of sparse data-flow analysis
This patch introduces a (forward) sparse data-flow analysis implemented with the data-flow analysis framework. The analysis interacts with liveness information that can be provided by dead-code analysis to be conditional. This patch re-implements SCCP using dead-code analysis and (conditional) constant propagation analyses.
Depends on D127064
Reviewed By: rriddle, phisiart
Differential Revision: https://reviews.llvm.org/D127139
Fangrui Song [Thu, 7 Jul 2022 17:16:09 +0000 (10:16 -0700)]
[ELF] Relax R_RISCV_ALIGN
Alternative to D125036. Implement R_RISCV_ALIGN relaxation so that we can handle
-mrelax object files (i.e. -mno-relax is no longer needed) and creates a
framework for future relaxation.
`relaxAux` is placed in a union with InputSectionBase::jumpInstrMod, storing
auxiliary information for relaxation. In the first pass, `relaxAux` is allocated.
The main data structure is `relocDeltas`: when referencing `relocations[i]`, the
actual offset is `r_offset - (i ? relocDeltas[i-1] : 0)`.
`relaxOnce` performs one relaxation pass. It computes `relocDeltas` for all text
section. Then, adjust st_value/st_size for symbols relative to this section
based on `SymbolAnchor`. `bytesDropped` is set so that `assignAddresses` knows
that the size has changed.
Run `relaxOnce` in the `finalizeAddressDependentContent` loop to wait for
convergence of text sections and other address dependent sections (e.g.
SHT_RELR). Note: extrating `relaxOnce` into a separate loop works for many cases
but has issues in some linker script edge cases.
After convergence, compute section contents: shrink the NOP sequence of each
R_RISCV_ALIGN as appropriate. Instead of deleting bytes, we run a sequence of
memcpy on the content delimitered by relocation locations. For R_RISCV_ALIGN let
the next memcpy skip the desired number of bytes. Section content computation is
parallelizable, but let's ensure the implementation is mature before
optimizations. Technically we can save a copy if we interleave some code with
`OutputSection::writeTo`, but let's not pollute the generic code (we don't have
templated relocation resolving, so using conditions can impose overhead to
non-RISCV.)
Tested:
`make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- LLVM=1 defconfig all` built Linux kernel using -mrelax is bootable.
FreeBSD RISCV64 system using -mrelax is bootable.
bash/curl/firefox/libevent/vim/tmux using -mrelax works.
Differential Revision: https://reviews.llvm.org/D127581
Daniel Bertalan [Thu, 7 Jul 2022 15:31:59 +0000 (17:31 +0200)]
[InstCombine] Do not fold 'and (sext (ashr X, Shift)), C' if Shift < 0
The 'and (sext (ashr X, ShiftC)), C' --> 'lshr (sext X), ShiftC'
transformation would access out of bounds bits in APInt::getLowBitsSet
if the shift count was larger than X's bit width or if it was negative.
Fixes #56424
Michael Jones [Wed, 6 Jul 2022 23:51:12 +0000 (16:51 -0700)]
[libc][nfc] update get_explicit_mantissa
The get_explicit_mantissa function returns the mantissa of an FPBits
floating point value with the implicit leading 1, if appropriate. This
function existed previously, but did not handle non-normal numbers
properly.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D129241
Mark de Wever [Thu, 7 Jul 2022 17:07:03 +0000 (19:07 +0200)]
[libc++][doc] Removes a colon in a title.
Mingming Liu [Thu, 30 Jun 2022 21:15:18 +0000 (14:15 -0700)]
[AArch64][NFC] Prepare test cases (for D128302) to show more accurate cost estimation of extract-element could generate better assembly code.
Pre-commit the test cases (for D128302) to show that more accurate cost
estimation of extract-element could generate better code.
Differential Revision: https://reviews.llvm.org/D128945
Joseph Huber [Thu, 7 Jul 2022 16:23:44 +0000 (12:23 -0400)]
[LinkerWrapper] Identify offloading sections using ELF type
Summary:
A previous patch added a new ELF section type for LLVM offloading. We
should use this when extracting the offloading sections rather than
checking the string. This pach also removes the implicit support for
COFF and MACH-O because we don't support those currently and should not
be included.
Krzysztof Parzyszek [Wed, 6 Jul 2022 18:02:04 +0000 (11:02 -0700)]
[TableGen] Fix CodeGenRegisterClass::hasType for simple-type arguments
The `hasType` function may be given a type that has been modified from
its original form (in particular made "simple", due to a predicate).
Make sure that such a type is still recognized as associated with a
register class, if the class contains it under any hw-mode.
This is somewhat optimistic though, since there is no information as
to where that simple type originated from.
Austin Kerbow [Wed, 6 Jul 2022 04:10:12 +0000 (21:10 -0700)]
[AMDGPU] Disable FillMFMAShadowMutation by default
Disable amdgpu mfma power sched.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D129172
Krzysztof Parzyszek [Thu, 7 Jul 2022 13:52:01 +0000 (06:52 -0700)]
[VE] Change displacement type in MEM..i from i32 to i64
In selection patterns, addresses (like tblockaddr) are passed as the
displacement (the i in MEM..i) to instructions taking MEM operands.
Since addresses are 64-bit, having this part of the MEM..i operand as
i32 causes a type inference error. The instructions actually only encode
32 bits of the displacement, but there is no way to manually extract
these bits (either the high or the low half) in selection patterns.
This didn't happen before, because of a bug in type inference when
dealing with iPTR.
Chi Chun Chen [Thu, 7 Jul 2022 16:29:48 +0000 (11:29 -0500)]
[OpenMP][NFC] Claim order clause modifiers (reproducible and unconstrained)
Valentin Clement [Thu, 7 Jul 2022 07:37:12 +0000 (09:37 +0200)]
[flang][NFC] Make LEN parameters homogenous
This patch is part of the upstreaming effort from fir-dev branch.
This is the last patch for the upstreaming effort.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D129187
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Krzysztof Parzyszek [Wed, 6 Jul 2022 21:16:38 +0000 (14:16 -0700)]
[TableGen] Move printing to stream directly to MachineValueTypeSet
Vitaly Buka [Thu, 7 Jul 2022 02:03:32 +0000 (19:03 -0700)]
[msan] Fix dn_comp interceptor after D126851
Unpoison by strlen(dest), as dn_expand
returns the size if the compressed name (src).
Reviewed By: kstoimenov
Differential Revision: https://reviews.llvm.org/D129244
Joseph Huber [Tue, 5 Jul 2022 16:55:36 +0000 (12:55 -0400)]
[Metadata] Add 'exclude' metadata to add the exclude flags on globals
This patchs adds a new metadata kind `exclude` which implies that the
global variable should be given the necessary flags during code
generation to not be included in the final executable. This is done
using the ``SHF_EXCLUDE`` flag on ELF for example. This should make it
easier to specify this flag on a variable without needing to explicitly
check the section name in the target backend.
Depends on D129053 D129052
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D129151
Joseph Huber [Sun, 3 Jul 2022 22:47:28 +0000 (18:47 -0400)]
[llvm-objdump] Update offload dumping to use SHT_LLVM_OFFLOADING
In order to be more in-line with ELF semantics, a previous patch added
support for a new ELF section type to indicate if a section contains
offloading data. This allows us to now check using this rather than
checking the section name directly. This patch updates the logic to
check the type now instead.
I chose to make this emit a warning if the input is not an ELF-object
file. I could have made the logic fall-back to the section name, but
this offloading in LLVM is currently not supported on any other targets
so it's probably best to emit a warning until we improve support.
Depends on D129052
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D129053
Joseph Huber [Sun, 3 Jul 2022 20:46:31 +0000 (16:46 -0400)]
[Object] Add ELF section type for offloading objects
Currently we use the `.llvm.offloading` section to store device-side
objects inside the host, creating a fat binary. The contents of these
sections is currently determined by the name of the section while it
should ideally be determined by its type. This patch adds the new
`SHT_LLVM_OFFLOADING` section type to the ELF section types. Which
should make it easier to identify this specific data format.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D129052
Joseph Huber [Sat, 2 Jul 2022 02:40:41 +0000 (22:40 -0400)]
[Clang] Use metadata to make identifying embedded objects easier
Currently we use the `embedBufferInModule` function to store binary
strings containing device offloading data inside the host object to
create a fatbinary. In the case of LTO, we need to extract this object
from the LLVM-IR. This patch adds a metadata node for the embedded
objects containing the embedded pointers and the sections they were
stored at. This should create a cleaner interface for identifying these
values.
In the future it may be worthwhile to also encode an `ID` in the
metadata corresponding to the object's special section type if relevant.
This would allow us to extract the data from an object file and LLVM-IR
using the same ID.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D129033
Florian Hahn [Thu, 7 Jul 2022 16:16:46 +0000 (09:16 -0700)]
[IndVars] Add tests for more different float->int conversions.
Extra tests for D129140.
Philip Reames [Thu, 7 Jul 2022 16:05:33 +0000 (09:05 -0700)]
[RISCV] Test coverage for missing commute of vsadd(u)
For some reason, this appears to only happen with fixed length vectors. Scalable ones commute just fine in all the cases I've seen.
Nico Weber [Thu, 7 Jul 2022 16:11:15 +0000 (18:11 +0200)]
Sam McCall [Thu, 7 Jul 2022 16:09:15 +0000 (18:09 +0200)]
[clangd] Fix flaky throttler test
The production code doesn't depend on the relative destruction order of
the throttle request and the main request, but the test does.
Jonas Devlieghere [Thu, 7 Jul 2022 15:48:21 +0000 (08:48 -0700)]
Revert "[libc++] Use ABI tags instead of internal linkage to provide per-TU insulation"
This reverts commit
9ee97ce3b8305c5762ec34eecb4daf379984c95b.
Florian Hahn [Thu, 7 Jul 2022 15:51:15 +0000 (08:51 -0700)]
[LV] Update RISCV test missed by
bc19b7c3cc16.
Florian Hahn [Thu, 7 Jul 2022 15:40:26 +0000 (08:40 -0700)]
[LV] Remove collectTriviallyDeadInstructions, already handled by VP DCE.
Now that removeDeadRecipes can remove most dead recipes across a whole
VPlan, there is no need to first collect some dead instructions.
Instead removeDeadRecipes can simply clean them up.
Depends D127580.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D128408
David Spickett [Thu, 7 Jul 2022 15:29:27 +0000 (15:29 +0000)]
[lldb][Windows] Fixup overlapping memory regions tests
As suggested in post-commit review on https://reviews.llvm.org/D129272.
* Rename the test case.
* Simplify the overlap check.
* Correct assertion.
Mark de Wever [Fri, 1 Jul 2022 17:35:38 +0000 (19:35 +0200)]
[libc++][format] Implements 128-bit support.
With to_chars supporting 128-bit it's possible to support the full
128-bit range in format. This only removes the previous restrictions
and updates the tests to validate proper support.
Depends on D128929.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D129007
Pavel Labath [Thu, 7 Jul 2022 15:14:20 +0000 (17:14 +0200)]
[lldb/test] Use the shim executable for TestGdbRemoteAttach*Or*Wait as well
Without it, the test may nondeterminstically fail due to YAMA
restrictions.
Also, merge the two tests into one to reduce duplication.
Mark de Wever [Thu, 30 Jun 2022 15:25:28 +0000 (17:25 +0200)]
[libc++] Implements 128-bit support in to_chars.
This is required by the Standard and makes it possible to add full
128-bit support to format.
The patch also fixes 128-bit from_chars "support". One unit test
required a too large value, this failed on 128-bit; the fix was to add
more characters to the input.
Note only base 10 has been optimized. Other bases can be optimized.
Note the 128-bit lookup table could be made smaller. This will be done later. I
really want to get 128-bit working in to_chars and format in the upcomming
LLVM 15 release, these optimizations aren't critical.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D128929
Max Kazantsev [Thu, 7 Jul 2022 15:23:14 +0000 (22:23 +0700)]
[Test] Add some tests showing missing opportunities in IndVars
The general idea of these tests is elimination of signed and unsigned
comparison of the same values through proving non-negativity of them.
Here are some examples where SCEV is not smart enough to prove it.
Aleksandr Bezzubikov [Sat, 18 Jun 2022 19:10:54 +0000 (22:10 +0300)]
[SPIR-V] Introduce SPIR-V global entities tracking and deduplication infra.
SPIR-V module typically contains some global entities that were not
global before made it to SPIR-V, e.g. types and constants are not usually
declared globally in LLVM. By design SPIR-V requires such stuff to be declared
once and in the module's global section. Since MIR is not able to represent
such things properly they were generated per-function, and then at the very end
of the backend's pipeline hoisted into some 'meta' function minding possible
duplicates.
New SPIRVDuplicatesTracker keeps mapping of the original LLVM entities such
as types, constant, global variables, etc to their MIR counterparts -
(MachineFunction, Register). Later SPIRVModuleAnalysis (apart from other
thing it's responsible for) performs topological sorting of the
tracker's entries to ensure proper ordering before the hoisting,
and actually performs the hoisting in a duplicates-free manner
by the tracker's nature.
Differential Revision: https://reviews.llvm.org/D128471
David Green [Thu, 7 Jul 2022 15:10:00 +0000 (16:10 +0100)]
[ARM] Switch the costs of mve1beat and mve4beat
These three subtarget features are meant to control where MVE
instructions take 1 vs 2 vs 4 architectural beats. The mve1beat feature
is described as "Model MVE instructions as a 1 beat per tick
architecture", meaning MVE instruction will execute over 4 cycles.
mve4beat is the opposite where the entire 4 beats of the MVE instruction
execute in a single cycle. The costs for the two were backwards though,
not matching the cycle counts like they should. This patch switches the
costs on the two to bring them in-line with expectations.
Differential Revision: https://reviews.llvm.org/D129141
Alex Brachet [Thu, 7 Jul 2022 15:06:52 +0000 (15:06 +0000)]
[libc] Make div test names unique
In Fuchsia, all tests in a directory, ie stdlib, are linked
into one executable, this causes problems for multiple
definitions of the vtables of the div tests because their
class has the same name. This patch just trivially changes
their name to be unique between all div tests.
Differential revision: https://reviews.llvm.org/D129248
Michał Górny [Thu, 7 Jul 2022 15:01:24 +0000 (17:01 +0200)]
Revert "[lldb] [test] Improve stability of llgs vCont-threads tests"
This reverts commit
86e472317c8fd9309b76c32ca55fcdeaf63f853b.
It breaks Debian buildbot, for some reason.
Krzysztof Drewniak [Wed, 6 Jul 2022 17:04:29 +0000 (17:04 +0000)]
[mlir][AMDGPU] Add --chipset option to AMDGPUToROCDL
Because the buffer descriptor structure (the V#) has no backwards-compatibility
guarentees, and since said guarantees have been violated in practice
(see https://github.com/llvm/llvm-project/issues/56323 ), and since
the `targetIsRDNA` attribute isn't something that higher-level clients can set
in general, make the lowering of the amdgpu dialect to rocdl take a --chipset
option.
Note that this option is a string because adding a parser for the Chipset
struct to llvm::cl wasn't working out.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D129228
KOLANICH [Thu, 7 Jul 2022 14:43:14 +0000 (22:43 +0800)]
[Driver] Improve linking options for target AVR
Move user specified inputs to the linking group in case
they and the stardard libraries have mutual reference.
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D127501
Michał Górny [Fri, 1 Jul 2022 14:46:56 +0000 (16:46 +0200)]
[lldb] [test] Improve stability of llgs vCont-threads tests
Perform a major refactoring of vCont-threads tests in order to attempt
to improve their stability and performance.
Split test_vCont_run_subset_of_threads() into smaller test cases,
and split the whole suite into two files: one for signal-related tests,
the running-subset-of tests.
Eliminate output_match checks entirely, as they are fragile to
fragmentation of output. Instead, for the initial thread list capture
raise an explicit SIGSTOP from inside the test program, and for
the remaining output let the test program run until exit, and check all
the captured output afterwards.
For resume tests, capture the LLDB's thread view before and after
starting new threads in order to determine the IDs corresponding
to subthreads rather than relying on program output for that.
Add a mutex for output to guarantee serialization. A barrier is used
to guarantee that all threads start before SIGSTOP, and an atomic bool
is used to delay prints from happening until after SIGSTOP.
Call std::this_thread::yield() to reduce the risk of one of the threads
not being run.
This fixes the test hangs on FreeBSD. Hopefully, it will also fix all
the flakiness on buildbots.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D129012
Nicolas Vasilache [Thu, 7 Jul 2022 14:08:22 +0000 (07:08 -0700)]
[mlir][Transform] Make applyToOne return a DiagnosedSilenceableFailure
This revision revisits the implementation of applyToOne and its handling
of recoverable errors as well as propagation of null handles.
The implementation is simplified to always require passing a vector<Operation*>
in which the results are returned, resulting in less template instantiation magic.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D129185
Eric Astor [Wed, 6 Jul 2022 16:31:50 +0000 (12:31 -0400)]
[ms] [llvm-ml] Add support for anonymous labels (`@@`, `@B`, `@F`)
ml.exe and ml64.exe support the use of anonymous labels, with @B and @F referring to the previous and next anonymous label respectively.
We add similar support to llvm-ml, with the exception that we are unable to emit an error message for an @F expression not followed by a @@ label.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D128944
Pavel Labath [Thu, 7 Jul 2022 14:14:48 +0000 (16:14 +0200)]
[lldb/test] Add a couple of libc++ std::string layouts
.. to the "string simulator" test. These layouts were used at some point in
the past few months, and are already supported by the code.
Denis Antrushin [Thu, 7 Jul 2022 07:18:06 +0000 (14:18 +0700)]
[IR][OpaquePointers] Properly print cmpxchg with pointer operands.
With opaque pointers address of pointer variable and its value have
same type (`ptr`). As a result, cmpxchg is printed without values
types in LLVM assembly and cannot be read back. Add AtomicCmpXchg
to the list of instructions which always have operand types printed.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D129276
Groverkss [Thu, 7 Jul 2022 13:51:52 +0000 (14:51 +0100)]
[MLIR][Presburger] Refactor division representation to DivisionRepr
This patch refactors existing implementations of division representation storage
into a new class, DivisionRepr. This refactoring is done so that the common
division utilities can be shared in an upcoming patch.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D129146
David Spickett [Thu, 7 Jul 2022 09:37:30 +0000 (09:37 +0000)]
[lldb][Windows] Fix memory region base addresses when a range is split
Previously we recorded AllocationBase as the base address of the region
we get from VirtualQueryEx. However, this is the base of the allocation,
which can later be split into more regions.
So you got stuff like:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c0000-0x00007fff37840000) r-x .text
[0x00007fff377c0000-0x00007fff37870000) r-- .rdata
Where all the base addresses were the same.
Instead, use BaseAddress as the base of the region. So we get:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c1000-0x00007fff37840000) r-x .text
[0x00007fff37840000-0x00007fff37870000) r-- .rdata
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_information
The added test checks for any overlapping regions which means
if we get the base or size wrong it'll fail. This logic
applies to any OS so the test isn't restricted to Windows.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D129272
Pavel Labath [Thu, 7 Jul 2022 13:04:41 +0000 (15:04 +0200)]
[lldb] Fixup TestLoadAfterAttach for 82ba3f4
After 82ba3f4, we (again) need to call lldb_enable_attach to be able to
attach to processes on linux. This was a new test, so it does not have
the necessary boilerplate.
Xiaodong Liu [Thu, 7 Jul 2022 12:57:23 +0000 (20:57 +0800)]
[ORC][MIPS} Correct template parameter for stubAndPointerRangesOk function on Mips
It might be an oversight that pass OrcAArch64 as template parameter to stubAndPointerRangesOk on MIps.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D129076
Haojian Wu [Thu, 7 Jul 2022 12:36:10 +0000 (14:36 +0200)]
[pseudo] NFC, fix the header guard for Language.h
Pavel Labath [Fri, 1 Jul 2022 12:32:50 +0000 (14:32 +0200)]
Recommit "[lldb/test] Don't use preexec_fn for launching inferiors"
This recommits
b15b1421, which reverted in was reverted in
f51c47d98 due to
failures on apple systems. The problem was that the patch introduced a race
where the debug server could start the attach process before the first process
(which isn't supposed to be attached to) was set up. This caused us to attach
to the wrong process.
The new version introduces additional synchronization to ensure that does not
happen.
Original commit message was:
As the documentation states, using this is not safe in multithreaded
programs, and I have traced it to a rare deadlock in some of the tests.
The reason this was introduced was to be able to attach to a program
from the very first instruction, where our usual mechanism of
synchronization -- waiting for a file to appear -- does not work.
However, this is only needed for a single test
(TestGdbRemoteAttachWait) so instead of doing this everywhere, I create
a bespoke solution for that single test. The solution basically
consists of outsourcing the preexec_fn code to a separate (and
single-threaded) shim process, which enables attaching and then executes
the real program.
This pattern could be generalized in case we needed to use it for other
tests, but I suspect that we will not be having many tests like this.
This effectively reverts commit
a997a1d7fbe229433fb458bb0035b32424ecf3bd.
Nicolai Hähnle [Tue, 5 Jul 2022 07:52:50 +0000 (09:52 +0200)]
Remove unnecessary includes of ManagedStatic.h
Differential Revision: https://reviews.llvm.org/D129115
Nicolai Hähnle [Mon, 4 Jul 2022 12:41:03 +0000 (14:41 +0200)]
llvm-c: Add LLVMDeleteInstruction to fix a test issue
Not deleting the loose instruction with metadata associated to it causes
an assertion when the LLVMContext is destroyed. This was previously
hidden by the fact that llvm-c-test does not call LLVMShutdown. The
planned removal of ManagedStatic exposed this issue.
Differential Revision: https://reviews.llvm.org/D129114
Tim Northover [Thu, 7 Jul 2022 12:25:24 +0000 (13:25 +0100)]
lld test fix: don't check the precise hex emitted as a comment.
It can vary depending on the platform, so as with the NO-FMA test just check
for "0x".
Tim Northover [Thu, 7 Jul 2022 12:01:02 +0000 (13:01 +0100)]
lld: fix test after x86 instruction comments now end in newline
Matthias Springer [Thu, 7 Jul 2022 11:35:36 +0000 (13:35 +0200)]
[mlir][bufferization][NFC] Move more unknown type conversion logic into BufferizationOptions
The `unknownTypeConversion` bufferization option (enum) is now a type converter function option. Some logic of `getMemRefType` is now handled by that function.
This change makes type conversion more controllable. Previously, there were only two options when generating memref types for non-bufferizable ops: Static identity layout or fully dynamic layout. With this change, users of One-Shot Bufferize can provide a function with custom logic.
Differential Revision: https://reviews.llvm.org/D129273
Tim Northover [Thu, 7 Jul 2022 11:03:47 +0000 (12:03 +0100)]
X86: add newline to end of FMA instruction comments.
The newline is used by Disassembler.cpp (`emitComments`) to work out how to
format them properly, and if there's no newline it goes into an infinite loop.
Unfortunately I couldn't get llvm-objdump to be affected, only the MacOS otool
utility which dlopens libLTO.
Michał Chojnowski [Thu, 7 Jul 2022 10:54:51 +0000 (13:54 +0300)]
[BOLT] Fix concurrent hash table modification in the instrumentation runtime
`__bolt_instr_data_dump()` does not lock the hash tables when iterating
over them, so the iteration can happen concurrently with a modification
done in another thread, when the table is in an inconsistent state. This
also has been observed in practice, when it caused a segmentation fault.
We fix this by locking hash tables during iteration. This is done by taking
the lock in `forEachElement()`.
The only other site of iteration, `resetCounters()`, has been correctly
locking the table even before this patch. This patch removes its `Lock`
because the lock is now taken in the inner `forEachElement()`.
Reviewed By: maksfb, yota9
Differential Revision: https://reviews.llvm.org/D129089
Alex Zinenko [Thu, 7 Jul 2022 11:11:34 +0000 (13:11 +0200)]
[mlir] Transform dialect: introduce merge_handles op
This Transform dialect op allows one to merge the lists of Payload IR
operations pointed to by several handles into a single list associated with one
handle. This is an important Transform dialect usability improvement for cases
where transformations may temporarily diverge for different groups of Payload
IR ops before converging back to the same script. Without this op, several
copies of the trailing transformations would have to be present in the
transformation script.
Depends On D129090
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D129110
Alex Zinenko [Thu, 7 Jul 2022 11:10:40 +0000 (13:10 +0200)]
[mlir] Structured transforms: introduce op splitting
Introduce a new transformation on structured ops that splits the iteration
space into two parts along the specified dimension. The index at which the
splitting happens may be static or dynamic. This transformation can be seen as
a rudimentary form of index-set splitting that only supports the splitting
along hyperplanes parallel to the iteration space hyperplanes, and is therefore
decomposable into per-dimension application.
It is a key low-level transformation that enables independent scheduling for
different parts of the iteration space of the same op, which hasn't been
possible previously. It may be used to implement, e.g., multi-sized tiling. In
future, peeling can be implemented as a combination of split-off amount
computation and splitting.
The transformation is conceptually close to tiling in its separation of the
iteration and data spaces, but cannot be currently implemented on top of
TilingInterface as the latter does not properly support `linalg.index`
offsetting.
Note that the transformation intentionally bypasses folding of
`tensor.extract_slice` operations when creating them as this folding was found
to prevent repeated splitting of the same operation because due to internal
assumptions about extract/insert_slice combination in dialect utilities.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D129090
Sven van Haastregt [Thu, 7 Jul 2022 11:05:24 +0000 (12:05 +0100)]
Fix use of uninitialized member in constructor
The constructor does `Saver(Alloc)`, so `Alloc` should be
initialized first. Move `Alloc` up in the declaration order.
Fixes a -Wuninitialized warning when building with GCC 12.1.
Reported-by: Mihail Atanassov <mihail.atanassov@arm.com>
Peter Waller [Tue, 5 Jul 2022 09:16:31 +0000 (09:16 +0000)]
[doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209
D127209 fixed LLVM to bring it in line with the AAPCS. The fix affects
functions where the first SVE parameter appears in the 9th or later
arguments, and the function does not return an SVE type.
Differential Revision: https://reviews.llvm.org/D129135
Markus Böck [Wed, 6 Jul 2022 15:39:18 +0000 (17:39 +0200)]
[mlir][ods] Replace redundant `Type` instances for interfaces
This patch makes use of TypeInterface implementing Type to remove instances of Type that simply checked whether a type implemented a given interface.
As part of this refactoring, some changes had to be done in the OpenMP Dialect files. In particular, they assumed that OpenMPOps.td to only ever include OpenMP TypeInterfaces, which did not hold anymore with a moved include in LLVMOpBase.td. For that reason, the type interface defintions were moved into a new file as is convention.
Differential Revision: https://reviews.llvm.org/D129210
Markus Böck [Wed, 6 Jul 2022 14:42:21 +0000 (16:42 +0200)]
[mlir][ods] Make Type- and AttrInterfaces also `Type`s and `Attr`s
By making TypeInterfaces and AttrInterfaces, Types and Attrs respectively it'd then be possible to use them anywhere where a Type or Attr may go. That is within the arguments and results of an Op definition, in a RewritePattern etc.
Prior to this change users had to separately define a Type or Attr, with a predicate to check whether a type or attribute implements a given interface. Such code will be redundant now.
Removing such occurrences in upstream dialects will be part of a separate patch.
As part of implementing this patch, slight refactoring had to be done. In particular, Interfaces cppClassName field was renamed to cppInterfaceName as it "clashed" with TypeConstraints cppClassName. In particular Interfaces cppClassName expected just the class name, without any namespaces, while TypeConstraints cppClassName expected a fully qualified class name.
Differential Revision: https://reviews.llvm.org/D129209
Bradley Smith [Wed, 29 Jun 2022 10:26:17 +0000 (10:26 +0000)]
[LegalizeTypes] Replace vecreduce_xor/or/and with vecreduce_add/umax/umin if not legal
This is done during type legalization since the target representation of
these nodes may not be valid until after type legalization, and after
type legalization the fact that these are dealing with i1 types may be
lost.
Differential Revision: https://reviews.llvm.org/D128996
Sander de Smalen [Thu, 7 Jul 2022 07:58:40 +0000 (07:58 +0000)]
[VectorCombine] Avoid creating shuffle for extract-extract pattern on scalable vector.
This addresses https://github.com/llvm/llvm-project/issues/56377
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D129136
Sander de Smalen [Thu, 7 Jul 2022 07:58:32 +0000 (07:58 +0000)]
[VectorCombine] NFC: rename test extract-cmp-binop.ll to extract-scalable.ll
Nikita Popov [Thu, 7 Jul 2022 08:31:53 +0000 (10:31 +0200)]
[GlobalsModRef] Don't override getModRefBehavior() for CallBase
BasicAA will already call getModRefBehavior() on the Function of
the CallBase if there are no operand bundles. This happens through
getBestAAResults(), i.e. it is a recursive call that will query
other AA providers, not just the BasicAA implementation.
As such, there is no need to reimplement the same functionality
in GlobalsModRef, a combination of BasicAA and GlobalsModRef already
handles it. This does mean that this no longer works under
-disable-basic-aa, but that's a testing only option.
Marek Kurdej [Mon, 4 Jul 2022 09:28:25 +0000 (11:28 +0200)]
[clang-format] Avoid crash in LevelIndentTracker.
Fixes https://github.com/llvm/llvm-project/issues/56352.
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D129064
Matthias Springer [Thu, 7 Jul 2022 07:01:50 +0000 (09:01 +0200)]
[mlir][vector][bufferize] Fix transfer_write dropping mask operand
Differential Revision: https://reviews.llvm.org/D129253
Sander de Smalen [Wed, 6 Jul 2022 16:14:51 +0000 (16:14 +0000)]
[AArch64][SME] Update load/store intrinsics to take predicate corresponding to element size.
Instead of using <vscale x 16 x i1> for all the loads/stores, we now use the appropriate
predicate type according to the element size, e.g.
ld1b uses <vscale x 16 x i1>
ld1w uses <vscale x 4 x i1>
ld1q uses <vscale x 1 x i1>
Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/D129083
Sander de Smalen [Wed, 6 Jul 2022 16:14:38 +0000 (16:14 +0000)]
[AArc64] Legalisation of compares and truncates of nxv1i1 types.
Truncates and compares require some changes to generic legalisation functions
to use ElementCount instead of getNumElements.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D129082
Nikita Popov [Thu, 7 Jul 2022 07:35:01 +0000 (09:35 +0200)]
[LSR] Regenerate test checks (NFC)
Adrian Kuegel [Thu, 7 Jul 2022 06:31:43 +0000 (08:31 +0200)]
[llvm][Debuginfod][Bazel] Match dependencies in CMakeLists.txt.
Also update llvm-config.h and llvm-config.h.cmake to match
484b1aa611caa70c8a80b46060cc340bbeee8306
Differential Revision: https://reviews.llvm.org/D129252
Nikita Popov [Wed, 6 Jul 2022 14:15:34 +0000 (16:15 +0200)]
[BasicBlockUtils] Allow splitting predecessors with callbr terminators
SplitBlockPredecessors currently asserts if one of the predecessor
terminators is a callbr. This limitation was originally necessary,
because just like with indirectbr, it was not possible to replace
successors of a callbr. However, this is no longer the case since
D67252. As the requirement nowadays is that callbr must reference
all blockaddrs directly in the call arguments, and these get
automatically updated when setSuccessor() is called, we no longer
need this limitation.
The only thing we need to do here is use replaceSuccessorWith()
instead of replaceUsesOfWith(), because only the former does the
necessary blockaddr updating magic.
I believe there's other similar limitations that can be removed,
e.g. related to critical edge splitting.
Differential Revision: https://reviews.llvm.org/D129205
Chuanqi Xu [Thu, 7 Jul 2022 06:57:07 +0000 (14:57 +0800)]
[NFC] [Coroutines] Update the comments for lowering coro.save
The original comment is not right. We don't store 0 all the time.
serge-sans-paille [Wed, 6 Jul 2022 14:34:44 +0000 (10:34 -0400)]
[clang-tidy] Fix confusable identifier interaction with unavailable class def
Fix #56404
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++[format][NFC] Removes dead code.
This removes a part of the now obsolete formater code.
The removal also removes the _v2 suffix where it's no longer needed.
Depends on D128785
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D128846
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++][format] Improve floating-point formatters.
This changes the implementation of the formatter. Instead of inheriting
from a specialized parser all formatters will use the same generic
parser. This reduces the binary size.
The new parser contains some additional fields only used in the chrono
formatting. Since this doesn't change the size of the parser the fields
are in the generic parser. The parser is designed to fit in 128-bit,
making it cheap to pass by value.
The new format function is a const member function. This isn't required
by the Standard yet, but it will be after LWG-3636 is accepted.
Additionally P2286 adds a formattable concept which requires the member
function to be const qualified in C++23. This paper is likely to be
accepted in the 2022 July plenary.
This is based on D125606. That commit did the groundwork and did similar
changes for the string formatters.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D128785
Chuanqi Xu [Thu, 7 Jul 2022 03:48:34 +0000 (11:48 +0800)]
[NFC] make ASTContext:isSame* methods const
Florian Hahn [Thu, 7 Jul 2022 05:05:32 +0000 (22:05 -0700)]
[AArch64] Clean up vselect-ext.ll test, add tests with ne/ep preds.
Vitaly Buka [Thu, 7 Jul 2022 04:16:43 +0000 (21:16 -0700)]
[NFC][sanitizer] Format dn_expand interceptor
Noah Shutty [Thu, 7 Jul 2022 04:13:30 +0000 (04:13 +0000)]
[Debuginfod] Try to fix clang-ppc64le-rhel build
Luo, Yuanke [Thu, 7 Jul 2022 03:42:39 +0000 (11:42 +0800)]
[AArch64][GlobalISel] update the gisel test case
Florian Hahn [Thu, 7 Jul 2022 03:38:37 +0000 (20:38 -0700)]
[VPlan] Move remove dead recipes before merging regions.
This can enable additional region merging, while not losing
opportunities as region merging does not produce dead recipes.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D128831
Chuanqi Xu [Fri, 10 Jun 2022 08:48:01 +0000 (16:48 +0800)]
[Debug] [Coroutines] Get rid of DW_ATE_address
Closing https://github.com/llvm/llvm-project/issues/55916
This patch tries to get rid of DW_ATE_address and enhance the test
coverage.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127625
Chuanqi Xu [Fri, 20 May 2022 07:30:16 +0000 (15:30 +0800)]
[Debug] [Coroutine] Adjust the scope and name for coroutine frame
Previously the scope of debug type of __coro_frame is limited in the
current function. It looked good at the first sight. But it prevent us
to print the type in splitted functions and other functions. Also the
debug type is different for different coroutine functions. So it makes
sense to rename the debug type to make it related to the function name.
After this patch, we could access the coroutine frame type in a function
by `function_name.coro_frame_ty`.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127623
Neumann Hon [Thu, 7 Jul 2022 02:22:25 +0000 (22:22 -0400)]
[SystemZ] [z/OS] Use assignCalleeSavedSpillSlots() to mark handle special registers in CSR list instead of determineCalleeSave
This PR moves the handling of special registers that need to be saved/restored in the prolog/epilog respectively from determineCalleeSaves to assignCalleeSavedSpillSlots. The documentation of the parent function of assignCalleeSavedSpillSlots explicitly allows the modification of the CSI hence adding the special registers (the stack pointer register, the return address register, and the entry point register) to the CSI list at that stage should be permissible.
This cleans up the code a bit and makes it so that we do not have to place registers that are not actually considered CSRs by the spec in the CSR list, which is something of a hack.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D125044
jacquesguan [Tue, 5 Jul 2022 07:54:32 +0000 (15:54 +0800)]
[mlir][Math] Support fold PowFOp with constant dense.
This patch adds a conditional binary constant folder which allow to exit when the constants not meet the fold condition. And use it for PowFOp to make it able to fold the constant dense.
Differential Revision: https://reviews.llvm.org/D129108
Alex Brachet [Thu, 7 Jul 2022 02:07:17 +0000 (02:07 +0000)]
[libc][NFC] Make explicit casts
Peter Klausler [Fri, 1 Jul 2022 20:05:58 +0000 (13:05 -0700)]
[flang][runtime] Trim FORMATs echoed to error messages
Since dynamic FORMAT strings usually come from blank-padded fixed-length
CHARACTER variables, trim leading and trailing blanks from them when they
are echoed to error messages for better readability.
Differential Revision: https://reviews.llvm.org/D129024
Peter Klausler [Fri, 1 Jul 2022 18:49:55 +0000 (11:49 -0700)]
[flang] Avoid spurious warnings in pedantic mode from FORMAT items
In free form source, pedantic mode will elicit portability warnings
about missing spaces when a token string ends with a character that
can be in an identifier and there is no space between that last token
character and a following character that can also be part of an identifier.
This behavior doesn't really work well for the token strings that are
parsed for edit descriptors in FORMAT statements. For example, the
'F' in FORMAT(F7.3) is followed by a digit, but obviously no space is
necessary. Free form or not, FORMATs are their own odd little world.
This patch adds trailing blanks to these FORMAT edit descriptor token
parsers to disable the missing space check, and extends the documentation
for token string parsing to explain why this technique works.
Differential Revision: https://reviews.llvm.org/D129023
Vitaly Buka [Thu, 7 Jul 2022 01:39:52 +0000 (18:39 -0700)]
[sanitizer] Fix dn_expand test
res is not the size of expanded string.
Peter Klausler [Thu, 30 Jun 2022 22:27:28 +0000 (15:27 -0700)]
[flang] Add IsElementalProcedure() predicate
Replace most tests of the explicit Attr::ELEMENTAL symbol flag with
a new predicate IsElementalProcedure() that works correctly for alternate
ENTRY points and does the right thing for procedure interfaces that
reference elemental intrinsic functions like SIN() whose elemental
nature does not propagate.
Differential Revision: https://reviews.llvm.org/D129022