Commit Graph

415198 Commits

Author SHA1 Message Date
Shraiysh Vaishay 149ad3d554 [flang][mlir][NFC] Replace uses of raw accessors with prefixed accessors
`kEmitAccessorPrefix_Raw ` is being removed, and so updating the
accessors to `kEmitAccessorPrefix_Prefixed`.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D119812
2022-02-15 21:07:46 +05:30
Matt Devereau 7dce12de68 [AArch64] Suggest b.nfrst if the user tries b.nfirst.
Differential Revision: https://reviews.llvm.org/D119453

Co-authored-by: George Steed <george.steed@arm.com>
2022-02-15 15:06:04 +00:00
Valentin Clement c807aa53ee
[flang] Handle lowering of ranked array
This patch adds lowering of ranked array as function return.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D119835

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-02-15 16:01:02 +01:00
Max Kazantsev bfc1217119 [NFC] Introduce option to switch off compatible invokes merge
Does not affect default behavior (transform is on).
2022-02-15 21:51:03 +07:00
Amy Kwan ac5a5a9cfe [PowerPC] Add default handling for single element vectors, and split/promote vNi1 vectors.
This patch updates the handling of vectors in getPreferredVectorAction():

For single-element and scalable vectors, fall back to default vector legalization
handling. For vNi1 vectors, add handling to either split or promote them in
order to prevent the production of wide v256i1/v512i1 types.

The following assertion is fixed by this patch, as we ended up producing the
wide vector types (that are used for MMA) in the backend prior to this fix.

```
Assertion failed: VT.getSizeInBits() == Operand.getValueSizeInBits() &&
"Cannot BITCAST between types of different sizes!"
```

Differential Revision: https://reviews.llvm.org/D119521
2022-02-15 08:44:08 -06:00
zhijian 0135aa7b98 [llvm-nm] add a new option -X to specify the type of object file llvm-nm should examine
Summary:
Added a new option "-X" to specify, which type of object file should be examine.

For example:

1. "llvm-nm -X64 archive.a" only deal with the 64bit object files in the archive.a ,ignore the all 32bit object files in the archive.a
2. "llvm-nm -X32 xcoffobj32.o xcoffobj64.o " only deal with the 32bit object file "xcoffobj32.o" , 64bit object file "xcoffobj64.o" will be ignored

Reviewers: James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D118193
2022-02-15 09:43:31 -05:00
Aaron Ballman ed509fe296 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the tenth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-15 09:28:02 -05:00
Louis Dionne a30a7948d5 [libc++] Fix broken stdatomic test on GCC
The test would trigger -Wtautological-compare. I think that the little
we gain from comparing addresses isn't worth the added complexity to
work around the warning.
2022-02-15 09:26:27 -05:00
Simon Pilgrim 2808743cbd [X86] LowerVSETCC - always split 512-bit vectors before lowering to PCMPEQ/GT (PR53842)
Extend the existing split where we already do this for v32i16/v64i8

We can end up trying to use PCMPEQ/GT if the result needs to be sign-extended (typically due to the DAGCombiner::foldSextSetcc fold).

Fixes #53842
2022-02-15 14:21:12 +00:00
Adrian Kuegel b122cbebec [mlir][Math] Fix NaN handling in Exp approximation
Differential Revision: https://reviews.llvm.org/D119832
2022-02-15 15:17:56 +01:00
Benjamin Kramer 97db9d32f5 [mlir][gpu] Make header parse standalone. NFC. 2022-02-15 15:09:39 +01:00
Alexander Potapenko 05ee1f4af8 Revert "[asan] Add support for disable_sanitizer_instrumentation attribute"
This reverts commit dd145f953d.

https://reviews.llvm.org/D119726, like https://reviews.llvm.org/D114421,
still causes TSan to fail, see https://lab.llvm.org/buildbot/#/builders/70/builds/18020

Differential Revision: https://reviews.llvm.org/D119838
2022-02-15 15:04:53 +01:00
Ivan Butygin a2e2fbba17 [mlir][gpu] sinkOperationsIntoLaunchOp: Add user hook for isSinkingBeneficiary
Differential Revision: https://reviews.llvm.org/D119632
2022-02-15 16:50:49 +03:00
Xing Xue 16667362d0 [libc++][AIX] Remove "pragma priority" from locale.cpp
Summary:
The pragma priority guarded for AIX in locale.cpp is no longer useful and is ignored by the current AIX build compilers. This patch removes it from the source.

Reviewed by: ldionne, hubert.reinterpretcast, libc++

Differential Revision: https://reviews.llvm.org/D119765
2022-02-15 08:36:29 -05:00
Sanjay Patel 6357ccf57f [InstCombine] reassociate min/max intrinsics with constant operands
Integer min/max operations are associative:
  max (max X, C0), C1 --> max X, (max C0, C1) --> max X, NewC

https://alive2.llvm.org/ce/z/wW5HVM

This would avoid a regression when we canonicalize to min/max intrinsics
(see D98152 ).

Differential Revision: https://reviews.llvm.org/D119754
2022-02-15 08:31:23 -05:00
Max Kazantsev 1cd6454ade [Test] Add test demonstating how deopt bundle constants may be merged into instruction 2022-02-15 20:28:41 +07:00
Simon Pilgrim 9606c69087 [InstCombine] Fold sub(Y,and(lshr(X,C),1)) --> add(ashr(shl(X,(BW-1)-C),BW-1),Y) (PR53610)
As noted on PR53610, we can fold a 'bit splat' negation of a shifted bitmask pattern into a pair of shifts.

https://alive2.llvm.org/ce/z/eGrsoN

Differential Revision: https://reviews.llvm.org/D119715
2022-02-15 13:24:20 +00:00
Anton Afanasyev b7574b092a [SLP] Don't try to vectorize pair with insertelement
Particularly this breaks vectorization of insertelements where some of
intermediate (i.e. not last) insertelements are used externally.

Fixes PR52275
Fixes #51617

Differential Revision: https://reviews.llvm.org/D119679
2022-02-15 16:12:59 +03:00
Anton Afanasyev f16a9dffce [Test][SLP] Add tests for PR52275 2022-02-15 16:12:59 +03:00
Alexander Potapenko dd145f953d [asan] Add support for disable_sanitizer_instrumentation attribute
For ASan this will effectively serve as a synonym for
__attribute__((no_sanitize("address")))

This is a reland of https://reviews.llvm.org/D114421

Reviewed By: melver, eugenis

Differential Revision: https://reviews.llvm.org/D119726
2022-02-15 14:06:12 +01:00
Adrian Kuegel 14843d0c3d [mlir][OpenMP] NFC: Remove unused variable 2022-02-15 14:01:12 +01:00
Sanjay Patel d1f32a2021 [InstCombine] add tests for min/max intrinsics; NFC 2022-02-15 07:48:28 -05:00
Nathan Sidwell 02093906fa [clang][NFC] Remove IgnoreLinkageSpecDecls
The Itanium mangler uses IgnoreLinkageSpecDecls to strip linkage spec
contexts.  It doesn't do this consistently, but there is no need for
it to do it at all.  getEffectiveDeclContext never returns a linkage
spec, as it either recurses, uses getRedeclContext (which itself
removes the specs), or gets the decl context of non-namespace entities.

This patch removes the function and all calls to it.  For safety I add
a couple of asserts to make sure we never get them.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119748
2022-02-15 04:28:45 -08:00
Shraiysh Vaishay 166713f987 [mlir][OpenMP] Change omp.atomic.update to have generic updates
This patch changes the syntax of omp.atomic.update to allow the other
dialects to modify the variable with appropriate operations in the
region.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D119522
2022-02-15 17:58:13 +05:30
Matthias Springer 73e880fbf1 [mlir][bufferize] Add vector-bufferize pass and remove obsolete patterns from Linalg Bufferize
Differential Revision: https://reviews.llvm.org/D119444
2022-02-15 21:25:14 +09:00
Simon Pilgrim 8527859d89 [InstCombine] Add shift+trunc+mask tests requested for D119715 2022-02-15 12:17:03 +00:00
Sven van Haastregt 074451bd33 [OpenCL] opencl-c.h: fix atomic_fetch_max with addrspace
Commit 3c7d2f1b67 ("[OpenCL] opencl-c.h: add CL 3.0 non-generic
address space atomics", 2021-07-30) added some atomic_fetch_add/sub
overloads with uintptr_t arguments twice.  Instead, they should have
been atomic_fetch_max overloads with non-generic address spaces.
2022-02-15 12:12:03 +00:00
Nikita Popov 2460a2ce47 [DSE] Extract a common PDT check (NFC) 2022-02-15 13:05:45 +01:00
Simon Moll 53efbc15cb [VE] v256i1 broadcast isel and tests
Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D119241
2022-02-15 12:40:51 +01:00
Jan Svoboda ef378d76b4 [clang][lex] Remove misleading comment
The resiliency to `HeaderSearch::Add{,System}SearchPath` is implemented in later patch (D116750).
2022-02-15 12:39:43 +01:00
David Spickett 8d4d0f7d1a [lldb] Remove memory region non-address change from release notes
This is now on 14.x as af19ae529271f9ae96927662d7d876489115fb26
so it is not new to 15.
2022-02-15 11:36:55 +00:00
Jay Foad eeef6ad1d4 [AMDGPU] Reenable some disabled RUN lines
These look like they were temporarily disabled to placate
update_mir_test_checks and then committed by mistake.
2022-02-15 11:28:24 +00:00
iains 2370977bdd [clang] Remove a duplicate action kind table entry.
We have two entries for OPT_emit_codegen_only in the frontend action kind
table, delete one.

Differential Revision: https://reviews.llvm.org/D119826
2022-02-15 11:19:09 +00:00
Markus Böck 78c27a3cee [X86][Win64] Avoid statepoints in trailing call position
The "avoid trailing call pass" makes sure that no function ends with a call instruction for the purpose of the unwinder.
It starts of by skipping over any non real instruction, which is approximated via the Pseudo and Meta property. This sadly leads to issues when the last machine instruction is a STATEPOINT, as it is skipped despite it lowering to a call.

This patch fixes the use of a statepoint in the trailing call position by making sure call instructions are not skipped.

Differential Revision: https://reviews.llvm.org/D119644
2022-02-15 12:17:19 +01:00
Markus Böck db8ae2fef1 [llvm][doc] Update comments and documentation of custom stackmap formats in GC
Since https://reviews.llvm.org/D53892 it is possible to emit a custom stackmap by overwriting the emitStackMaps method of GCMetadataPrinter. That way even AOT compilers can generate a more efficient and more suitable format for their needs.

This patch updates documentation and stale comments in source code. In particular it removes the issue from the issue list in the Statepoints documentation and adjusts comments in GCStrategy.

Differential Revision: https://reviews.llvm.org/D119660
2022-02-15 12:17:19 +01:00
Adrian Kuegel 87de451bc5 [mlir][Math] Fix NaN handling in ExpM1 approximation.
Differential Revision: https://reviews.llvm.org/D119822
2022-02-15 12:10:12 +01:00
Nikita Popov f35af77573 [InstSimplify] Strip offsets once in computePointerICmp()
Instead of doing an inbounds strip first and another non-inbounds
strip afterward for equality comparisons, directly do a single
inbounds or non-inbounds strip based on whether we have an equality
predicate or not.

This is NFC-ish in that the alloca equality codepath is the only
part that sees additional non-inbounds offsets now, and for that
codepath it doesn't matter whether or not the GEP is inbounds, as
it does a stronger check itself. InstCombine would infer inbounds
for such GEPs.
2022-02-15 12:04:24 +01:00
Vladislav Khmelevsky eccdf2d9b1 [BOLT] Fix aarch64 dwarf test
After "Remove caching of ranges/abbrevs" patch the dwarf offsets are a
bit changed and the subprograms high pc is replaced with AT_RANGES.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D119733
2022-02-15 13:59:38 +03:00
Matthias Springer e6f691615e [mlir][bufferize] Support tensor.expand_shape and tensor.collapse_shape
Differential Revision: https://reviews.llvm.org/D112512
2022-02-15 19:53:49 +09:00
Jay Foad a65b9dd049 [AMDGPU] Divergence-driven instruction selection for bfm patterns
Differential Revision: https://reviews.llvm.org/D119706
2022-02-15 10:49:18 +00:00
Akshay Baviskar f1efac7f08 Add verifier for gpu.alloc op
Add verifier for gpu.alloc op to verify if the dimension operand counts
and symbol operand counts are same as their memref counterparts.

Differential Revision: https://reviews.llvm.org/D117427
2022-02-15 15:57:58 +05:30
Matthias Springer 695c341b84 [mlir][bufferize] Generalize filtering mechanism in BufferizationOptions
Support ALLOW filters and DENY filters. This is needed for compatibility with existing code that specifies more complex op filters.

Differential Revision: https://reviews.llvm.org/D119820
2022-02-15 19:17:33 +09:00
David Green 655d0d86f9 [DAGCombine] Move AVG combine to SimplifyDemandBits
This moves the matching of AVGFloor and AVGCeil into a place where
demand bit are available, so that it can detect more cases for more
folds. It changes the transform to start from a shift, not from a
truncate. We match the pattern shr(add(ext(A), ext(B)), 1), transforming
to ext(hadd(A, B)).

For signed values, because only the bottom bits are demanded llvm will
transform the above to use a lshr too, as opposed to ashr. In order to
correctly detect the hadd we need to know the demanded bits to turn it
back. Depending on whether the shift is signed (ashr) or logical (lshr),
and the extensions are signed or unsigned we can create different nodes.
If the shift is signed:
  Needs >= 2 sign bits. https://alive2.llvm.org/ce/z/h4gQAW generating signed rhadd.
  Needs >= 2 zero bits. https://alive2.llvm.org/ce/z/B64DUA generating unsigned rhadd.
If the shift is unsigned:
  Needs >= 1 zero bits. https://alive2.llvm.org/ce/z/ByD8sj generating unsigned rhadd.
  Needs 1 demanded bit zero and >= 2 sign bits https://alive2.llvm.org/ce/z/hvPGxX and
    https://alive2.llvm.org/ce/z/32P5n1 generating signed rhadd.

Differential Revision: https://reviews.llvm.org/D119072
2022-02-15 10:17:02 +00:00
Jan Svoboda e7dcf09fc3 [clang][lex] Use `SearchDirIterator` types in for loops
This patch replaces a lot of index-based loops with iterators and ranges.

Depends on D117566.

Reviewed By: ahoppen

Differential Revision: https://reviews.llvm.org/D119722
2022-02-15 11:02:26 +01:00
Jan Svoboda 17c9fcd6f6 [clang][lex] Use `ConstSearchDirIterator` in lookup cache
This patch starts using the new iterator type in `LookupFileCacheInfo`.

Depends on D117566.

Reviewed By: ahoppen

Differential Revision: https://reviews.llvm.org/D119721
2022-02-15 10:39:05 +01:00
Jan Svoboda 7631c366c8 [clang][lex] Introduce `ConstSearchDirIterator`
The `const DirectoryLookup *` out-parameter of `{HeaderSearch,Preprocessor}::LookupFile()` is assigned the most recently used search directory, which callers use to implement `#include_next`.

From the function signature it's not obvious the `const DirectoryLookup *` is being used as an iterator. This patch introduces `ConstSearchDirIterator` to make that affordance obvious. This would've prevented a bug that occurred after initially landing D116750.

Reviewed By: ahoppen

Differential Revision: https://reviews.llvm.org/D117566
2022-02-15 10:36:54 +01:00
Jay Foad f72d8897ac [AMDGPU] Honor !invariant.load metadata on load-like intrinsics
Differential Revision: https://reviews.llvm.org/D119739
2022-02-15 09:16:57 +00:00
Jay Foad cb654c7de2 [AMDGPU] Precommit test for !invariant.load metadata on load-like intrinsics
Differential Revision: https://reviews.llvm.org/D119738
2022-02-15 09:16:57 +00:00
Nikita Popov 093e9489d5 [BitcodeReader] Change order of assignValue() arguments (NFC)
Other methods in ValueList generally pass Idx first, and it is
more convention for assignment methods to have the target on the
LHS rather than RHS.
2022-02-15 10:11:01 +01:00
Jan Svoboda a081a0654f [clang][lex] NFC: De-duplicate some #include_next logic
This patch addresses a FIXME and de-duplicates some `#include_next` logic

Depends on D119714.

Reviewed By: ahoppen

Differential Revision: https://reviews.llvm.org/D119716
2022-02-15 09:52:39 +01:00