Commit Graph

432706 Commits

Author SHA1 Message Date
Siva Chandra Reddy 57afb48057 [libc][Obvious] Fix thrd_join's first arg.
First argument to thrd_join was incorrectly listed as a pointer
to a thrd_t value. It should instead be a thrd_t value argument.
2022-08-11 19:18:11 +00:00
Arnold Schwaighofer 6ef223c041 [coro async] Mark async suspend function and its resume function pointer intrinsic as nomerge
Coroutine splitting is not possible if the one-to-one mapping between the two is
lost. Every suspend point must have a matching continuation function
pointer.

rdar://98404664

Differential Revision: https://reviews.llvm.org/D131684
2022-08-11 11:43:30 -07:00
Valentin Clement bdbf89b906
[flang][openacc] Propagate correct location information from directive
Location information was not correctly propagated when creating OpenACC
operations. This patch propagate the correct location information from
the parse tree nodes to OpenACC MLIR operations.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D131659
2022-08-11 20:35:48 +02:00
Denys Petrov adcd4b1c0b [analyzer] [NFC] Fix comments into more regular form. 2022-08-11 21:28:23 +03:00
Nikolas Klauser 499fca3cfc [libc++][NFC] Replace macros in vector
Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D130848
2022-08-11 20:22:58 +02:00
Vir Narula 625877b0ef
[Matrix] Add tests dot product with varied strides
Add more tests with varied strides. Changes to lowering upcoming in https://reviews.llvm.org/D131125

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D131444
2022-08-11 19:09:21 +01:00
Fangrui Song c2d293ea25 Compiler.h: remove unused LLVM_NODISCARD
Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D131695
2022-08-11 11:06:24 -07:00
Walter Erquinigo c4fb631cee [NFC][lldb][trace] Fix formatting of tracing files
Pavel Labath taught me that clang-format sorts headers automatically
using llvm's rules, and it's better not to have spaces between

So in this diff I'm removing those spaces and formatting them as well.

I used `clang-format -i` to format these files.
2022-08-11 11:00:26 -07:00
Alex Bradbury d17de5479c [clang][RISCV][test] Add test that shows incorrect ABI lowering
As reported in <https://github.com/llvm/llvm-project/issues/57084>,
under hard float ABIs there are issues with lowering structs that
inherit from other structs.

See <https://reviews.llvm.org/D131677> for a fix.
2022-08-11 18:51:37 +01:00
Aaron Ballman b48fb85fe6 Fix crash-on-valid with consteval temporary construction through list initialization
Clang currently crashes when lowering a consteval list initialization
of a temporary. This is partially working around an issue in the
template instantiation code (TreeTransform::TransformCXXTemporaryObjectExpr())
that does not yet know how to handle list initialization of temporaries
in all cases. However, it's also helping reduce fragility by ensuring
we always have a valid QualType when trying to emit a constant
expression during IR generation.

Fixes #55871

Differential Revision: https://reviews.llvm.org/D131194
2022-08-11 13:44:24 -04:00
Fangrui Song 57f334d817 [Support] Remove Log2 workaround for Android API level < 18
The function added by D9467 is unneeded.
https://github.com/android/ndk/wiki/Changelog-r24 shows that the NDK has
moved forward to at least a minimum target API of 19.

Reviewed By: srhines

Differential Revision: https://reviews.llvm.org/D131656
2022-08-11 17:39:41 +00:00
Fangrui Song 1ca5fee228 [Support] Remove some #if __cplusplus > 201402L 2022-08-11 17:35:02 +00:00
Brett Wilson 99baa10f8f [clang-doc] Read docstrings for record members
Struct/class data members did not have the comments associated with
them. This adds that information to the MemberTypeInfo class and emits
it in the YAML. This does not update the frontends yet.

Reviewed By: paulkirth

Differential Revision: https://reviews.llvm.org/D131298
2022-08-11 17:14:15 +00:00
Craig Topper dacbddf562 [RISCV] Move isValidCPUName to RISCVTargetInfo. NFC
Instead of having separate implementations for RV32 and RV64,
use the triple to control the Is64Bit parameter.

Do the same for isValidTuneCPUName, fillValidCPUList, and
fillValidTuneCPUList.
2022-08-11 10:01:56 -07:00
Marc Auberer 84b7055afc [Docs] Fix duplicate enum item name
Removes duplicated names as recommended here: https://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D131193
2022-08-11 09:59:08 -07:00
Vitaly Buka 4248f32b9e [NFC][sanitizer] Use __builtin_extract_return_addr on all platforms
On most platforms it does nothing, so this eliminates a need for one #if.
2022-08-11 09:48:29 -07:00
Vitaly Buka e41c5aaebe [NFC][sanitizer] Add () into a few macros 2022-08-11 09:48:28 -07:00
Simon Pilgrim 6ba5fc2dee [X86] lowerShuffleWithVPMOV - support direct lowering to VPMOV on VLX targets
lowerShuffleWithVPMOV currently only matches shuffle(truncate(x)) patterns, but on VLX targets the truncate isn't usually necessary to make the VPMOV node worthwhile (as we're only targetting v16i8/v8i16 shuffles we're almost always ending up with a PSHUFB node instead). PACKSS/PACKUS are still preferred vs VPMOV due to their lower uop count.

Fixes the remaining regression from the fixes in rG293899c64b75
2022-08-11 17:40:07 +01:00
Mike Rice dd4c838da3 [OpenMP] Allow data members in interop init/use/destroy clauses
Previously a diagnostic was given if the expression was not strictly a
DeclRef. Now also allow use of data members inside member functions.

Differential Revision: https://reviews.llvm.org/D131222
2022-08-11 09:39:12 -07:00
Augusto Noronha c6c5944d05 [lldb] Allow DataFileCache to be constructed with a different policy
Differential Revision: https://reviews.llvm.org/D131531
2022-08-11 09:28:30 -07:00
Simon Pilgrim d4a4864c45 [X86] vector-rotate-128/265.ll - add VLX + NOVLX check prefixes to reduce CHECK duplication 2022-08-11 17:11:37 +01:00
Kevin P. Neal de64d0076e [FPEnv][InstSimplify] Fix formatting error.
My most recent change for D131607 had a formatting error that I didn't
notice until after I committed it. Let me fix it now so changes to this
file will be back-to-back from me.
2022-08-11 12:10:05 -04:00
Sanjay Patel fa68d93d54 [InstCombine] fold reassociative fadd with negated operand
We manage to iteratively achieve this result with no extra
uses, and the reassociate pass can also do this, but this
pattern falls through the cracks in the example from
issue #57053.
2022-08-11 11:43:36 -04:00
Sanjay Patel 5683801c56 [InstCombine] add tests for reassociative fadd with negated op; NFC
Extra uses inhibit more basic folds, so we miss the larger fold.
2022-08-11 11:43:36 -04:00
Uday Bondhugula 0e54d9dfdc [MLIR] Fix hasNoInterveningEffect in the presence of ops from different affine scopes
Fix hasNoInterveningEffect in the presence of ops from different affine
scopes. Also, correctly check for dependence failures as well instead of
just for the existence of a dependence.

Differential Revision: https://reviews.llvm.org/D131641
2022-08-11 21:07:24 +05:30
Kevin P. Neal 7bdb010d7c [FPEnv][InstSimplify] 0.0 - -X ==> X
Another ticket split out of D107285, this extends the optimization
of 0.0 - -X to just X when using constrained intrinsics and the
optimization is allowed.

If the negation of X is done with fsub then the match fails because of
the lack of IR Matcher support for constrained intrinsics.

While I'm here, remove some TODO notices since the work is no longer
planned.

Differential Revision: https://reviews.llvm.org/D131607
2022-08-11 11:35:33 -04:00
Simon Pilgrim 08a880509e [X86] Add RDPRU instruction CPUID bit masks
As mentioned on D128934 - we weren't including the CPUID bit handling for the RDPRU instruction

AMD's APMv3 (24594) lists it as CPUID Fn8000_0008_EBX Bit#4
2022-08-11 16:07:36 +01:00
Joe Nash b92161f927 [AMDGPU] Autogenerate spill-vector-superclass. NFC
This test is already a subset of the autogenerated test lines, so truly
auto-generate it to make it easier to update.
2022-08-11 10:34:10 -04:00
Johannes Doerfert a8cda32909 [OpenMP][FIX] Ensure __kmpc_kernel_parallel is reachable
The problem is we create the call to __kmpc_kernel_parallel in the
openmp-opt pass but while we optimize the code, the call is not there
yet. Thus, we assume we never reach it from __kmpc_target_deinit. That
allows us to remove the store in there (`ParallelRegionFn = nullptr`),
which leads to bad results later on.

This is a shortstop solution until we come up with something better.

Fixes https://github.com/llvm/llvm-project/issues/57064
2022-08-11 09:55:56 -05:00
Simon Pilgrim 6e19e6ce36 [clang][X86] Add RDPRU predefined macro tests for znver2/znver3 targets
These were missed in D128934
2022-08-11 15:48:39 +01:00
Peter Waller 898699831b [DAGCombine] Check zext legality in zext-extract-extend combine
Discussed in D131503.

Fix to D130782.
2022-08-11 14:30:42 +00:00
Eric Astor 94fae7a581 [ms] [llvm-ml] Add support for nested PROC/ENDP pairs
This is believed to match behavior by ML.EXE and ML64.EXE.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D131522
2022-08-11 14:19:02 +00:00
Dmitry Preobrazhensky 4e68834add [AMDGPU][MC][GFX11][NFC] Add tests for VOP1 and VOP2 16 bit opcodes
Differential Revision: https://reviews.llvm.org/D131588
2022-08-11 17:12:13 +03:00
Balazs Benics 5e876c54f2 [analyzer] exploded-graph-rewriter: Fix python3 string encoding issues
This encapsulates 3 changes:
 - `DotDumpVisitor` now aggregates strings instead of *bytes* for both
   `python2` and `python3`. This difference caused crashes when it tried
    to write out the content as *strings*, similarly described at D71746.
 - `graphviz.pipe()` expects the input in *bytes* instead of unicode
   strings. And it results in *bytes*. Due to string concatenations and
   similar operations, I'm using unicode string as the default, and
   converting to *bytes* on demand.
 - `write_temp_file()` now appends the `egraph-` prefix and more
   importantly, it will create the temp file in the **current working
   directory** instead of in the *temp*. This change makes `Firefox` be
   able to open the file even if the `security.sandbox.content.level` is
   set to the (default) most restricting `4`.
   See https://support.mozilla.org/si/questions/1259285

An artifact of the bad byte handling was previously in the `HTML`
produced by the script that it displayed the `b'` string at the top left
corner. Now it won't anymore :)

I've tested that the following command works on `Ubuntu 22.04`:
```
exploded-graph-rewriter my-egraph.dot
```
Both `python2` and `python3` works as expected.

PS: I'm not adding tests, as the current test infra does not support
testing HTML outputs for this script.
Check the `clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg`.
We always pass the `--dump-dot-only` flag to the script.
Along with that, the default invocation will not only create this HTML
report but also try to open it. In addition to this, I'm not sure if the
buildbots have `graphviz` installed and also if this package is installed
on `pip`.
Unless we change some of these, we cannot test this change.
Given that D71746 had no tests, I'm not too worried about this either.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D131553
2022-08-11 16:07:52 +02:00
Michael Buch af4cdfe136 [lldb][unittests] Add more test cases to CPlusPlusNameParser unit-tests
Add test cases for the possible function qualifiers that the
`CPlusPlusNameParser` supports.

Differential Revision: https://reviews.llvm.org/D131332
2022-08-11 15:05:48 +01:00
Anubhab Ghosh 0aaa74f7e6 [Orc] Reorder operations in ExecutorSharedMemoryMapperService shutdown
Differential Revision: https://reviews.llvm.org/D131510
2022-08-11 19:34:10 +05:30
Jun Zhang efc75a2bae
Remove redundant condition check, NFC
Signed-off-by: Jun Zhang <jun@junz.org>
2022-08-11 21:47:19 +08:00
Emmmer 55e511f9f6 [LLDB][RISCV] Fix risc-v target build
Fixed an inconsistency between D130985 and D130342

This should be a follow-up of D130985

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D131667
2022-08-11 21:42:44 +08:00
Tue Ly 42f183792c [libc] Change sinf/cosf range reduction to mod pi/32 to be shared with tanf.
Change sinf/cosf range reduction to mod pi/32 to be shared with tanf,
since polynomial approximations for tanf on subintervals of length pi/16 do not
provide enough accuracy.

Reviewed By: orex

Differential Revision: https://reviews.llvm.org/D131652
2022-08-11 09:41:45 -04:00
David Truby 13a784f368 [clang][AArch64][SVE] Change SVE_VECTOR_OPERATORS macro for VLA vectors
The __ARM_FEATURE_SVE_VECTOR_OPERATORS macro should be changed to
indicate that this feature is now supported on VLA vectors as well as
VLS vectors. There is a complementary PR to the ACLE spec here
https://github.com/ARM-software/acle/pull/213

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D131573
2022-08-11 13:23:52 +00:00
David Truby bbb30bd54a [clang][AArch64][SVE] Clarify documentation for sizeof operator on SVE
Previously the table in LanguageExtensions said that sizeof worked on
SVE types but this is only correct for fixed-length vectors so a
clarification has been added.
2022-08-11 13:22:23 +00:00
David Green a9e9dd9a3a [AArch64] Add bf16 select handling
A bfloat select operation will currently crash, but is allowed from C.
This adds handling for the operation, turning it into a FCSELHrrr if
fullfp16 is present, or converting it to a FCSELSrrr if not. The
FCSELSrrr is created via using INSERT_SUBREG/EXTRACT_SUBREG to convert
the bf16 to a f32 and using the f32 pattern for FCSELSrrr. (I originally
attempted to do this via a tablegen pattern, but it appears that the
nzcv glue is places onto the wrong node, causing it to be forgotten and
incorrect scheduling to be emitted).

The FCSELSrrr can also be used for fp16 selects when +fullfp16 is not
present, which helps avoid an unnecessary promotion to f32.

Differential Revision: https://reviews.llvm.org/D131253
2022-08-11 14:20:36 +01:00
Simon Pilgrim 5dcf0c342b [X86] lowerShuffleWithVPMOV - remove oneuse constraints on shuffle(trunc(x),undef) -> vpmov(x) lowering
These were added in rG057bdd63 but shuffle combining has gotten a lot better at folding different vector widths since then.
2022-08-11 14:06:42 +01:00
Sam Estep d09d4bd66c [clang][dataflow] Don't crash when caller args are missing storage locations
This patch modifies `Environment`'s `pushCall` method to pass over arguments that are missing storage locations, instead of crashing.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D131600
2022-08-11 13:00:42 +00:00
Dmitry Preobrazhensky eda6e49aa8 [AMDGPU][MC][GFX11][NFC] Correct tests for 16-bit VOP2 opcodes which use v128 or higher VGPRs
Differential Revision: https://reviews.llvm.org/D131564
2022-08-11 15:55:58 +03:00
Sam Estep eb91fd5cbc [clang][dataflow] Analyze constructor bodies
This patch adds the ability to context-sensitively analyze constructor bodies, by changing `pushCall` to allow both `CallExpr` and `CXXConstructExpr`, and extracting the main context-sensitive logic out of `VisitCallExpr` into a new `transferInlineCall` method which is now also called at the end of `VisitCXXConstructExpr`.

Reviewed By: ymandel, sgatev, xazax.hun

Differential Revision: https://reviews.llvm.org/D131438
2022-08-11 12:46:20 +00:00
Andre Vieira f9563967ca [TypePromotion] Update comment in testcase. RFC 2022-08-11 13:35:14 +01:00
Haojian Wu bf0e219d04 [pseudo] Use C++17 variant to simplify the DirectiveTree::Chunk class, NFC.
Differential Revision: https://reviews.llvm.org/D131396
2022-08-11 14:27:38 +02:00
David Stuttard 1d1cc05539 AMDGPU: mbcnt allow for non-zero src1 for known-bits
Src1 for mbcnt can be a non-zero literal or register. Take this into account
when calculating known bits.

Differential Revision: https://reviews.llvm.org/D131478
2022-08-11 13:23:43 +01:00
Dmitry Preobrazhensky 2b79b2e392 [AMDGPU][MC][GFX11][NFC] Remove test duplicates
Differential Revision: https://reviews.llvm.org/D131558
2022-08-11 15:10:01 +03:00