Commit Graph

424226 Commits

Author SHA1 Message Date
LLVM GN Syncbot d8de7244f2 [gn build] Port 15c809e8e7 2022-05-18 18:05:17 +00:00
Mark de Wever 15c809e8e7 [libc++][format] Adds a formattable concept.
The concept is based on P2286R2 Formatting Ranges. It will be used to
optimise the storage of __format_arg_store as required by LWG-3473.

Depends on D120916

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D120921
2022-05-18 20:02:08 +02:00
Alex Brachet 6adbcd2b10 [libc] Add String to bsd headers 2022-05-18 18:01:02 +00:00
Alex Brachet fc2c8b2371 [libc] Add strlcpy
Differential Revision: https://reviews.llvm.org/D125806
2022-05-18 17:45:05 +00:00
Martin Storsjö 924defada9 [MC] [Win64EH] Don't produce packed ARM64 unwind info with homed parameters
There's an inconsistency regarding the epilogs of packed ARM64
unwind info with homed parameters; according to the documentation
(and according to common sense), the epilog wouldn't have a series
of nop instructions matching the stp x0-x7 in the prolog - however
in practice, RtlVirtualUnwind still seems to behave as if the epilog
does have the mirrored nops from the prolog.

In practice, MSVC doesn't seem to produce packed unwind info with
homed parameters, which might be why this inconsistency hasn't
been noticed.

Thus, to play it safe, avoid creating such packed unwind info with
homed parameters. (LLVM's current behaviour matches the current
runtime behaviour of RtlVirtualUnwind, but if it later is bug fixed
to match the documentation, such unwind information would be
incorrect.)

See https://github.com/llvm/llvm-project/issues/54879 for further
discussion on the matter.

Differential Revision: https://reviews.llvm.org/D125876
2022-05-18 20:34:59 +03:00
Martin Storsjö 091a55c16a [MC] [Win64EH] Remove an unused parameter to ARM64EmitUnwindCode. NFC.
Differential Revision: https://reviews.llvm.org/D125878
2022-05-18 20:33:17 +03:00
Martin Storsjö bedf657d0f [runtimes] Default LIB*_HERMETIC_STATIC_LIBRARY to ON on Windows
(In the case of libunwind, the cmake option is called
LIBUNWIND_HIDE_SYMBOLS, but it has the same effect as
LIBCXX_HERMETIC_STATIC_LIBRARY and
LIBCXXABI_HERMETIC_STATIC_LIBRARY.)

Previously, the same issue was dealt with by setting a project wide
define (_LIBUNWIND_HIDE_SYMBOLS,
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS and
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) if only building a static
library.  If building both static and shared at the same time, this
wasn't set, and the static library would contain dllexport directives.

The LIB*_HERMETIC_STATIC_LIBRARY and LIBUNWIND_HIDE_SYMBOLS cmake
options only apply the defines to the static library in the build,
even if building both static and shared at the same time.

(This could only be done use after the object libraries were
enabled, as a shared libcxx needs libcxxabi object files built
with dllexports included.)

This allows removing inelegant code for deciding how to build the
libcxxabi static library and a TODO comment that suggested that
users should need to start setting an option, which they shouldn't
need to. Finally, this gets rid of two XFAILs in tests.

Differential Revision: https://reviews.llvm.org/D125715
2022-05-18 20:31:51 +03:00
Craig Topper 86f7d7074a [RISCV] Use selectShiftMaskXLen ComplexPattern for isel of rotates.
This will remove masks on the shift amount. We usually get this with
SimplifyDemandedBits in DAGCombine, but that's restricted to cases
where the AND has a single use. selectShiftMaskXLen does not have
that restriction.
2022-05-18 10:23:29 -07:00
Craig Topper e2f410feea [RISCV] Add test cases showing failure to remove mask on rotate amounts.
If the masking AND has multiple users we fail to remove it.
2022-05-18 10:23:29 -07:00
Mogball 4957518ef5 [mlir][ods] Simplify useDefaultType/AttributePrinterParser
The current behaviour of `useDefaultTypePrinterParser` and `useDefaultAttributePrinterParser` is that they are set by default, but the dialect generator only generates the declarations for the parsing and printing hooks if it sees dialect types and attributes. Same goes for the definitions generated by the AttrOrTypeDef generator.

This can lead to confusing and undesirable behaviour if the dialect generator doesn't see the definitions of the attributes and types, for example, if they are sensibly separated into different files: `Dialect.td`, `Ops.td`, `Attributes.td`, and `Types.td`.

Now, these bits are unset by default. Setting them will always result in the dialect generator emitting the declarations for the parsing hooks. And if the AttrOrTypeDef generator sees it set, it will generate the default implementations.

Reviewed By: rriddle, stellaraccident

Differential Revision: https://reviews.llvm.org/D125809
2022-05-18 17:22:11 +00:00
Nico Weber 91a8caa831 [gn build] port 6694491aff
Needed to link llvm-debuginfod-find after eafa053041.
2022-05-18 13:16:50 -04:00
Jim Ingham bff4673b41 Add a darwin platform setting to specify which exceptions debugserver
should not receive as exceptions (some will get converted to BSD
signals instead).  This is really the only stable way to ensure that
a Mach exception gets converted to it's equivalent BSD signal.  For
programs that rely on BSD signal handlers, this has to happen or you
can't even get the program to invoke the signal handler when under
the debugger.

This builds on a previous solution to this problem which required you
start debugserver with the -U flag.  This was not very discoverable
and required lldb be the one to launch debugserver, which is not always
the case.

Differential Revision: https://reviews.llvm.org/D125434
2022-05-18 10:16:11 -07:00
Petr Hosek ececce1b5e Partially revert "[CMake] Passthrough OSX CMake options to builtins and runtimes"
This partially reverts commit 9cddfe3085,
specifically passthrough for CMAKE_OSX_* since this can lead to build
passing through internal variables when it's not intended.
2022-05-18 17:02:02 +00:00
Daniel Thornburgh eafa053041 [Debuginfod] Add --debug-file-directory to llvm-debuginfod-find.
This allows llvm-debuginfod-find to locate binaries in local build ID
directories configured via --debug-file-directory, the same flag used
for this purpose by llvm-symbolizer. This provides a consistent lookup
semantics between the two tools when configured the same way, in
particular when debug binaries may be located either locally or
remotely.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D125864
2022-05-18 16:56:57 +00:00
Aaron Ballman 47b8424a53 Correct the diagnostic behavior for unreachable _Generic associations in C++
New diagnostics were added for unreachable generic selection expression
associations in ca75ac5f04, but it did
not account for a difference in behavior between C and C++ regarding
lvalue to rvalue conversions. So we would issue diagnostics about a
selection being unreachable and then reach it. This corrects the
diagnostic behavior in that case.

Differential Revision: https://reviews.llvm.org/D125882
2022-05-18 12:45:38 -04:00
Fangrui Song 087ef34fff [ObjCopy][NFC] Remove unneeded zero initialization
getNewMemBuffer has called memset.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D125833
2022-05-18 09:42:31 -07:00
Nathan James 4739176fd3
[clang-tidy] Fix readability-simplify-boolean-expr crash with implicit cast in return.
Fixes https://github.com/llvm/llvm-project/issues/55557

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125877
2022-05-18 17:38:44 +01:00
Craig Topper 46eef76876 [DAGCombiner] Fix bug in MatchBSwapHWordLow.
This function tries to match (a >> 8) | (a << 8) as (bswap a) >> 16.

If the SRL isn't masked and the high bits aren't demanded, we still
need to ensure that bits 23:16 are zero. After the right shift they
will be in bits 15:8 which is where the important bits from the SHL
end up. It's only a bswap if the OR on bits 15:8 only takes the bits
from the SHL.

Fixes PR55484.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D125641
2022-05-18 09:23:18 -07:00
Mehdi Amini 302158df6a Apply clang-tidy fixes for llvm-else-after-return in OpenMPDialect.cpp (NFC) 2022-05-18 16:15:46 +00:00
Mehdi Amini e1ff449ec9 Apply clang-tidy fixes for performance-for-range-copy in LinalgOps.cpp (NFC) 2022-05-18 16:15:46 +00:00
Daniel Kiss c218fd3d7d [libunwind][AArch64] Add support for DWARF expression for RA_SIGN_STATE.
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] https://github.com/ARM-software/abi-aa/pull/129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
2022-05-18 17:56:16 +02:00
Bixia Zheng 69edacbcf0 [mlir][sparse] Add support for complex.im and complex.re to the sparse compiler.
Add a test.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D125834
2022-05-18 15:53:07 +00:00
LLVM GN Syncbot 66dfa36e7d [gn build] Port 29e556fc2b 2022-05-18 15:49:22 +00:00
David Spickett 29e556fc2b [lldb] Change implementation of memory read --show-tags option
This does 2 things:
* Moves it after the short options. Which makes sense given it's
  a niche, default off option.
  (if 2 files for one option seems a bit much, I am going to reuse
  them for "memory find" later)
* Fixes the use of repeated commands. For example:
    memory read buf --show-tags
    <shows tags>
    memory read
    <shows tags>

Added tests for the repetition and updated existing help tests.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D125089
2022-05-18 16:49:09 +01:00
LLVM GN Syncbot ca302f07b4 [gn build] Port 77533ea443 2022-05-18 15:43:23 +00:00
Florian Hahn a74e075908
[AArch64] Add tests showing reassoc breaks (s|u)ml(a|s)l selection. 2022-05-18 16:40:28 +01:00
Sam McCall 77533ea443 Revert "Reland(2) "[clangd] Indexing of standard library""
This reverts commit ca875539f7.
2022-05-18 17:38:45 +02:00
Nikita Popov e44fe27251 [LoopUnroll] Regenerate test checks (NFC) 2022-05-18 17:20:09 +02:00
Philip Reames 6381d4845b [tests] Add test coverage for issue causing revert f7988d0
As theorized, it does look like opnew is not getting inferred inaccessiblemmemonly.
2022-05-18 08:17:57 -07:00
Kito Cheng 1467e01f8f [RISCV][NFC] Rename variable in RISCVVEmitter.cpp
- Use `Overloaded` rather than `Mangled`.
- Use `Prototype` or `Desc` rather than `Seq`, it's not just a string sequence.
  - `Prototype` for those PrototypeDescriptor will used to evaluate as argument type.
  - `Desc` for those PrototypeDescriptor will used to evaluate as part of function name.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D125886
2022-05-18 23:14:29 +08:00
David Green fc0229fd6b [ARM] Clean up a test check from D125604. NFC
The Arm test had a incorrect check line with the wrong offset. From the
look of the code it should be -400*4 = 0xFFFFF9C0 = 4294965696
2022-05-18 16:12:08 +01:00
AndreyChurbanov c44ba01de7 [OpenMP] libomp: honor passive wait policy requested with tasking
Currently the library ignores requested wait policy in the presence
of tasking. Threads always actively spin. The patch fixes this problem
making the wait policy passive if this explicitly requested by user.

Differential Revision: https://reviews.llvm.org/D123044
2022-05-18 10:04:30 -05:00
Nico Weber d39928e2cc clang-cl: Move /Zc: tests from cl-options.c to cl-zc.cpp
Since we already have a dedicated file for testing the /Zc: flags,
let's be consistent about putting /Zc: tests there.

No behavior change.

Differential Revision: https://reviews.llvm.org/D125889
2022-05-18 11:01:10 -04:00
Philip Reames f7988d08a8 Revert "[BasicAA] Remove unneeded special case for malloc/calloc"
This reverts commit 9b1e00738c.

Nikic reported in commit thread that I had forgotten history here, and that a) we'd tried this before, and b) had to revert due to an unexpected codegen impact.  Current measurements confirm the same issue still exists.
2022-05-18 07:35:27 -07:00
Jonas Paulsson 4273e616e5 [SystemZ] Bugfix in SystemZTargetLowering::combineINT_TO_FP()
Make sure to also handle extended value types to avoid crashing.

Resulting integers greater than 64 bits are not optimized (i128 is not a
legal type), and vectorizing seems to result in libcalls instead of just
scalarization.

Other extended vector types like <10 x float> are however now handled and
should result in vectorized conversions.

Reviewed By: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D125881
2022-05-18 16:32:37 +02:00
NAKAMURA Takumi 6ca7eb2c6d [SCEV] Part 1, Serialize function calls in function arguments.
Evaluation odering in function call arguments is implementation-dependent.
In fact, gcc evaluates bottom-top and clang does top-bottom.

Fixes #55283 partially.

Part of https://reviews.llvm.org/D125627
2022-05-18 23:20:08 +09:00
Chris Bieneman 47258ffc5c [NFC] correcting a code comment. 2022-05-18 08:53:23 -05:00
LLVM GN Syncbot 0990d5b549 [gn build] Port ca875539f7 2022-05-18 13:39:15 +00:00
Thomas Preud'homme 8c975eac34 Assert on polymorphic pointer intrinsic param
Opaque pointers cannot be polymorphic on the pointed type given their
lack thereof. However they are currently accepted by tablegen but the
intrinsic signature verifier trips when verifying any further
polymorphic type because the opaque pointer codepath for pointers will
not push the pointed type in ArgTys.

This commit adds an assert to easily catch such cases instead of having
the generic signature match failure.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D125764
2022-05-18 14:35:49 +01:00
Nikita Popov 8e4c5d9902 [CGP] Regenerate test checks (NFC) 2022-05-18 15:35:21 +02:00
Sam McCall 1236b66a98 [lit] pass LLVM_SYMBOLIZER_PATH through to tests.
Currently several buildbots give unsymbolized traces on crash.
I suspect these are configuring the symbolizer in this way and regressed in
D122251 or thereabouts.

Trying this coupled with a reland of patch that failed on a couple of bots with
no useful stacktrace...
2022-05-18 15:30:37 +02:00
Sam McCall ca875539f7 Reland(2) "[clangd] Indexing of standard library"
This reverts commit 6aabf60f2f.
2022-05-18 15:30:37 +02:00
Sanjay Patel 990cc49ca0 [InstCombine] avoid crash on fold of icmp with cast operand
We could do better by inserting a bitcast from scalar int
to vector int or using an insertelement (the alternate test
does not crash because there's an independent fold like that).

But this doesn't seem like a likely pattern, so just bail out
for now.

Fixes issue #55516.
2022-05-18 09:16:30 -04:00
Sanjay Patel be6d7cc93c [InstCombine] reduce code duplication for checking types; NFC 2022-05-18 09:16:30 -04:00
David Spickett 00a1258593 [lldb][AArch64] Fix corefile memory reads when there are non-address bits
Previously if you read a code/data mask before there was a valid thread
you would get the top byte mask. This meant the value was "valid" as in,
don't read it again.

When using a corefile we ask for the data mask very early on and this
meant that later once you did have a thread it wouldn't read the
register to get the rest of the mask.

This fixes that and adds a corefile test generated from the same program
as in my previous change on this theme.

Depends on D118794

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D122411
2022-05-18 14:13:42 +01:00
Nikita Popov 128da94d38 [InstCombine] Remove disable-verify tests (NFC)
InstCombine is not required to do anything sensible if it receives
invalid IR.

These tests seem to be testing self-referential instructions that
may occur in unreachable code -- but InstCombine actually goes out
of the way to remove such instructions ahead of time so it doesn't
need to deal with them.
2022-05-18 14:48:48 +02:00
Dmitry Preobrazhensky 32ca9bd7b5 [AMDGPU][MC][GFX940] Correct tied operand decoding for smfmac opcodes
Differential Revision: https://reviews.llvm.org/D125790
2022-05-18 15:39:30 +03:00
Jonathan Wakely 46d9a6ebd6 [libcxx] [test] Include header for strverscmp
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122570
2022-05-18 14:36:23 +02:00
Jonathan Wakely 89cacb9ee7 [libcxx] [test] Add missing header for std::numeric_limits
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122571
2022-05-18 14:36:02 +02:00
Simon Pilgrim 4e198377f6 [X86] addcarry.ll - add nounwind to prevent cfi noise on tests 2022-05-18 13:30:43 +01:00