Commit Graph

416698 Commits

Author SHA1 Message Date
Momchil Velikov 32e8b550e5 [AArch64] Async unwind - function prologues
This patch rearranges emission of CFI instructions, so the resulting
DWARF and `.eh_frame` information is precise at every instruction.

The current state is that the unwind info is emitted only after the
function prologue. This is fine for synchronous (e.g. C++) exceptions,
but the information is generally incorrect when the program counter is
at an instruction in the prologue or the epilogue, for example:

```
stp	x29, x30, [sp, #-16]!           // 16-byte Folded Spill
mov	x29, sp
.cfi_def_cfa w29, 16
...
```

after the `stp` is executed the (initial) rule for the CFA still says
the CFA is in the `sp`, even though it's already offset by 16 bytes

A correct unwind info could look like:
```
stp	x29, x30, [sp, #-16]!           // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov	x29, sp
.cfi_def_cfa w29, 16
...
```

Having this information precise up to an instruction is useful for
sampling profilers that would like to get a stack backtrace. The end
goal (towards this patch is just a step) is to have fully working
`-fasynchronous-unwind-tables`.

Reviewed By: danielkiss, MaskRay

Differential Revision: https://reviews.llvm.org/D111411
2022-02-28 13:37:57 +00:00
Adrian Kuegel a91ade0ba6 [mlir] Apply ClangTidy performance fixes (NFC) 2022-02-28 13:18:10 +01:00
Sander de Smalen 201e3686ab [AArch64][SVE] Handle more cases in findMoreOptimalIndexType.
This patch addresses @paulwalker-arm's comment on D117900 to
only update/write the by-ref operands iff the function returns
true. It also handles a few more cases where a series of added
offsets can be folded into the base pointer, rather than just looking
at a single offset.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D119728
2022-02-28 12:13:52 +00:00
David Spickett ee95fe5caa [compiler-rt] Disable coverage trace pc guard tests on Thumb
These are failing on our silent bot:
https://lab.llvm.org/staging/#/builders/162/builds/358

$ <run cmd>
main
foo
bar
baz
SanitizerCoverage: ./sanitizer_coverage_trace_pc_guard-dso.cpp.tmp.2122517.sancov: 2 PCs written
SanitizerCoverage: ./sanitizer_coverage_trace_pc_guard-dso.cpp.tmp_2.so.2122517.sancov: 1 PCs written
SanitizerCoverage: ./sanitizer_coverage_trace_pc_guard-dso.cpp.tmp_1.so.2122517.sancov: 1 PCs written
$ <sancov cmd>
ERROR: Coverage points in binary and .sancov file do not match.

Also reproduces if you build for Thumb on v8 hardware.

Doesn't fail when built with Arm only code so I guess the Thumb mode bit
in the PCs might be the issue.
2022-02-28 11:56:07 +00:00
gysit 11d144c576 [mlir][linalg] Check the iterator types are valid.
Improve the LinalgOp verification to ensure the iterator types is known. Previously, unknown iterator types have been ignored without warning, which can lead to confusing bugs.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D120649
2022-02-28 11:25:40 +00:00
Florian Hahn cbaac14734
[LV] Remove induction recipes only used outside vector loop.
Exit values of vector inductions are generated completely independent of
the induction recipes. Consider them for removal, if they are not used
in loop.

This fixes a crash exposed by 49b23f451c.
2022-02-28 11:14:22 +00:00
David Green 61b616755a Partially revert "[SchedModels][CortexA55] Add ASIMD integer instructions"
The Cortex-A55 scheduling model is used for -mcpu=generic, meaning it
can have a wider effect than just the A55. The changes to the A55
scheduling model seems to have caused performance regressions on
Cortex-A510 device which have latencies closer to the original and
different forwarding paths.

This partially reverts the changes from D117003, at least until we can
do something to improve Cortex-A510. According to my results, this
improves the A510 results without altering the A55 very much.
2022-02-28 10:58:52 +00:00
Luis Penagos 24d4f601aa [clang-format] Treat && followed by noexcept operator as a binary operator inside template arguments
Fixes https://github.com/llvm/llvm-project/issues/44544.

Reviewed By: curdeius, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D120445
2022-02-28 11:55:04 +01:00
Adrian Kuegel 44adca60d4 [mlir] Remove unused static variables (NFC) 2022-02-28 11:52:39 +01:00
Florian Hahn 8bbc5e172a
[LV] Add test with dead induction in vector loop used outside.
Add test with a induction phi that is not used in the vector loop, but
by an lcssa phi in the loop exit.
2022-02-28 10:39:08 +00:00
Endre Fülöp 34a7387986 [analyzer] Add more sources to Taint analysis
Add more functions as taint sources to GenericTaintChecker.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D120236
2022-02-28 11:33:02 +01:00
LLVM GN Syncbot a44c984d94 [gn build] Port 61835d19a8 2022-02-28 10:06:58 +00:00
Nikita Popov 5423b0a525 [InstCombine] Remove not of SPF min/max fold (NFCI)
This should no longer be necessary now that we canonicalize to
intrinsics. Might not be strictly NFC due to worklist order.
2022-02-28 11:02:31 +01:00
esmeyi 61835d19a8 [llvm-objcopy] Initial XCOFF32 support.
Summary: This is an initial implementation of lvm-objcopy for XCOFF32.
Currently only supports simple copying, op-passthrough to follow.

Reviewed By: jhenderson, shchenz

Differential Revision: https://reviews.llvm.org/D97656
2022-02-28 04:59:46 -05:00
Nikita Popov d5ea3b2f33 [InstCombine] Remove sub of SPF min/max fold (NFCI)
This isn't necessary anymore, now that we canonicalize SPF min/max
to intrinsics. Might not be strictly NFC due to worklist order
changes.
2022-02-28 10:57:24 +01:00
Florian Hahn ad2cad1c52
[LV] Add test with IV that needs scalar steps and user outside of loop.
Also add a run line to check interleaving only. This test covers the PPC
buildbot failures caused by 49b23f451c.
2022-02-28 09:46:18 +00:00
Nikita Popov 9353ed6a53 [InstCombine] Don't call matchSAddSubSat() for SPF (NFC)
Only call it for intrinsic min/max. The moved implementation is
unchanged apart from the one-use check: It is now hardcoded to
one-use, without the two-use special case for SPF.
2022-02-28 10:41:56 +01:00
Nikita Popov 53602e4c70 [InstCombine] Remove SPF moveAddAfterMinMax() (NFC)
As SPF min/max is canonicalized to intrinsics before this point,
this change should be entirely NFC.
2022-02-28 10:28:16 +01:00
Nikita Popov ee62dcdb34 [InstCombine] Remove SPF moveNotAfterMinMax() (NFC)
This happens after SPF -> intrinsic canonicalization, and as such
should be entirely NFC.
2022-02-28 10:23:07 +01:00
Nikita Popov 0bc3e233d7 [InstCombine] Remove SPF factorizeMinMaxTree() (NFC)
SPF integer min/max is canonicalized to min/max intrinsics before
this code is reached, so this should be entirely NFC.
2022-02-28 10:22:05 +01:00
Mehdi Amini 47ddf382e6 Add explicit `this->` to access method in attempt to fix gcc5 build (NFC) 2022-02-28 08:54:38 +00:00
Shraiysh Vaishay 77296dc5e9 [mlir][OpenMP][NFC] Removing unnecessary builders for wsloop
This patch removes the builders for `omp.wsloop` operation that aren't
specifically needed anywhere. We can add them later if the need arises.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D120533
2022-02-28 14:22:43 +05:30
Iain Sandoe b3fcfcb946 [C++20][Modules][7/8] Find the primary interface name for a module.
When we are building modules, there are cases where the only way to determine
validity of access is by comparing primary interface names.  This is because we need
to be able to associate a primary interface name with an imported partition, but
before the primary interface module is complete - so that textual comparison is
necessary.

If this turns out to be needed many times, we could cache the result, but it seems
unlikely to be significant (at this time); cases with very many imported partitions
would seem unusual.

Differential Revision: https://reviews.llvm.org/D118598
2022-02-28 08:50:25 +00:00
Fangrui Song 8d01ac75e7 [ELF] Replace an unneeded dyn_cast_or_null with dyn_cast. NFC 2022-02-28 00:50:06 -08:00
Fangrui Song fee78961f5 [ELF] Optimize SectionBase::Kind values to make isa<InputSection> more efficient. NFC
Surprisingly my lld executable is 1.5KiB smaller.
2022-02-28 00:24:25 -08:00
Fangrui Song bb3eeac773 [ELF] Make InputSection::classof inline. NFC 2022-02-28 00:16:45 -08:00
Alexander Belyaev 1a829d2d06 [mlir] Purge linalg.tiled_loop.
Differential Revision: https://reviews.llvm.org/D119415
2022-02-28 09:05:18 +01:00
Fangrui Song 4976d1fe58 [ELF] Move SyntheticSection check from InputSection::writeTo to OutputSection::writeTo. NFC
Simplify code and make the heavyweight operation to the call site so that it is
clearer how to improve the inefficient scheduling in the future.
2022-02-27 23:28:52 -08:00
Ilya Nozhkin fd37d489cf Set error message if ValueObjectRegister fails to write back to register
SetValueFromCString and SetData methods return false if register can't
be written but they don't set a error message. It sometimes confuses
callers of these methods because they try to get the error message in case of
failure but Status::AsCString returns nullptr.

For example, lldb-vscode crashes due to this bug if some register can't
be written. It invokes SBError::GetCString in case of error and doesn't
check whether the result is nullptr (see request_setVariable implementation in
lldb-vscode.cpp for more info).

Reviewed By: labath, clayborg

Differential Revision: https://reviews.llvm.org/D120319
2022-02-28 14:29:29 +08:00
eric.tang b496a172e4 [RISCV] Support hypervisor extention instructions
According to privileged spec version-20211203

    Add the following hypervisor instructions:
        - HLV.B HLV.BU
        - HLV.H HLV.HU HLVX.HU
        - HLV.W HLV.WU HLVX.WU
        - HLV.D
        - HSV.B HSV.H HSV.W HSV.D

Signed-off-by: eric.tang <eric.tang@starfivetech.com>

Differential Revision: https://reviews.llvm.org/D117733
2022-02-28 14:02:43 +08:00
eric.tang 386c5be92a [RISCV] Support Sinval extension and hypervisor memory management fence instructions
According to Privileged spec version-20211203

    Add Supervisor Memory-Management Instructions:
        - SINVAL.VMA, SFENCE.W.INVAL, SFENCE.INVAL.IR
    Add Hypervisor Memory-Management Instructions:
        - HFENCE.VVMA, HFENCE.GVMA, HINVAL.VVMA, HINVAL.GVMA

Signed-off-by: eric.tang <eric.tang@starfivetech.com>

Differential Revision: https://reviews.llvm.org/D117654
2022-02-28 14:02:43 +08:00
Eric Tang cf80ef1393 [RISCV] Change GPRMemAtomic to GPRMemZeroOffset for general usage
Not only some AMO instructions but also other instructions need to
    process (${gpr}) or 0(${gpr}), where the 0 is be silently ignored.

    This patch does some changes for general usage.

Signed-off-by: Eric Tang <eric.tang@starfivetech.com>

Differential Revision: https://reviews.llvm.org/D120017
2022-02-28 14:02:43 +08:00
Zi Xuan Wu f467aa1b64 [Support] Fix the build errors because missing CSKYTargetParser.def in module.modulemap of 21bce9007a
Add textual header "Support/CSKYTargetParser.def" in module.modulemap.

Build Failure: https://green.lab.llvm.org/green/job/lldb-cmake/41771
2022-02-28 13:47:55 +08:00
Zi Xuan Wu 21bce9007a [Support] Add CSKY target parser and attributes parser
Construct LLVM Support module about CSKY target parser and attribute parser.
It refers CSKY ABIv2 and implementation of GNU binutils and GCC.

https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf

Now we only support CSKY 800 series cpus and newer cpus in the future undering CSKYv2 ABI specification.
There are 11 archs including ck801, ck802, ck803, ck803s, ck804, ck805, ck807, ck810, ck810v, ck860, ck860v.

Every arch has base extensions, the cpus of that arch family have more extended extensions than base extensions.
We need specify extended extensions for every cpu. Every extension has its enum value, name and related llvm feature string with +/-.
Every enum value represents a bit of uint64_t integer.

Differential Revision: https://reviews.llvm.org/D119917
2022-02-28 11:35:07 +08:00
Chenbing Zheng 7f811ce127 [RISCV] Optimize (sext.w, srli) to sraiw with Zba.
In this patch, we add a more narrower exclusion for
zeroext (srl x) -> srli (slli x), so that it provides an opportunity
for the selection of sraiw.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D120467
2022-02-28 10:34:35 +08:00
Kai Luo eb3730cf89 [AIX][cmake][NFC] Customize name of output atomic library
Let `archive-aix-libatomic` accept additional argument to customize name of output atomic library.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D120534
2022-02-28 02:31:56 +00:00
Todd Mortimer bcbb03754e [Driver][OpenBSD] Enable unwind tables on all architectures 2022-02-27 19:43:49 -05:00
Mehdi Amini fdfe26ddbe Add explicit capture for `this` pointer in attempt to fix gcc5 build (NFC) 2022-02-27 21:41:23 +00:00
Fangrui Song d07ff99591 [ELF] Enforce double-dash form --error-limit
It's ld.lld specific and by convention we enforce the double-dash form to avoid
collision with the short option -e (--entry).
2022-02-27 20:49:36 +00:00
Jessica Clarke 6aa8521fdb [RISCV] Fix parseBareSymbol to not double-parse top-level operators
By failing to lex the token we end up both parsing it as a binary
operator ourselves and parsing it as a unary operator when calling
parseExpression on the RHS. For plus this is harmless but for minus this
parses "foo - 4" as "foo - -4", effectively treating a top-level minus
as a plus.

Fixes https://github.com/llvm/llvm-project/issues/54105

Reviewed By: asb, MaskRay

Differential Revision: https://reviews.llvm.org/D120635
2022-02-27 20:48:52 +00:00
Fangrui Song 87e6251d66 [ELF] Use --error-limit instead of -error-limit 2022-02-27 20:47:37 +00:00
Fangrui Song d14d8664e3 [ELF] Change global variable backwardReferences to a LinkerDriver member variable. NFC
Similar to whyExtract.
2022-02-27 20:33:28 +00:00
Fangrui Song 7fd3849b35 [ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report
So that early errors don't suppress their output.
2022-02-27 20:23:09 +00:00
Martin Storsjö acf20001a0 [libcxx] [test] Fix one failing part of dsl.sh.py on Windows.
Windows UCRT has got a bug in older versions (present in CI), where
it successfully does set a locale named
`for_sure_this_is_not_an_existing_locale`. By adjusting the tested
locale name to `forsurethisisnotanexistinglocale`, that test works
as expected, failing to set the locale.

The bug is reported upstream at
https://developercommunity.visualstudio.com/t/setlocale-succeeds-for-bogus-locale-names-in-older/1652241,
but as it already is working correctly in newer versions, no action
was prompted there.

We could of course add a bug detection in features.py like other
existing `broken-*` features, but that would seem kinda
pointless as it would be doing exactly what this test does.
Instead just adjust the tested dummy locale name.

This bit was approved to be committed on its own, in
https://reviews.llvm.org/D120546 (which is left open to follow up on
review of the rest of that patch).
2022-02-27 22:06:18 +02:00
Martin Storsjö f1d0d6f70c [libcxx] [test] Fix the monetary locale pos/neg_format test for Windows and macOS
The zh_CN.UTF-8 locale on Glibc has got `n_sign_posn == 4` (which means
having the negative sign just after the currency symbol), but has
`int_n_sign_posn == 1` (which means before the string).

On Windows, there's no separate `int_n_sign_posn` field, so the same
`n_sign_posn` (which is 4 there too) is used for international currency
formatting too. This makes the ordering for the international case on
Windows be the same as for the national one right above it.

On Apple platforms, the fr_FR.UTF-8 locale has got `n_sign_posn == 2`
but `p_sign_posn == 1`, giving a different order for the French locale
for the negative format.

On Apple platforms for the zh_CN.UTF-8 locale, both `n_sign_posn` and
`int_n_sign_posn` are 4, but `p_sign_posn` and `int_p_sign_posn` are 1.

Differential Revision: https://reviews.llvm.org/D120550
2022-02-27 21:49:14 +02:00
Xiaodong Liu f6cb59d35f [sancov] Add SPARC support for getPreviousInstructionPc
The SPARC and MIPS branching operations have a branch delay slot, 4 more bytes occupied.

Depends on D120381

Reviewed By: ro, MaskRay

Differential Revision: https://reviews.llvm.org/D120451
2022-02-27 19:10:51 +00:00
Philip Reames 319265328c [SLP] Remove field unused after 33ce97f to silence buildbots [NFC] 2022-02-27 10:18:10 -08:00
Florian Hahn ff93260bf6
Revert "[VPlan] Introduce recipe to build scalar steps."
This reverts commit 49b23f451c.

This appears to break some PPC build bots. Revert while I investigate.
2022-02-27 17:51:19 +00:00
Philip Reames 33ce97f413 [SLP] Use BatchAA to reduce capture analysis cost [NFC]
SLP makes very heavy use of aliasing queries to construct pointer dependencies for scheduling purposes.  AA internally usings pointerMayBeCaptured to prove some noalias results.  In a local profile, we were spending about 4% of total O2 time in capture tracking.  By using BatchAA interface - which caches capture results - this drops to 2%.

Note that there is no invalidation of BatchAA here.  This assumes that no transformation done by SLP invalidates alias or capture results.  This is the same assumption made by the existing AliasCache, so this is not a new assumption in the code.
2022-02-27 09:47:24 -08:00
Florian Hahn 49b23f451c
[VPlan] Introduce recipe to build scalar steps.
This patch adds a new VPScalarIVStepsRecipe to handle building scalar
steps.

In the first patch, it only handles the case where there is no vector
induction variable needed.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D115953
2022-02-27 17:32:41 +00:00