David Tenty [Thu, 27 Jan 2022 03:14:19 +0000 (21:14 -0600)]
[compiler-rt][profile][AIX] pass extra link opts for test
This is a follow up to D118101, that added bexpfull to the test on instrprof-get-filename-merge-mode.c AIX, in order to get the
necessary symbols exported. But unfortunately the extra dependent symbols this exports actually cause segfaults, which is why
this isn't really recommended in the first place, so just use an actual export list.
Differential Revision: https://reviews.llvm.org/D118310
Haojian Wu [Thu, 27 Jan 2022 21:19:09 +0000 (22:19 +0100)]
[clangd] Fix a typo , => ; in hovertest.
I somehow missed it.
Siva Chandra Reddy [Thu, 27 Jan 2022 21:06:14 +0000 (21:06 +0000)]
[libc] Revert "Refactor sqrt implementations and add tests for generic sqrt implementations."
This reverts commit
21c4c82c2026bac1f53be54923c0663d41d0a0aa.
Siva Chandra Reddy [Thu, 27 Jan 2022 21:05:22 +0000 (21:05 +0000)]
[libc] Revert "Guard sqrt_80_bit_long_double.h header to not be included with aarch64."
This reverts commit
4a979c42564e622fdf283ae8d0b7a59ebe567533.
Snehasish Kumar [Tue, 7 Dec 2021 23:30:14 +0000 (15:30 -0800)]
[InstrProf][NFC] Refactor Profile kind into a bitset enum.
This change refactors the ProfileKind enum into a bitset enum to
represent the different attributes a profile can have. This change
simplifies the logic in the instrprof writer when multiple profiles are
merged together. In the future we plan on introducing a new memory
profile section which will extend the enum by one additional entry.
Without this change when accounting for memory profiles will have to be
maintained separately and will make the logic more complex.
Differential Revision: https://reviews.llvm.org/D115393
Johannes Doerfert [Thu, 27 Jan 2022 20:36:36 +0000 (15:36 -0500)]
[OpenMP][NFCI] Pipe the IdentTy object through more new RT functions
IdentTy objects are useful for debugging and profiling so we want to
keep them around in more places, especially those that have a large
impact on performance, e.g., everything related to state.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D112494
Siva Chandra Reddy [Tue, 25 Jan 2022 21:08:37 +0000 (21:08 +0000)]
[libc] Add POSIX close, fsync, open, read and write functions.
They are implemented as simple syscall wrappers. The file creation
macros have been put in a header file as a temporary solution until we
have a cleaner approach to listing platform relevant macros.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D118396
Haojian Wu [Thu, 20 Jan 2022 08:30:16 +0000 (09:30 +0100)]
[clangd] Enable hover on character literal.
In the initial hover expression patch (https://reviews.llvm.org/D72500), we
disabled all literals.
There is some value on running hover on character literals (e.g. see the
int value of the char).
Differential Revision: https://reviews.llvm.org/D117864
Haojian Wu [Thu, 27 Jan 2022 07:43:31 +0000 (08:43 +0100)]
[clangd] Fix a selection tree crash for unmatched-bracket code.
Fixes https://github.com/clangd/clangd/issues/999
Differential Revision: https://reviews.llvm.org/D118322
Craig Topper [Thu, 27 Jan 2022 20:12:45 +0000 (12:12 -0800)]
[RISCV] Use std::map::count != 0 instead of std::map::count == 1. NFC
Maps always return 0 or 1 for count. Comparing to 0 can create
simpler compiled code.
Someday we'll get to use std::map::contains.
Sri Hari Krishna Narayanan [Thu, 27 Jan 2022 20:15:25 +0000 (15:15 -0500)]
Runtime for Interop directive
This implements the runtime portion of the interop directive.
It expects the frontend and IRBuilder portions to be in place
for proper execution. It currently works only for GPUs
and has several TODOs that should be addressed going forward.
Reviewed By: RaviNarayanaswamy
Differential Revision: https://reviews.llvm.org/D106674
Alexander Yermolovich [Thu, 27 Jan 2022 20:03:01 +0000 (12:03 -0800)]
[BOLT][DWARF] Fix gdb index section
Since we now re-write .debug_info the DWARF CU Offsets can change.
Just like for .debug_aranges the GDB Index will need to be updated.
Reviewed By: Amir, maksfb
Differential Revision: https://reviews.llvm.org/D118273
Anton Korobeynikov [Thu, 27 Jan 2022 20:06:15 +0000 (23:06 +0300)]
Remove "awaiting-review" labels from closed issues.
Fixes #53451
Sri Hari Krishna Narayanan [Thu, 27 Jan 2022 19:53:00 +0000 (14:53 -0500)]
OMPIRBuilder for Interop directive
Implements the OMPIRBuilder portion for the
Interop directive.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D105876
Craig Topper [Thu, 27 Jan 2022 19:47:53 +0000 (11:47 -0800)]
[RISCV] Prefer vmslt.vx v0, v8, zero over vmsle.vi v0, v8, -1.
At least when starting from a vmslt.vx intrinsic or ISD::SETLT. We
don't handle the case where the user used vmsle.vx intrinsic with -1.
natashaknk [Thu, 27 Jan 2022 19:25:26 +0000 (11:25 -0800)]
[tosa][mlir] Add dynamic shape support for remaining ops
Added support for concat, tile, pad, argmax and table ops
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D118397
Arthur O'Dwyer [Tue, 25 Jan 2022 17:12:47 +0000 (12:12 -0500)]
[libc++] [ranges] ref_view and empty_view are borrowed ranges. Normalize borrowed_range tests.
Differential Revision: https://reviews.llvm.org/D118164
Arthur O'Dwyer [Wed, 19 Jan 2022 12:29:05 +0000 (07:29 -0500)]
[libc++] Fix a typo in reverse_iterator::operator=.
We should be checking `is_assignable<It&, ...>`.
`is_assignable<It, ...>` checks for an rvalue left-hand side, which
is basically never assignable-to.
Found while looking into https://cplusplus.github.io/LWG/issue3435 .
Differential Revision: https://reviews.llvm.org/D117660
Arthur O'Dwyer [Tue, 18 Jan 2022 12:25:17 +0000 (07:25 -0500)]
[clang] Don't typo-fix an expression in a SFINAE context.
If this is a SFINAE context, then continuing to look up names
(in particular, to treat a non-function as a function, and then
do ADL) might too-eagerly complete a type that it's not safe to
complete right now. We should just say "okay, that's a substitution
failure" and not do any more work than absolutely required.
Fixes #52970.
Differential Revision: https://reviews.llvm.org/D117603
David Green [Thu, 27 Jan 2022 19:19:46 +0000 (19:19 +0000)]
[ARM][AArch64] Introduce qrdmlah and qrdmlsh intrinsics
Since it's introduction, the qrdmlah has been represented as a qrdmulh
and a sadd_sat. This doesn't produce the same result for all input
values though. This patch fixes that by introducing a qrdmlah (and
qrdmlsh) intrinsic specifically for the vqrdmlah and sqrdmlah
instructions. The old test cases will now produce a qrdmulh and sqadd,
as expected.
Fixes #53120 and #50905 and #51761.
Differential Revision: https://reviews.llvm.org/D117592
Malhar Jajoo [Thu, 27 Jan 2022 19:07:47 +0000 (19:07 +0000)]
Trivial update for debug location in LIT test.
This just updates debug location of a loop in a LIT test to point
to the correct source line.
David Green [Thu, 27 Jan 2022 18:43:06 +0000 (18:43 +0000)]
[ARM][AArch64] Cleanup and autogenerate v8.1a vqdrmlah tests. NFC
Florian Hahn [Thu, 27 Jan 2022 18:41:33 +0000 (18:41 +0000)]
[ConstraintElimination] Use constraints with 0 or 1 coefficients.
isConditionImplied is able to correctly handle 0 or 1 coefficients, so
let it handle those cases, rather than skipping them.
Damian Rouson [Thu, 9 Dec 2021 22:23:20 +0000 (14:23 -0800)]
[flang] Expand the semantics test for co_sum
Increase the coverage of standard-conforming and non-conforming
co_sum calls.
Reviewed By: ktras
Tue Ly [Thu, 27 Jan 2022 17:12:38 +0000 (12:12 -0500)]
[libc] Guard sqrt_80_bit_long_double.h header to not be included with aarch64.
Guard sqrt_80_bit_long_double.h header to not be included with aarch64.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D118389
Simon Pilgrim [Thu, 27 Jan 2022 17:58:29 +0000 (17:58 +0000)]
[X86] Fold MOVMSK(CONCAT(X,Y)) -> MOVMSK(AND/OR(X,Y)) for all_of/any_of patterns
Makes it easier for later folds and avoids unnecessary 256-bit ops (especially on AVX1-only targets where we miss a lot of integer instructions)
Bjorn Pettersson [Wed, 26 Jan 2022 17:15:53 +0000 (18:15 +0100)]
[test] Use -passes syntax in SROA test cases
Another step to move away from the legacy PM syntax when specifying
passes in opt.
Differential Revision: https://reviews.llvm.org/D118339
Bjorn Pettersson [Thu, 27 Jan 2022 15:09:24 +0000 (16:09 +0100)]
[NewPM] Add debugify and check-debugify to the PassRegistry
Adding -debugify and -check-debugify in the PassRegistry will make
sure the passes are listed properly by -print-pipeline-passes as
well as -print-passes.
It also allows removal of the custom pipeline parsing callback that
has been used in the NewPMDriver.
Differential Revision: https://reviews.llvm.org/D118369
Jay Foad [Thu, 27 Jan 2022 14:27:39 +0000 (14:27 +0000)]
[AMDGPU] SILoadStoreOptimizer: reject AGPR DS_WRITE sooner
Rejecting AGPR DS_WRITE instructions before adding them to any mergeable
list seems cleaner than adding them to the list and rejecting them
later.
Differential Revision: https://reviews.llvm.org/D118368
Jay Foad [Thu, 27 Jan 2022 14:48:08 +0000 (14:48 +0000)]
[AMDGPU] SILoadStoreOptimizer: use separate lists for AGPR instructions
Using separate lists for AGPR and non-AGPR instructions seems like a
cleaner solution than putting them all in the same list and then later
refusing to merge instructions of different AGPR-ness.
Differential Revision: https://reviews.llvm.org/D118367
Jay Foad [Thu, 27 Jan 2022 14:39:42 +0000 (14:39 +0000)]
[AMDGPU] SILoadStoreOptimizer: tweak API of CombineInfo::setMI. NFC.
Change CombineInfo::setMI to take a reference to the
SILoadStoreOptimizer instance, for easy access to common fields like
TII and STM.
Differential Revision: https://reviews.llvm.org/D118366
Ellis Hoag [Wed, 26 Jan 2022 17:59:57 +0000 (09:59 -0800)]
[InstrProf][Correlate] Verify debug info with llvm-profdata show
Use the `llvm-profdata show` command to verify debug info for profile correlation using the `--debug-info` option.
Reviewed By: kyulee
Differential Revision: https://reviews.llvm.org/D118181
Med Ismail Bennani [Thu, 27 Jan 2022 17:39:55 +0000 (18:39 +0100)]
[lldb/test] Disable test_launch_scripted_process_stack_frames on x86_64
There seems to be an issue on x86_64 when launching a ScriptdProcess.
This disables temporarely the test that causes the bot to timeout until
I finish investigating the issue.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Siva Chandra Reddy [Thu, 27 Jan 2022 17:11:06 +0000 (17:11 +0000)]
[libc][NFC] Move the POSIX write function to the default build on linux.
Craig Topper [Thu, 27 Jan 2022 08:17:33 +0000 (00:17 -0800)]
[RISCV] Use const reference when looping over Exts in RISCVISAInfo.
Exts is a map of keyed by std::string with a extension info as
a value. Making copies of this wouldn't be cheap.
We had a mix of references and copies. This makes everything
consistently use a const reference to make it clear we aren't
modifying it.
Differential Revision: https://reviews.llvm.org/D118326
Florian Hahn [Thu, 27 Jan 2022 17:15:43 +0000 (17:15 +0000)]
[ConstraintElimination] Add additional GEP arithmetic tests.
Siva Chandra Reddy [Thu, 27 Jan 2022 16:59:08 +0000 (16:59 +0000)]
[libc][NFC] Let var args be treated as a named type in the spec.
The type names in the spec are just sugar used by the header generator to
generate the function prototype. Giving the VarArgType a name of "..."
allows the header generator to treat and generate the "type name" for var
arg parameters similar to how it does for any other type.
Marek Kurdej [Thu, 27 Jan 2022 16:54:58 +0000 (17:54 +0100)]
[clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record.
Fixes https://github.com/llvm/llvm-project/issues/53430.
Initially, I had a quick and dirty approach, but it led to a myriad of special cases handling comments (that may add unwrapped lines).
So I added TT_RecordLBrace type annotations and it seems like a much nicer solution.
I think that in the future it will allow us to clean up some convoluted code that detects records.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D118337
Tue Ly [Tue, 25 Jan 2022 20:11:15 +0000 (15:11 -0500)]
[libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Refactor sqrt implementations:
- Move architecture specific instructions from `src/math/<arch>` to `src/__support/FPUtil/<arch>` folder.
- Move generic implementation of `sqrt` to `src/__support/FPUtil/generic` folder and add it as a header library.
- Use `src/__support/FPUtil/sqrt.h` for architecture/generic selections.
- Add unit tests for generic implementation of `sqrt`.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D118173
Hongtao Yu [Wed, 26 Jan 2022 19:29:00 +0000 (11:29 -0800)]
[LTO] An option to disable automatic bitcode upgrade
Bitcode upgrade automatically takes in place when the current compiler version doesn't match the one building the input modules. The upgrade is very expansive for large applications and unnecessary when users are sure the two compilers do not have a version issue, even if their versions mismatch literally. An optional to disable the automatic bitcode upgrade will be handy in such case.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D109869
Richard [Sat, 22 Jan 2022 00:57:40 +0000 (17:57 -0700)]
[clang-tidy] Add more documentation about check development (NFC)
- Mention pp-trace
- CMake configuration
- Overriding registerPPCallbacks
- Overriding isLanguageVersionSupported
- Check development tips
- Guide to useful documentation
- Using the Transformer library
- Developing your check incrementally
- Creating private matchers
- Unit testing helper code
- Making your check robust
- Documenting your check
- Describe the Inputs test folder
Differential Revision: https://reviews.llvm.org/D117939
Matthias Springer [Thu, 27 Jan 2022 16:11:22 +0000 (01:11 +0900)]
[mlir][bufferize] Move arith BufferizableOpInterface impl to arith dialect
Also switch the implementation of `-arith-bufferize` to BufferizableOpInterface.
Differential Revision: https://reviews.llvm.org/D118325
MuAlphaOmegaEpsilon [Thu, 27 Jan 2022 16:39:05 +0000 (11:39 -0500)]
Don't trigger unused-parameter warnings on naked functions
This commit checks if a function is marked with the naked attribute
and, if it is, will silence the emission of any unused-parameter
warning.
Inside a naked function only the usage of basic ASM instructions is
expected. In this context the parameters can actually be used by
fetching them according to the underlying ABI. Since parameters might
be used through ASM instructions, the linter and the compiler will have
a hard time understanding if one of those is unused or not, therefore
no unused-parameter warning should ever be triggered whenever a
function is marked naked.
Mark de Wever [Sun, 23 Jan 2022 17:23:41 +0000 (18:23 +0100)]
[libc++][nfc] Add TEST_HAS_NO_INT128.
Avoid using the libc++ internal `_LIBCPP_HAS_NO_INT128` in our tests.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D117992
Mark de Wever [Mon, 24 Jan 2022 18:04:06 +0000 (19:04 +0100)]
[libc++][nfc] Include test_macros.h in more tests.
This should fix the regressions detected in D117992.
This lands before D117992 to avoid breaking main.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D118056
Matt Arsenault [Thu, 27 Jan 2022 02:57:36 +0000 (21:57 -0500)]
AMDGPU: Handle addrspacecast of constant 32-bit to flat
I accidentally made this work on the GlobalISel path, and there's no
real reason not to handle this.
Matt Arsenault [Thu, 27 Jan 2022 02:57:24 +0000 (21:57 -0500)]
AMDGPU: Fix broken check lines in test
Sander de Smalen [Thu, 27 Jan 2022 13:01:07 +0000 (13:01 +0000)]
[AArch64][SVE] Folds VSELECT if the predicate is all active.
This adds the following changes:
* Fold: vselect(<all active predicate>, x, y) => x
* Extend isAllActivePredicate to take vscale_range into account, e.g.
isAllActivePredicate(vl16) for nxv16i1 and vscale == 1 => true.
isAllActivePredicate(vl32) for nxv16i1 and vscale == 2 => true.
Differential Revision: https://reviews.llvm.org/D118147
Louis Dionne [Wed, 26 Jan 2022 16:05:47 +0000 (11:05 -0500)]
[libc++][NFC] Move some functions from directory_iterator.cpp to filesystem_common.h
This move is going to be needed in order to reuse `posix_readdir` in
another translation unit. This doesn't change any of the code except
for removing an unused function parameter that otherwise triggers a
warning inside our tests.
Differential Revision: https://reviews.llvm.org/D118254
Louis Dionne [Thu, 13 Jan 2022 17:16:30 +0000 (12:16 -0500)]
[libc++] Fix bug in ranges::advance
In `ranges::advance(iter, n, bound)`, we'd incorrectly handle the case
where bound < iter and n is 0:
int a[10];
int *p = a+5;
int *bound = a+3;
std::ranges::advance(p, 0, bound);
assert(p - a == 5); // we'd return 3 before this patch
This was caused by an incorrect handling of 0 inside __magnitude_geq.
Differential Revision: https://reviews.llvm.org/D117240
Louis Dionne [Tue, 18 Jan 2022 17:10:14 +0000 (12:10 -0500)]
[libc++] Fix common_iterator for output_iterators
We were missing a constraint in common_iterator's iterator_traits and
we were eagerly instantiating iter_value_t even when invalid.
Thanks to Casey Carter for finding this bug.
Differential Revision: https://reviews.llvm.org/D117449
Yousuf Ali [Thu, 27 Jan 2022 14:57:04 +0000 (09:57 -0500)]
[PowerPC][AIX] Support toc-data attribute for read-only globals.
The patch handles the addition of constant global variables to the table
of contents.
Differential Revision: https://reviews.llvm.org/D116181
Matt Arsenault [Tue, 18 Jan 2022 23:37:27 +0000 (18:37 -0500)]
AMDGPU/GlobalISel: Fix assert on invalid cond code for llvm.amdgcn.icmp
Jean Perier [Thu, 27 Jan 2022 13:59:38 +0000 (14:59 +0100)]
[flang] split character procedure arguments in target-rewrite pass
When passing a character procedure as a dummy procedure, the result
length must be passed along the function address. This is to cover
the cases where the dummy procedure is declared with assumed length
inside the scope that will call it (it will need the length to allocate
the result on the caller side).
To be compatible with other Fortran compiler, this length must be
appended after all other argument just like character objects
(fir.boxchar).
A fir.boxchar cannot be used to implement this feature because it
is meant to take an object address, not a function address.
Instead, argument like `tuple<function type, integer type> {fir.char_proc}`
will be recognized as being character dummy procedure in FIR. That way
lowering does not have to do the argument split.
This patch adds tools in Character.h to create this type and tuple
values as well as to recognize them and extract its tuple members.
It also updates the target rewrite pass to split these arguments like
fir.boxchar.
This part is part of fir-dev upstreaming. It was reviwed previously
in: https://github.com/flang-compiler/f18-llvm-project/pull/1393
Differential Revision: https://reviews.llvm.org/D118108
Matt Arsenault [Tue, 18 Jan 2022 22:45:51 +0000 (17:45 -0500)]
AMDGPU/GlobalISel: Fix flat_scratch_init handling for shaders
I don't think this is actually defined for mesa, but this is what we
were doing on the DAG path.
Martin Probst [Thu, 27 Jan 2022 14:15:30 +0000 (15:15 +0100)]
clang-format: [JS] sort import aliases.
Users can define aliases for long symbols using import aliases:
import X = A.B.C;
Previously, these were unhandled and would terminate import sorting.
With this change, aliases sort as their own group, coming last after all
other imports.
Aliases are not sorted within their group, as they may reference each
other, so order is significant.
Revision URI: https://reviews.llvm.org/D118361
Simon Pilgrim [Thu, 27 Jan 2022 14:54:16 +0000 (14:54 +0000)]
[X86][SSE] Add combineBitOpWithShift for BITOP(SHIFT(X,Z),SHIFT(Y,Z)) -> SHIFT(BITOP(X,Y),Z) vector folds
InstCombine performs this more generally with SimplifyUsingDistributiveLaws, but we don't need anything that complex here - this is mainly to fix up cases where logic ops get created late on during lowering, often in conjunction with sext/zext ops for type legalization.
https://alive2.llvm.org/ce/z/gGpY5v
Jay Foad [Wed, 26 Jan 2022 17:09:38 +0000 (17:09 +0000)]
[AMDGPU] SILoadStoreOptimizer: Allow merging across a swizzled access
Swizzled accesses are not merged, but there is no particular reason not
to merge two instructions if any of the intervening instructions happens
to be a swizzled access.
This moves the check for swizzled accesses out of checkAndPrepareMerge
into collectMergeableInsts where I think it makes more sense.
Differential Revision: https://reviews.llvm.org/D118267
Florian Hahn [Thu, 27 Jan 2022 14:20:30 +0000 (14:20 +0000)]
[AArch64] Add vector compare/select tests with UNE predicate.
Precommit some additional tests for D118256.
Pavel Labath [Thu, 27 Jan 2022 13:55:49 +0000 (14:55 +0100)]
[lldb] Delete TestBacktraceAll.py
This test is completely nondeterministic, environment-dependent and does
not test what it was supposed to test (reverting the associated patch
does not make it fail).
I tried to figure out what the patch was meant to fix to see if I can
create a better test with the current tools, but I was not able to
understand the problem (it sounds like it has something to do with local
classes, but I don't understand the details).
Florian Hahn [Thu, 27 Jan 2022 13:44:47 +0000 (13:44 +0000)]
[ConstraintSystem] Mark function as const (NFC).
Nikita Popov [Thu, 27 Jan 2022 13:33:29 +0000 (14:33 +0100)]
[OMPIRBuilder] Avoid pointer element type access
Use isOpaqueOrPointeeTypeEquals() instead.
Florian Hahn [Thu, 27 Jan 2022 13:31:23 +0000 (13:31 +0000)]
[ConstraintElimination] Use simplified constraint for == 0.
When checking x == 0, checking x u<= 0 is sufficient and simpler than
x u>= 0 && x u<= 0.
https://alive2.llvm.org/ce/z/btM7d3
----------------------------------------
define i1 @src(i4 %a) {
%0:
%c = icmp eq i4 %a, 0
ret i1 %c
}
=>
define i1 @tgt(i4 %a) {
%0:
%c = icmp ule i4 %a, 0
ret i1 %c
}
Transformation seems to be correct!
Simon Pilgrim [Thu, 27 Jan 2022 13:20:36 +0000 (13:20 +0000)]
[X86] Fold TESTZ(OR(LO(X),HI(X)),OR(LO(Y),HI(Y))) -> TESTZ(X,Y)
Helps fix a number of poor codegen cases for allof(cmp()) with 256-bit vectors on AVX1
Simon Pilgrim [Thu, 27 Jan 2022 12:56:50 +0000 (12:56 +0000)]
[X86] Add test showing failure to combine 128-bit PTEST of split vectors
Sander de Smalen [Thu, 27 Jan 2022 12:15:12 +0000 (12:15 +0000)]
[AArch64][SVE] Avoid using ptrue for unpredicated predicate AND.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D118146
Benjamin Kramer [Thu, 27 Jan 2022 12:02:34 +0000 (13:02 +0100)]
[mlir][BufferOptimization] Use datalayout instead of a flag to find index size
This has the additional advantage of supporting more types.
Differential Revision: https://reviews.llvm.org/D118348
Benjamin Kramer [Thu, 27 Jan 2022 12:08:08 +0000 (13:08 +0100)]
[mlir][complex] Lower complex.constant to LLVM
This fixes a regression from
480cd4cb8560532e544fc0c234749912dde759c6
Differential Revision: https://reviews.llvm.org/D118347
Florian Hahn [Thu, 27 Jan 2022 12:40:09 +0000 (12:40 +0000)]
[ConstraintElimination] Introduce struct to manage constraints. (NFC)
This patch adds a struct to manage a list of constraints. It simplifies
a follow-up change, that adds pre-conditions that must hold before a
list of constraints can be used.
Michał Górny [Mon, 24 Jan 2022 17:52:49 +0000 (18:52 +0100)]
[lldb] [gdb-remote] Support getting siginfo via API
Add Thread::GetSiginfo() and SBThread::GetSiginfo() methods to retrieve
the siginfo value from server.
Differential Revision: https://reviews.llvm.org/D118055
Michał Górny [Wed, 19 Jan 2022 19:16:07 +0000 (20:16 +0100)]
[lldb] [Platform] Support synthesizing siginfo_t
Support synthesizing the siginfo_t type from the Platform plugin.
This type is going to be used by LLDB client to process the raw siginfo
data received from lldb-server without the necessity of relying
on target's debug info being present.
Differential Revision: https://reviews.llvm.org/D117707
Jay Foad [Thu, 27 Jan 2022 12:10:48 +0000 (12:10 +0000)]
[AMDGPU] Precommit test for swizzled store aliasing two loads
Max Kazantsev [Thu, 27 Jan 2022 12:05:23 +0000 (19:05 +0700)]
[Test] Add data layout to relevant tests + some wide-typed tests
Kadir Cetinkaya [Wed, 26 Jan 2022 16:55:52 +0000 (17:55 +0100)]
[clangd][Hover] Suppress initializers with many tokens
This results in excessive memory usage and eats a lot of screen estate.
Especially in the cases with lots of nested macro calls.
This patch tries to remedy it before the release cut by suppressing the
initializers. For better UX we should probably update the expression printer to
truncate those (behind some policy).
Fixes https://github.com/clangd/clangd/issues/917
Differential Revision: https://reviews.llvm.org/D118260
Nikita Popov [Thu, 27 Jan 2022 11:46:47 +0000 (12:46 +0100)]
[IR] Support ifuncs in opaque pointer mode
Relax the type assertion for opaque pointers, and enumerate the
value type in TypeFinder and ValueEnumerator.
Shezan Baig [Thu, 27 Jan 2022 11:57:38 +0000 (13:57 +0200)]
[Support] [Windows] Don't cancel delete if we failed to set delete
Following up on commit
177176f75c6fa3f624d6d964b9d340ce39511565, if we
failed to setDeleteDisposition(true) during TempFile creation, then
don't try to setDeleteDisposition(false) during TempFile::keep, since it
will likely fail as well.
Instead of letting TempFile::keep just fail, we should let it go ahead
and try renaming the file.
This fixes an issue we are seeing when running clang-cl.exe through the
Incredibuild distributed build system. We're seeing that renaming
temporary object files would fail here:
https://github.com/llvm/llvm-project/blob/
5c1f7b296ac0dddeca02891976e6ab5cfc006719/clang/lib/Frontend/CompilerInstance.cpp#L789
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D118212
Matthias Springer [Thu, 27 Jan 2022 11:45:06 +0000 (20:45 +0900)]
Revert "[mlir][bufferize] Insert memref.cast ops during finalizing pass"
This reverts commit
1043107ce5e2dee38f6a9bf459549a75f78a83b2.
This commit caused a breakage in `finalizing-bufferize.mlir`.
Sander de Smalen [Thu, 27 Jan 2022 11:01:56 +0000 (11:01 +0000)]
[AArch64][SVE] Avoid using ptrue for ptest in VECREDUCE_OR.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D118145
Nikita Popov [Thu, 27 Jan 2022 11:36:25 +0000 (12:36 +0100)]
[IR] Handle opaque pointers in PtrToArgument mangling
It appears that this mangling type is currently unused. Make it
compatible with opaque pointers in case it becomes used again...
Nikita Popov [Thu, 27 Jan 2022 11:26:32 +0000 (12:26 +0100)]
[InstCombine] Avoid pointer element type access in PointerReplacer
This code replaces the address space of the pointers while keeping
the element type. Use the appropriate helpers to make this work
with opaque pointers.
Anton Zabaznov [Mon, 13 Dec 2021 15:43:37 +0000 (18:43 +0300)]
[OpenCL] Add support of __opencl_c_device_enqueue feature macro.
This feature requires support of __opencl_c_generic_address_space and
__opencl_c_program_scope_global_variables so diagnostics for that is provided as well.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D115640
Martin Storsjö [Thu, 20 Jan 2022 22:33:56 +0000 (22:33 +0000)]
[libcxx] [test] Narrow down a MinGW bug workaround in rand.dist.uni.int/eval.pass.cpp
Differential Revision: https://reviews.llvm.org/D118235
Sander de Smalen [Thu, 27 Jan 2022 10:31:10 +0000 (10:31 +0000)]
[AArch64][SVE] Implement missing lowering for extract_subvector for predicates.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D118057
Simon Pilgrim [Thu, 27 Jan 2022 10:59:03 +0000 (10:59 +0000)]
[DAG] SelectionDAG::getNode(N1,N2) - detect N2 constant vector splats as well as scalars
We already perform some basic folds (add/sub with zero etc.) on scalar types, this patch adds some basic support for constant splats as well in a few cases (we can add more with future test coverage).
In the cases I've enabled, we can handle buildvector implicit truncation as we're not creating new constant nodes from the vector types - we're just returning existing nodes. This allows us to get a number of extra cases in the aarch64 tests.
I haven't enabled support for undefs in buildvector splats, as we're often checking for zero/allones patterns that return the original constant and we shouldn't be returning undef elements in some of these cases - we can enable this later if we're OK with creating new constants.
Differential Revision: https://reviews.llvm.org/D118264
Jay Foad [Thu, 27 Jan 2022 10:56:35 +0000 (10:56 +0000)]
[AMDGPU] Update MachineMemOperands syntax in commented out tests
Jay Foad [Thu, 27 Jan 2022 10:52:59 +0000 (10:52 +0000)]
[AMDGPU] Remove unused CI check lines
Nikita Popov [Thu, 27 Jan 2022 10:50:27 +0000 (11:50 +0100)]
[ConstantFold] Disable gep of array bitcast fold with opaque pointers
Once again, this fold is meaningless with opaque pointers, as there
is no pointer element type to canonicalize. At some point, we may
want to do GEP type canonicalizations.
Matthias Springer [Thu, 27 Jan 2022 10:37:58 +0000 (19:37 +0900)]
[mlir][linalg][bufferize] Support arith.index_cast bufferization
This is in preparation of switching `-tensor-constant-bufferize` and `-arith-bufferize` to BufferizableOpInterface-based implementations.
Differential Revision: https://reviews.llvm.org/D118324
Jay Foad [Thu, 27 Jan 2022 10:48:15 +0000 (10:48 +0000)]
[AMDGPU] Remove unused GFX6 check lines
Nikita Popov [Thu, 27 Jan 2022 10:39:34 +0000 (11:39 +0100)]
[InstCombine] Mark element type access as non-opaque (NFC)
Also make the function static to make it more obvious that it is
only used in the one place.
Sven van Haastregt [Thu, 27 Jan 2022 10:33:12 +0000 (10:33 +0000)]
[OpenCL] opencl-c.h: add missing read_write image guards
The get_image_num_mip_levels overloads that take a read_write image
parameter were missing the __opencl_c_read_write_images guard.
Matthias Springer [Thu, 27 Jan 2022 10:18:59 +0000 (19:18 +0900)]
[mlir][tensor] Replace tensor-bufferize with BufferizableOpInterface impl
This commit switches the `tensor-bufferize` pass over to BufferizableOpInterface-based bufferization.
Differential Revision: https://reviews.llvm.org/D118246
Sander de Smalen [Thu, 27 Jan 2022 09:17:29 +0000 (09:17 +0000)]
[AArch64][SVE] Implement PFALSE with explicit AArch64ISD node.
The ISel patterns for PFALSE helps recognise the instructions as being
free of side-effects, which helps MachineCSE remove redundant
PFALSE instructions.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D118054
Petr Hosek [Thu, 27 Jan 2022 10:27:18 +0000 (02:27 -0800)]
[CMake][Fuchsia] Only build iossim runtimes for arm64
x86_64 isn't supported with the recent Xcode SDK.
Jay Foad [Wed, 26 Jan 2022 16:50:08 +0000 (16:50 +0000)]
[AMDGPU] SILoadStoreOptimizer: Remove redundant check for volatile
SILoadStoreOptimizer::collectMergeableInsts already ends the current
block if it sees a volatile (or ordered) memory access, so there is no
need to check for them again when scanning the instructions between two
pairing candidates in a block.
Differential Revision: https://reviews.llvm.org/D118266
Matthias Springer [Thu, 27 Jan 2022 10:04:44 +0000 (19:04 +0900)]
[mlir][bufferize] Insert memref.cast ops during finalizing pass
The pass can currently not handle to_memref(to_tensor(x)) folding where a cast is necessary. This is required with the new unified bufferization. There is already a canonicalization pattern that handles such foldings and it should be used during this pass.
Differential Revision: https://reviews.llvm.org/D117988
Dawid Jurczak [Tue, 25 Jan 2022 15:53:05 +0000 (16:53 +0100)]
[NFC][CodeGen] Use llvm::DenseMap for DeferredDecls
CodeGenModule::DeferredDecls std::map::operator[] seem to be hot especially while code generating huge compilation units.
In such cases using DenseMap instead gives observable compile time improvement. Patch was tested on Linux build with default config acting as benchmark.
Build was performed on isolated CPU cores in silent x86-64 Linux environment following: https://llvm.org/docs/Benchmarking.html#linux rules.
Compile time statistics diff produced by perf and time before and after change are following:
instructions -0.15%, cycles -0.7%, max-rss +0.65%.
Using StringMap instead DenseMap doesn't bring any visible gains.
Differential Revision: https://reviews.llvm.org/D118169
Florian Hahn [Thu, 27 Jan 2022 09:55:38 +0000 (09:55 +0000)]
[LoopVersioning] Use IRBuilder for OR simplification.
Sergej Jaskiewicz [Thu, 20 Jan 2022 13:36:41 +0000 (16:36 +0300)]
[LLDB] Add formatters for PointerIntPair, PointerUnion
Also, add summaries for `SmallVector` and `ArrayRef`,
and fix the `StringRef` summary provider so it doesn't
ignore the `Length` field.
Differential Revision: https://reviews.llvm.org/D117779
Nikita Popov [Thu, 27 Jan 2022 09:51:45 +0000 (10:51 +0100)]
[InstCombine] Skip GEP of bitcast transform with opaque pointers
This transform is fundamentally incompatible with opaque pointers.
Usually we would not hit it anyway because the bitcast is folded
away earlier, but due to worklist order it might survive until
here, so make sure we bail out explicitly.