Lawrence D'Anna [Tue, 2 Nov 2021 21:29:55 +0000 (14:29 -0700)]
[lldb] update TestEchoCommands
Followup to https://reviews.llvm.org/D112988
Sorry, I broke this test. The test was verifying the bad behavior
of --source-quietly that the previous change fixed -- namely that
it still echos the initial list of startup commands while
sourcing them.
Updated the test to verify that --source-quietly is quiet, rather than
loud.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D113047
Jonas Devlieghere [Tue, 2 Nov 2021 20:28:14 +0000 (13:28 -0700)]
[lldb] Improve error reporting in `lang objc tagged-pointer info`
Improve error handling for the lang objc tagged-pointer info. Rather
than failing silently, report an error if we couldn't convert an
argument to an address or resolve the class descriptor.
(lldb) lang objc tagged-pointer info 0xbb6404c47a587764
error: could not get class descriptor for 0xbb6404c47a587764
(lldb) lang objc tagged-pointer info n1
error: could not convert 'n1' to a valid address
Differential revision: https://reviews.llvm.org/D112945
Florian Hahn [Tue, 2 Nov 2021 20:17:55 +0000 (21:17 +0100)]
[LV] Add test case from PR51794 for over-eager truncation.
This patch adds a test case for PR51794 where reductions are performed
on types that are too small.
Aart Bik [Tue, 2 Nov 2021 21:05:51 +0000 (14:05 -0700)]
[mlir][sparse] bazel correction after filename change
Reviewed By: GMNGeoffrey, rdzhabarov
Differential Revision: https://reviews.llvm.org/D113052
Rich Lowe [Tue, 2 Nov 2021 21:06:17 +0000 (22:06 +0100)]
[sanitizer_common] Fix readlink error handling in sanitizer_procmaps_solaris.cpp
As pointed out in Bug 52371, the Solaris version of
`MemoryMappingLayout::Next` completely failed to handle `readlink` errors
or properly NUL-terminate the result.
This patch fixes this. Originally provided in the PR with slight
formatting changes.
Tested on `amd64-pc-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D112998
Yaxun (Sam) Liu [Tue, 2 Nov 2021 20:24:04 +0000 (16:24 -0400)]
Revert "[clang] deprecate frelaxed-template-template-args, make it on by default"
This reverts commit
2d7fba5f95f0614f6f2c4a4ed966b307d617898b.
The patch was reverted because it caused regression with rocThrust
due to ambiguity of template specialization.
For details please see https://reviews.llvm.org/D109496
Vy Nguyen [Tue, 2 Nov 2021 20:57:51 +0000 (16:57 -0400)]
Revert "[lld-macho] Change bitfield types to be identical."
This reverts commit
ae31f9fbaddd57a3c1c63bfd7baf1511122a49f7.
Reason: bitfields can't be merged across parent/child classes anyway. So this change doesn't help.
HarrietAkot [Tue, 2 Nov 2021 20:29:56 +0000 (13:29 -0700)]
[mlir][sparse] Rename SparseUtils.cpp file to SparseTensorUtils.cpp
Bug 52304 - Rename the sparse runtime support library cpp file
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D113043
Nikita Popov [Tue, 2 Nov 2021 20:26:26 +0000 (21:26 +0100)]
[BasicAA] Check known access sizes earlier (NFC)
All heuristics for variable accesses require both access sizes to
be known, so check this once at the start, rather than for each
particular heuristic.
Nikita Popov [Tue, 2 Nov 2021 20:16:24 +0000 (21:16 +0100)]
[BasicAA] Use early returns (NFC)
Reduce nesting in aliasGEP() a bit by returning early.
Simon Pilgrim [Tue, 2 Nov 2021 20:03:11 +0000 (20:03 +0000)]
[X86][AVX] combineConcatVectorOps - use getBROADCAST_LOAD helper for splat of normal vector loads. NFCI.
Reapplied from rG1cfecf4fc427 with fix for PR51226 - ensure the load is a normal (non-ext) load.
Martin Storsjö [Fri, 22 Oct 2021 21:54:42 +0000 (00:54 +0300)]
[libcxx] [test] Remove a LIBCXX-WINDOWS-FIXME, don't test an unsupported strftime() pattern
Testing the unsupported pattern can trigger the invalid parameter handler,
which depending on CRT configuration can abort the process.
Differential Revision: https://reviews.llvm.org/D112352
Vy Nguyen [Tue, 2 Nov 2021 19:14:38 +0000 (15:14 -0400)]
[lld-macho] Change bitfield types to be identical.
Symbol's subclasses all have an additional bitfield of type uint8_t (RefState enum).
For the bitfields in the same block tomerge, they should be of the same type. (clang/gcc will work, but others like MSVC does not)
Differential Revision: https://reviews.llvm.org/D113040
Nikita Popov [Fri, 29 Oct 2021 21:38:44 +0000 (23:38 +0200)]
[BasicAA] Use saturating multiply on range if nsw
If we know that the var * scale multiplication is nsw, we can use
a saturating multiplication on the range (as a good approximation
of an nsw multiply). This recovers some cases where the fix from
D112611 is unnecessarily strict. (This can be further strengthened
by using a saturating add, but we currently don't track all the
necessary information for that.)
This exposes an issue in our NSW tracking for multiplies. The code
was assuming that (X +nsw Y) *nsw Z results in
(X *nsw Z) +nsw (Y *nsw Z) -- however, it is possible that the
distributed multiplications overflow, even if the non-distributed
one does not. We should discard the nsw flag if the the offset is
non-zero. If we just have (X *nsw Y) *nsw Z then concluding
X *nsw (Y *nsw Z) is fine.
Differential Revision: https://reviews.llvm.org/D112848
Jinsong Ji [Tue, 2 Nov 2021 18:57:58 +0000 (18:57 +0000)]
[AIX] Avoid depending on objdump
On AIX, we are currently relying on `objdump` to detemine the
is_32_bit_windows.
`objdump` is not installed by default on AIX, it is creating problem to
depend on it, especially just for an always false detection on AIX.
So this patch simply provide a always false function to satify the
detection.
Reviewed By: #powerpc, daltenty
Differential Revision: https://reviews.llvm.org/D112952
Chih-Ping Chen [Fri, 29 Oct 2021 15:46:53 +0000 (11:46 -0400)]
[CodeView] Fortran debug info emission in Code View.
Differential Revision: https://reviews.llvm.org/D112826
Elizabeth Andrews [Mon, 1 Nov 2021 20:28:20 +0000 (13:28 -0700)]
Fix complex types declared using mode TC
This patch reverts incorrect IR introduced in commit
d11ec6f67e45
[Clang] Enable IC/IF mode for __ibm128, for complex types declared
using __attribute__((mode(TC))). TC corresponds to an unspecified
128-bit format, which on some targets is a double-double format
(like __ibm128_t) and on others is float128_t. The bug in
d11ec6f67e45
is that long double is only safe to use when it's known to be one of
these formats.
Differential Revision: https://reviews.llvm.org/D112975
Simon Pilgrim [Tue, 2 Nov 2021 18:56:18 +0000 (18:56 +0000)]
[X86][AVX] Add PR51226 test case
Christopher Tetreault [Tue, 2 Nov 2021 16:53:52 +0000 (09:53 -0700)]
[NFC] Reformat VerifyPreservedCFG for non-CPP-aware syntax highlighters
* Move `);` outside the #ENDIF. Syntax highlighters that highlight missed
closing parens, but are not aware of the C Preprocessor saw the original
code as having missed parens.
Andrzej Warzynski [Tue, 2 Nov 2021 10:13:49 +0000 (10:13 +0000)]
[flang][CodeGen] Transform `fir.unreachable` to `llvm.unreachable`
This patch extends the `FIRToLLVMLowering` pass in Flang by adding a
hook to transform `fir.unreachable` to `llvm.unreachable`.
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Differential Revision: https://reviews.llvm.org/D113023
Stanislav Mekhanoshin [Tue, 2 Nov 2021 18:13:30 +0000 (11:13 -0700)]
[InstCombine] Precommit updated and-xor-or.ll tests. NFC.
Tests for (~a & b & c) | ~(a | b) -> (c | ~b) & ~a
Med Ismail Bennani [Tue, 2 Nov 2021 18:10:50 +0000 (18:10 +0000)]
Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM"
This reverts commit
6fd2db04d0f22ea22c5317d98ce2126aa64b6a73 since it
broke GreenDragon LLDB-Incremental bot:
https://green.lab.llvm.org/green/job/lldb-cmake/37560/console
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Simon Pilgrim [Tue, 2 Nov 2021 17:54:26 +0000 (17:54 +0000)]
[X86][AVX] combineConcatVectorOps - use getBROADCAST_LOAD helper. NFCI.
This is part of rG1cfecf4fc427 that was reverted to fix PR51226 - concating the broadcasts is OK, its the splatted loads that crash (we're not detecting extloads). I'm still creating a reduced test case so haven't added the load handling again yet.
Lawrence D'Anna [Tue, 2 Nov 2021 18:01:53 +0000 (11:01 -0700)]
[lldb] fix --source-quietly
Jim says:
lldb has a -Q or --source-quietly option, which supposedly does:
--source-quietly Tells the debugger to execute this one-line lldb command before any file has been loaded.
That seems like a weird description, since we don't generally use source for one line entries, but anyway, let's try it:
> $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q "script print('I should be quiet')" a.out -O "script print('I should be before')" -o "script print('I should be after')"
(lldb) script print('I should be before')
I should be before
(lldb) target create "script print('I should be quiet')"
error: unable to find executable for 'script print('I should be quiet')'
That was weird. The first real -O gets sourced but not quietly, then the argument to the -Q gets treated as the target.
> $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q a.out -O "script print('I should be before')" -o "script print('I should be after')"
(lldb) script print('I should be before')
I should be before
(lldb) target create "a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) script print('I should be after')
I should be after
Well, that's a little better, but the -Q option seems to have done nothing.
---
This fixes the description of --source-quietly, as well as causing it
to actually suppress echoing while executing the initialization
commands.
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D112988
Nico Weber [Tue, 2 Nov 2021 14:13:27 +0000 (10:13 -0400)]
[lld/mac] Write -v output to stderr
This matches ld64, and it's conceivable that projects try to read
this information off stderr for that reason.
--version keeps writing to stdout.
Differential Revision: https://reviews.llvm.org/D113020
Dave Lee [Tue, 2 Nov 2021 17:45:31 +0000 (10:45 -0700)]
[clang] Fix cmake error
Nico Weber [Tue, 2 Nov 2021 14:35:45 +0000 (10:35 -0400)]
[cmake] Make LLVM_ENABLE_LLD=ON work better on macOS
LLVM_LINKER_IS_LLD is now set with LLVM_ENABLE_LLD=ON (or LLVM_USER_LINKER=lld)
even on APPLE, and we pass -Wl,-order_file when LLVM_LINKER_IS_LLD on APPLE
too.
To make this straightforward, change the linker detection logic to go through
the compiler driver on APPLE like on the other platforms.
No intended behavior change if LLVM_ENABLE_LLD isn't set.
Differential Revision: https://reviews.llvm.org/D113021
Craig Topper [Tue, 2 Nov 2021 15:57:24 +0000 (08:57 -0700)]
[RISCV] Rename vfredusum/vfredosum intrinsic test files. Merge some tests. NFC
I recently renamed some tests from vfredsum to vfredusum without
noticing they tested both ordered and unordered reductions. This
patch renames them back.
I've also merged test files for vfwredosum/vfwredusum into a single
file for consistency with the other 3 floating point reduction test
files. The inconsistency is what caused my original confusion.
Fraser Cormack [Tue, 2 Nov 2021 14:44:05 +0000 (14:44 +0000)]
[RISCV] Optimize vp.load with an all-ones mask
Similar to D110206, this patch optimizes unmasked vp.load intrinsics to
avoid the need of a vmset instruction to set the mask. It does so by
selecting a riscv_vle intrinsic rather than a riscv_vle_mask intrinsic.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D113022
Sanjay Patel [Tue, 2 Nov 2021 14:35:08 +0000 (10:35 -0400)]
[InstCombine] add tests for bitwise select of vectors; NFC
Tres Popp [Tue, 2 Nov 2021 17:15:16 +0000 (18:15 +0100)]
Specify explicit casts of types in pair construction
This was failing on some platforms.
Tres Popp [Tue, 2 Nov 2021 17:02:39 +0000 (18:02 +0100)]
Revert "Update bazel file after
fe364e5dc78c58a915986d9a44cfd65f919a00c2"
This reverts commit
8af9912113fb74f4fcc5457f9e830337fff19df1.
The other relevant commit was reverted.
Fraser Cormack [Mon, 1 Nov 2021 16:49:51 +0000 (16:49 +0000)]
[RISCV][VP] Mangle pointers in vp.load and vp.store tests
Although this isn't required, it better matches the suggested syntax as
per the documentation work ongoing in D112930.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D112939
Vy Nguyen [Tue, 2 Nov 2021 15:44:03 +0000 (11:44 -0400)]
[lld-macho] Remove no_dtrace_dof from un-implemented group.
One fewer warning.
In practice, lld already "implements" it. (ie., it does not do dtrace-dof processing ever).
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D112934
Tres Popp [Tue, 2 Nov 2021 16:22:11 +0000 (17:22 +0100)]
Dmitry Makogon [Tue, 2 Nov 2021 16:09:37 +0000 (23:09 +0700)]
[LoopPeel] Peel loops with exits followed by an unreachable or deopt block
Added support for peeling loops with exits that are followed either by an
unreachable-terminated block or block that has a terminatnig deoptimize call.
All blocks in the sequence must have an unique successor, maybe except
for the last one.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D110922
Arthur Eubanks [Tue, 2 Nov 2021 16:08:09 +0000 (09:08 -0700)]
Revert "[NFC] Remove LinkAll*.h"
This reverts commit
fe364e5dc78c58a915986d9a44cfd65f919a00c2.
Causes breakages, e.g. https://lab.llvm.org/buildbot/#/builders/188/builds/5266
Jamie Schmeiser [Tue, 2 Nov 2021 16:03:05 +0000 (12:03 -0400)]
Add new choices dot-cfg and dot-cfg-quiet to print-changed.
Summary:
Add new options -print-changed=[dot-cfg | dot-cfg-quiet] which create
a website of DOT files showing colourized changes as the IR is changed
by passes in the new pass manager pipeline.
A new change reporter is introduced that creates a website of changes made
by passes in the opt pipeline that change the IR. The hidden option
-dot-cfg-dir=<dir> specifies a directory (defaulting to "./") into which the
website will be created.
A file passes.html is created that contains a list of all the passes that
act on the IR. Those that do not change the IR are listed as omitted
because of no change, ignored or filtered out (using -filter-print-func
and -filter-passes) or not listed in quiet mode. Those that
do change the IR are listed as a link to a DOT file which contains a
CFG depiction of the IR (ala -dot-cfg) except that the instructions,
basic blocks and links that are only in the IR before the pass (ie, removed)
and those that are only in the IR after the pass (ie, added) are shown in
red and green, respectively, while the aspects of the CFG that do not change
are shown in black. Additional hidden options
-dot-cfg-before-color=<dot named color>,
-dot-cfg-after-color=<dot named color> and
-dot-cfg-common-color=<dot named color> are defined that allow the
customization of the colors used in colorizing the CFG.
-change-printer-dot-path=<path to dot exe> is also added.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D87202
Valentin Clement [Tue, 2 Nov 2021 15:53:18 +0000 (16:53 +0100)]
[fir] Add fir.zero_bits conversion pattern to LLVM IR dialect
This patch adds the ZeroOpConversion pattern to LLVM IR dialect.
Conversion of aggregate types is not implemented yet and will trigger a
failure to legalize the operation. This is tested in the
convert-to-llvm-invalid.fir test file.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D113014
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Arthur Eubanks [Sun, 31 Oct 2021 04:31:41 +0000 (21:31 -0700)]
[llvm-reduce] Reduce more GlobalValue properties
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D112885
Arthur Eubanks [Sun, 31 Oct 2021 02:27:35 +0000 (19:27 -0700)]
[llvm-reduce] Reduce some GlobalObject properties
Specifically, the section and the alignment.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D112884
Arthur Eubanks [Tue, 2 Nov 2021 15:46:46 +0000 (08:46 -0700)]
[gn build] Add missing llvm-reduce dependency
Arthur Eubanks [Mon, 1 Nov 2021 23:45:21 +0000 (16:45 -0700)]
[NFC] Remove LinkAll*.h
These were added to prevent functions from being removed by WPO.
But that doesn't make sense, correct WPO will not remove functions we actually use.
I noticed these because compiling cc1_main.cpp was pulling in random LLVM pass headers.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D112971
Arthur Eubanks [Tue, 2 Nov 2021 15:42:24 +0000 (08:42 -0700)]
[gn build] Manually port
6fd2db04
Jay Foad [Wed, 27 Oct 2021 09:19:47 +0000 (10:19 +0100)]
[Hexagon] Add machine verification to some tests
Vy Nguyen [Tue, 26 Oct 2021 19:14:25 +0000 (15:14 -0400)]
[lld-macho][nfc][cleanup] Fix a few code style lints and clang-tidy findings
- Use .empty() instead of `size() == 0` when possible.
- Use const-ref to avoid copying
Differential Revision: https://reviews.llvm.org/D112978
Pavel Labath [Tue, 2 Nov 2021 15:09:14 +0000 (16:09 +0100)]
[lldb] Remove ConstString from TypeSystem and REPL plugin names
thomasraoux [Tue, 2 Nov 2021 15:03:07 +0000 (08:03 -0700)]
[mlir][gpuTonvvm] Remove hardcoded values in MMAType to llvm struct
Also relax the types allowed in GPU wmma ops
Differential Revision: https://reviews.llvm.org/D112969
Dmitry Makogon [Tue, 2 Nov 2021 15:01:22 +0000 (22:01 +0700)]
[Test] Regenerate IndVars test's checks
This just regenerates a certain IndVars test's checks.
Jay Foad [Wed, 27 Oct 2021 15:05:40 +0000 (16:05 +0100)]
[AMDGPU] Really preserve LiveVariables in SILowerControlFlow
https://bugs.llvm.org/show_bug.cgi?id=52204
Differential Revision: https://reviews.llvm.org/D112731
thomasraoux [Tue, 2 Nov 2021 14:41:16 +0000 (07:41 -0700)]
[mlir][VectorToGPU] Add support for elementwise mma to vector to GPU
Differential Revision: https://reviews.llvm.org/D112960
Matt Morehouse [Tue, 2 Nov 2021 15:00:27 +0000 (08:00 -0700)]
[HWASan] Print short tags in tag mismatch description.
I recently spent some extra time debugging a false positive because I
didn't realize the "real" tag was in the short granule. Adding the
short tag here makes it more obvious that we could be dealing with a
short granule.
Reviewed By: hctim, eugenis
Differential Revision: https://reviews.llvm.org/D112949
Matt Morehouse [Tue, 2 Nov 2021 14:59:16 +0000 (07:59 -0700)]
[HWASan] Print short tags in __hwasan_print_shadow.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D112959
Dmitry Makogon [Tue, 2 Nov 2021 14:56:07 +0000 (21:56 +0700)]
[Test] Fix tests showing generation of already existent PHIs by GVN
Add target triple to the test module, so IndVars has a TTI to perform
congruent IVs elimination.
Fraser Cormack [Mon, 1 Nov 2021 11:39:01 +0000 (11:39 +0000)]
[LangRef][VP] Correct mask type in vp.slice documentation
The mask type for the llvm.experimental.vp.splice intrinsics must have
the same number of elements as the result type.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D112924
Matt [Tue, 2 Nov 2021 14:43:34 +0000 (14:43 +0000)]
Revert "[AArch64][SVE] Combine predicated FMUL/FADD into FMA"
This reverts commit
fc28a2f8ced4ff3565f2c47fead824a017c25d21.
Dmitry Makogon [Tue, 2 Nov 2021 14:43:03 +0000 (21:43 +0700)]
[Test] Add tests showing congruent IVs not removed by IndVars
In the added cases we have two congruent IVs. IndVars widens at least one of them.
If they are both widened, then one of them is erased as they stay congruent after
widening. However if only one IV is widened, the other one stays in the loop.
We can simply erase the narrow IV and replace its uses with truncates of the
widest IV.
Fraser Cormack [Tue, 2 Nov 2021 14:04:08 +0000 (14:04 +0000)]
[RISCV][VP] Add tests for "unmasked" VP loads
These aren't currently matched against unmasked vector load
instructions. A patch to fix that will come later.
Sam McCall [Fri, 20 Aug 2021 08:01:45 +0000 (10:01 +0200)]
[Sema] Avoid crash in CheckEnumConstant with contains-error expressions
Fixes https://bugs.llvm.org/show_bug.cgi?id=51554
Differential Revision: https://reviews.llvm.org/D108451
John Ericson [Sun, 4 Apr 2021 17:02:18 +0000 (13:02 -0400)]
Use `GNUInstallDirs` to support custom installation dirs. -- LLVM
This is a new draft of D28234. I previously did the unorthodox thing of
pushing to it when I wasn't the original author, but since this version
- Uses `GNUInstallDirs`, rather than mimics it, as the original author
was hesitant to do but others requested.
- Is much broader, effecting many more projects than LLVM itself.
I figured it was time to make a new revision.
I am using this patch (and many back-ports) as the basis of
https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It
looked like people were generally on board in D28234, but I make note of
this here in case extra motivation is useful.
---
As pointed out in the original issue, a central tension is that LLVM
already has some partial support for these sorts of things. For example
`LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not
quite clear yet what to do about those, we are holding off on changing
libdirs and `compiler-rt`. for this initial PR.
---
On the advice of @lebedev.ri, I am splitting this up a bit per
subproject, starting with LLVM. To allow it to be more easily reviewed. This and the subsequent patch must be landed together, as this will not build alone. But the rest can be landed on their own.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D100810
Youngsuk Kim [Tue, 2 Nov 2021 14:05:54 +0000 (15:05 +0100)]
[SimpleLoopUnswitch] Remove duplicate include.
Header "llvm/Transforms/Scalar/SimpleLoopUnswitch.h" is currently
included twice. This commit removes the duplicate 'include' line.
Previous commit
693eedb13833245e2670308fa0e6fe47324ce553
seems to have mistakenly added the duplicate 'include'.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D112979
Alex Zinenko [Tue, 2 Nov 2021 14:05:45 +0000 (15:05 +0100)]
[mlir] replace class with struct in a forward declaration
Silence the warning.
Differential Revision: https://reviews.llvm.org/D113018
Sanjay Patel [Tue, 2 Nov 2021 13:42:41 +0000 (09:42 -0400)]
[InstCombine] change 'not' match for bitwise select
The tests diffs are logically equivalent, and so this is
generally NFC, but this makes the code match the code
comment.
It should also be more efficient. If we choose the 'not'
operand (rather than the 'not' instruction) as the select
condition, then we don't have to invert the select
condition/operands as a subsequent transform.
Alex Zinenko [Tue, 2 Nov 2021 14:15:03 +0000 (15:15 +0100)]
[mlir] drop spurious semicolon
Simon Pilgrim [Tue, 2 Nov 2021 13:07:36 +0000 (13:07 +0000)]
[X86][AVX] SimplifyDemandedVectorEltsForTargetNode - use getBROADCAST_LOAD helper. NFCI.
Reduce width of X86ISD::SUBV_BROADCAST_LOAD node.
Simon Pilgrim [Tue, 2 Nov 2021 12:52:05 +0000 (12:52 +0000)]
[X86][AVX] lowerV2X128Shuffle - use getBROADCAST_LOAD helper. NFCI.
Florian Hahn [Tue, 2 Nov 2021 14:01:41 +0000 (15:01 +0100)]
[Clang] Add min/max reduction builtins.
This patch implements __builtin_reduce_max and __builtin_reduce_min as
specified in D111529.
The order of operations does not matter for min or max reductions and
they can be directly lowered to the corresponding
llvm.vector.reduce.{fmin,fmax,umin,umax,smin,smax} intrinsic calls.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D112001
Lei Zhang [Tue, 2 Nov 2021 13:55:34 +0000 (09:55 -0400)]
[mlir][linalg] Rewrite `linalg.conv_2d_nhwc_hwcf` into 1-D
We'd like to take a progressive approach towards Fconvolution op
CodeGen, by 1) tiling it to fit compute hierarchy first, and then
2) tiling along window dimensions with size 1 to reduce the problem
to be matmul-like. After that, we can 3) downscale high-D convolution
ops to low-D by removing the size-1 window dimensions. The final
step would be 4) vectorizing the low-D convolution op directly.
We have patterns for 1), 2), and 4). This commit adds a pattern for
3) for `linalg.conv_2d_nhwc_hwcf` ops as a starter. Supporting other
high-D convolution ops should be similar and mechanical.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D112928
Daniele Vettorel [Tue, 2 Nov 2021 13:52:46 +0000 (09:52 -0400)]
[Scalarizer] Do not insert instructions between PHI nodes and debug intrinsics.
The scalarizer pass seems to be inserting instructions in-between PHI nodes or debug intrinsics that end up staying at the end of the pass, resulting in malformed IR and violating assumptions.
This patch adds a check to make sure the `extractelement` instructions that it adds are correctly placed after all PHI nodes and debug intrinsics.
Patch by vettoreldaniele.
Reviewed By: bjope
Differential Revision: https://reviews.llvm.org/D112472
LLVM GN Syncbot [Tue, 2 Nov 2021 13:45:10 +0000 (13:45 +0000)]
[gn build] Port
9b5c9c469d90
Balazs Benics [Tue, 2 Nov 2021 13:42:14 +0000 (14:42 +0100)]
[analyzer] Dump checker name if multiple checkers evaluate the same call
Previously, if accidentally multiple checkers `eval::Call`-ed the same
`CallEvent`, in debug builds the analyzer detected this and crashed
with the message stating this. Unfortunately, the message did not state
the offending checkers violating this invariant.
This revision addresses this by printing a more descriptive message
before aborting.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D112889
Sam McCall [Thu, 28 Oct 2021 22:48:42 +0000 (00:48 +0200)]
[AST] injected-class-name is not a redecl, even in template specializations
Back in the mists of time, the CXXRecordDecl for the injected-class-name was
a redecl of the outer class itself.
This got changed in
470c454a6176ef31474553e408c90f5ee630df89, but only for plain
classes: class template instantation was still detecting the injected-class-name
in the template body and marking its instantiation as a redecl.
This causes some subtle inconsistent behavior between the two, e.g.
hasDefinition() returns true for Foo<int>::Foo but false for Bar::Bar.
This is the root cause of PR51912.
Differential Revision: https://reviews.llvm.org/D112765
Martin Liska [Tue, 2 Nov 2021 08:34:09 +0000 (09:34 +0100)]
Fix building with GCC 12:
Fixes: https://bugs.llvm.org/show_bug.cgi?id=52380
Differential Revision: https://reviews.llvm.org/D112990
Jay Foad [Tue, 2 Nov 2021 13:19:43 +0000 (13:19 +0000)]
[AMDGPU] More robust checks in extract_vector_dynelt.ll
Alex Zinenko [Tue, 2 Nov 2021 11:39:36 +0000 (12:39 +0100)]
[mlir] provide C API and Python bindings for symbol tables
Symbol tables are a largely useful top-level IR construct, for example, they
make it easy to access functions in a module by name instead of traversing the
list of module's operations to find the corresponding function.
Depends On D112886
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D112821
Alex Zinenko [Tue, 2 Nov 2021 11:38:01 +0000 (12:38 +0100)]
[mlir] return the updated symbol table after inserting into SymbolTable
Inserting a symbol into a SymbolTable may lead to the name of the symbol being
changed in order to ensure uniqueness of symbol names in the table. Return this
new name to spare the caller the need to extract it from the symbol operation.
Depends On D112700
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D112886
jacquesguan [Tue, 2 Nov 2021 11:13:04 +0000 (11:13 +0000)]
[DAGCombiner] Teach combineShiftToMULH to handle constant and const splat vector.
Fold (srl (mul (zext i32:$a to i64), i64:c), 32) -> (mulhu $a, $b),
if c can truncate to i32 without loss.
Reviewed By: frasercrmck, craig.topper, RKSimon
Differential Revision: https://reviews.llvm.org/D108129
David Callahan [Tue, 2 Nov 2021 11:55:12 +0000 (11:55 +0000)]
[RISCV] Fix invalid kill on callee save
A callee save may be live (specifically X1) on entry and so a spill
should not mark it killed.
Differential Revision: https://reviews.llvm.org/D111285
Raphael Isemann [Tue, 2 Nov 2021 11:39:25 +0000 (12:39 +0100)]
[lldb] Fix a use-after-free in FindFileTest.cpp
ArrayRef doesn't take ownership.
Simon Pilgrim [Tue, 2 Nov 2021 11:38:25 +0000 (11:38 +0000)]
[SelectionDAG] Optimize expansion for rotates/funnel shifts
If the type of a funnel shift needs to be expanded, expand it to two funnel shifts instead of regular shifts. For constant shifts, this doesn't make much difference, but for variable shifts it allows a more optimal lowering.
Also use the optimized funnel shift lowering for rotates.
Alive2: https://alive2.llvm.org/ce/z/TvHDB- / https://alive2.llvm.org/ce/z/yzPept
(Branched from D108058 as getting this completed should help unlock some other WIP patches).
Original Patch: @efriedma (Eli Friedman)
Differential Revision: https://reviews.llvm.org/D112443
Simon Pilgrim [Tue, 2 Nov 2021 11:24:35 +0000 (11:24 +0000)]
[DAG] MatchRotate - remove (redundant) legal type check.
Rely on the hasOperation() instead - as commented on D77804, the mid-term intention is to recognise rotate/funnel-by-constant pre-legalization to help avoid SimplifyDemandedBits regressions.
Tres Popp [Tue, 2 Nov 2021 11:00:32 +0000 (12:00 +0100)]
[bazel] Update BUILD file for llvm-reduce
This is needed after
fd41738e2ca975b6d3bea021ef38e6d49f27a71b
Guillaume Chatelet [Tue, 2 Nov 2021 11:00:32 +0000 (11:00 +0000)]
[libc] Add more robust compile time architecture detection
We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think we can handle these:
- config/linux/api.td:205
- config/linux/api.td:199
Differential Revision: https://reviews.llvm.org/D112818
David Carlier [Tue, 2 Nov 2021 10:35:26 +0000 (10:35 +0000)]
[sanitizers] remove extra comma for sha2 interceptors
David Green [Tue, 2 Nov 2021 10:32:22 +0000 (10:32 +0000)]
[ARM] Some extra gather/scatter tests. NFC
Balázs Kéri [Tue, 2 Nov 2021 09:30:14 +0000 (10:30 +0100)]
[clang-tidy] Add check 'cert-err33-c'.
The CERT rule ERR33-C can be modeled partially by the existing check
'bugprone-unused-return-value'. The existing check is reused with
a fixed set of checked functions.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D112409
Matthias Springer [Tue, 2 Nov 2021 07:05:53 +0000 (16:05 +0900)]
[mlir][linalg][bufferize] Move BufferizableOpInterface implementations
This commit moves parts of the existing bufferization code into external op interface implementations. Furthermore, Comprehensive Bufferize is adapted to use the new interface.
Future commits will decouple the interface and its op implementations from Comprehensive Bufferize and the Linalg dialect, as well as split them into multiple files with their own build targets. This commit leaves the file structure and build rules mostly unchanged.
Differential Revision: https://reviews.llvm.org/D112900
LLVM GN Syncbot [Tue, 2 Nov 2021 09:21:12 +0000 (09:21 +0000)]
[gn build] Port
fd41738e2ca9
Matthias Springer [Tue, 2 Nov 2021 07:05:27 +0000 (16:05 +0900)]
[mlir][linalg][bufferize] Add BufferizableOpInterface
This commit adds a new op interface: BufferizableOpInterface. In the future, ops that implement this interface can be bufferized using Comprehensive Bufferize.
Note: The interface methods of this interface correspond to the "op interface" in ComprehensiveBufferize.cpp.
Differential Revision: https://reviews.llvm.org/D112974
Frederic Cambus [Mon, 1 Nov 2021 21:46:30 +0000 (22:46 +0100)]
[llvm-readobj] Add support for reading OpenBSD ELF core notes.
Notes generated in OpenBSD core files provide additional information
about the kernel state and CPU registers. These notes are described
in core.5, which can be viewed here: https://man.openbsd.org/core.5
Differential Revision: https://reviews.llvm.org/D111966
Markus Lavin [Tue, 2 Nov 2021 09:11:54 +0000 (10:11 +0100)]
Recommit "[llvm-reduce] Add MIR support"
(Second try. Need to link against CodeGen and MC libs.)
The llvm-reduce tool has been extended to operate on MIR (import, clone and
export). Current limitation is that only a single machine function is
supported. A single reducer pass that operates on machine instructions (while
on SSA-form) has been added. Additional MIR specific reducer passes can be
added later as needed.
Differential Revision: https://reviews.llvm.org/D110527
Raphael Isemann [Tue, 2 Nov 2021 09:08:03 +0000 (10:08 +0100)]
[lldb][gmodules] Fix TestDataFormatterGlobals under gmodules
Same reason as in
548dbfaf447cc5fdfc26d34e60e3da08eb609531 -> macOS has a
struct called 'Point' in the libc module. Just remove the redundant includes
here.
Rosie Sumpter [Tue, 26 Oct 2021 11:58:18 +0000 (12:58 +0100)]
[LoopVectorize] Propagate fast-math flags for inloop reductions
This patch updates VPReductionRecipe::execute so that the fast-math
flags associated with the underlying instruction of the VPRecipe are
propagated through to the reductions which are created.
Differential Revision: https://reviews.llvm.org/D112548
serge-sans-paille [Tue, 19 Oct 2021 09:23:27 +0000 (11:23 +0200)]
Fix inline builtin handling in case of redefinition
Basically, inline builtin definition are shadowed by externally visible
redefinition. This matches GCC behavior.
The implementation has to workaround the fact that:
1. inline builtin are renamed at callsite during codegen, but
2. they may be shadowed by a later external definition
As a consequence, during codegen, we need to walk redecls and eventually rewrite
some call sites, which is totally inelegant.
Differential Revision: https://reviews.llvm.org/D112059
Benjamin Kramer [Tue, 2 Nov 2021 08:47:44 +0000 (09:47 +0100)]
LLVM GN Syncbot [Tue, 2 Nov 2021 08:41:58 +0000 (08:41 +0000)]
[gn build] Port
aee7f3384b40
Markus Lavin [Tue, 2 Nov 2021 08:38:57 +0000 (09:38 +0100)]
Revert "[llvm-reduce] Add MIR support"
This reverts commit
bc2773cb1bdfacfda773eb492e7b0cc65a78cda6.
Broke the clang-ppc64le-linux-multistage build. Reverting while I
investigate.
LLVM GN Syncbot [Tue, 2 Nov 2021 08:28:36 +0000 (08:28 +0000)]
[gn build] Port
bc2773cb1bdf
Vitaly Buka [Tue, 2 Nov 2021 08:24:51 +0000 (01:24 -0700)]
Revert "[NFC][sanitizer] Disable a test with large stderr output"
This reverts commit
6eb38e517159f1fa5686d661d2aceb0a4002d8f0.
The test was not the reason of sanitizer-x86_64-linux-android failures.
Markus Lavin [Tue, 2 Nov 2021 08:10:34 +0000 (09:10 +0100)]
[llvm-reduce] Add MIR support
The llvm-reduce tool has been extended to operate on MIR (import, clone and
export). Current limitation is that only a single machine function is
supported. A single reducer pass that operates on machine instructions (while
on SSA-form) has been added. Additional MIR specific reducer passes can be
added later as needed.
Differential Revision: https://reviews.llvm.org/D110527