Louis Dionne [Fri, 25 Mar 2022 21:06:46 +0000 (17:06 -0400)]
[libc++] Implement all public header tests using the new generator
Note that `generate_assertion_tests.py` will be renamed to
`generate_header_tests.py` separately to facilitate change tracking.
Differential Revision: https://reviews.llvm.org/D123000
Nico Weber [Mon, 4 Apr 2022 12:56:07 +0000 (08:56 -0400)]
fix comment typos to cycle bots
Simon Pilgrim [Mon, 4 Apr 2022 12:30:04 +0000 (13:30 +0100)]
[DAG] SimplifySetCC - clang-format add/xor/sub with constant handling. NFC.
Yitzhak Mandelbaum [Fri, 1 Apr 2022 12:51:23 +0000 (12:51 +0000)]
[clang][dataflow] Add support for clang's `__builtin_expect`.
This patch adds basic modeling of `__builtin_expect`, just to propagate the
(first) argument, making the call transparent.
Driveby: adds tests for proper handling of other builtins.
Differential Revision: https://reviews.llvm.org/D122908
Pavel Samolysov [Mon, 4 Apr 2022 08:23:24 +0000 (11:23 +0300)]
[clang][NFC] Extract the EmitAssemblyHelper::TargetTriple member
Few times in different methods of the EmitAssemblyHelper class the following
code snippet is used to get the TargetTriple and then use it's single method
to check some conditions:
TargetTriple(TheModule->getTargetTriple())
The parsing of a target triple string is not a trivial operation and it takes
time to repeat the parsing many times in different methods of the class and
even numerous times in one method just to call a getter
(llvm::Triple(TheModule->getTargetTriple()).getVendor()), for example.
The patch extracts the TargetTriple member of the EmitAssemblyHelper class to
parse the triple only once in the class' constructor.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D122587
Simon Pilgrim [Mon, 4 Apr 2022 11:48:20 +0000 (12:48 +0100)]
[Thumb2] Regenerate thumb2-teq2 tests
PeixinQiao [Mon, 4 Apr 2022 11:46:16 +0000 (19:46 +0800)]
[mlir] Fix the build error in OpenMPToLLVMIRTranslation.cpp
Fix the build error with "-Werror,-Wcovered-switch-default".
Reviewed By: hpmorgan
Differential Revision: https://reviews.llvm.org/D123018
David Green [Mon, 4 Apr 2022 11:45:04 +0000 (12:45 +0100)]
[AArch64] Teach the costmodel about widening muls
A vector mul(sext, sext) or mul(zext, zext) will be code generated as a
single smull or umull instruction. This most notably effects v2i64
multiplies, which are otherwise not legal and need to be expanded.
The oneuse check has also been slightly changed, as it is already
checked from the use of isWideningInstruction in getCastInstrCost.
Differential Revision: https://reviews.llvm.org/D123006
Simon Pilgrim [Mon, 4 Apr 2022 11:24:30 +0000 (12:24 +0100)]
[Thumb2] Regenerate thumb2-teq tests
David Spickett [Fri, 18 Mar 2022 11:48:54 +0000 (11:48 +0000)]
[lldb][AArch64] Update disassembler feature list and add tests for all extensions
This updates the disassembler to enable every optional extension.
Previously we had added things that we added "support" for in lldb.
(where support means significant work like new registers, fault types, etc.)
Something like TME (transactional memory) wasn't added because
there are no new lldb features for it. However we should still be
disassembling the instructions.
So I went through the AArch64 extensions and added all the missing
ones. The new test won't prevent us missing a new extension but it
does at least document our current settings.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D121999
Simon Pilgrim [Mon, 4 Apr 2022 11:19:31 +0000 (12:19 +0100)]
[MIPS] Regenerate countleading tests with common check prefixes
David Green [Mon, 4 Apr 2022 11:19:45 +0000 (12:19 +0100)]
[AArch64] Add widening arithmetic cost tests. NFC
Nikita Popov [Mon, 4 Apr 2022 10:59:17 +0000 (12:59 +0200)]
[ConstantFold] Fold zero-index GEPs with opaque pointers
With opaque pointers, we can eliminate zero-index GEPs even if
they have multiple indices, as this no longer impacts the result
type of the GEP.
This optimization is already done for instructions in InstSimplify,
but we were missing the corresponding constant expression handling.
The constexpr transform is a bit more powerful, because it can
produce a vector splat constant and also handles undef values --
it is an extension of an existing single-index transform.
Nikita Popov [Mon, 4 Apr 2022 11:00:00 +0000 (13:00 +0200)]
[InstSimplify] Add tests for zero-offset opaque ptr constexpr GEP (NFC)
Simon Pilgrim [Mon, 4 Apr 2022 11:02:23 +0000 (12:02 +0100)]
[X86] Regenerate peep tests checks
Muhammad Omair Javaid [Mon, 4 Apr 2022 10:30:57 +0000 (15:30 +0500)]
Revert "[NFCI] Regenerate PhaseOrdering test checks"
This reverts commit
e91fe08999d5f5d7e7777837c529bac692d06c1b.
Breaks following buildbots: https://lab.llvm.org/buildbot/#/builders/171
Andrzej Warzynski [Mon, 28 Mar 2022 16:13:59 +0000 (16:13 +0000)]
[flang] Update the conversion code for fir.coordinate_of
These are mostly small changes to make the code a bit clearer and more
consistent. Summary of changes:
* add missing namespace qualifiers (that's the preference in Flang)
* replace const member methods with static methods (to avoid passing
the *this pointer unnecessarily)
* rename `currentObjTy` (current object type) as `cpnTy` (component
type) - the latter feels more fitting
* remove redundant `return failure();` calls (` return
mlir::emitError` gives the same result)
* updated a few comments
Differential Revision: https://reviews.llvm.org/D122799
Jeremy Morse [Mon, 4 Apr 2022 10:11:24 +0000 (11:11 +0100)]
[DebugInfo] Correctly recognize bitfields when emitting dwarf
Use the "isBitfield" flag for debug types to determine whether something is
a bitfield, rather than trying to guess from it's layout. Fixes
https://bugs.llvm.org/show_bug.cgi?id=44601
Patch by: mahkoh
Differential Revision: https://reviews.llvm.org/D96334
Simon Pilgrim [Mon, 4 Apr 2022 09:51:26 +0000 (10:51 +0100)]
[X86] Support optional NOT stages in the AND(SRL(X,Y),1) -> SETCC(BT(X,Y)) fold
Extension to D122891, peek through NOT() ops, adjusting the condcode as we go.
Simon Pilgrim [Mon, 4 Apr 2022 09:29:20 +0000 (10:29 +0100)]
[X86] Add additional test cases for NOT(AND(SRL(X,Y),1))/AND(SRL(NOT(X(,Y),1) -> SETCC(BT(X,Y))
As suggested in post review on D122891
Florian Hahn [Mon, 4 Apr 2022 09:26:01 +0000 (10:26 +0100)]
[VPlan] Update VPInterleavedAccessInfo to use getVectorLoopRegion.
Update VPInterleavedAccessInfo to use the generic getVectorLoopRegion
helper instead of relying on the entry block being the top-most vector
loop region.
Martin Sebor [Mon, 4 Apr 2022 08:31:03 +0000 (10:31 +0200)]
[SimplifyLibCalls] Optimize memchr() with known char+str and unknown length
If both the character and string are known, but the length
potentially isn't, we can optimize the memchr() call to a select
of either the known position of the character or null.
Split off from https://reviews.llvm.org/D122836.
Martin Sebor [Mon, 4 Apr 2022 08:47:59 +0000 (10:47 +0200)]
[SimplifyLibCalls] Move handling of constant char earlier (NFC)
Handle the simple constant char case before the bitmask optimization.
This will allow extending the code to handle a non-constant size
argument in a followup change.
Split out from https://reviews.llvm.org/D122836.
Valentin Clement [Mon, 4 Apr 2022 08:44:21 +0000 (10:44 +0200)]
[flang][NFC] Add tests for array-value-copy pass with array with pointers
This patch adds tests for the array-value-copy pass with array assignment
involving Fortran pointers.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D122878
Martin Sebor [Mon, 4 Apr 2022 08:36:57 +0000 (10:36 +0200)]
[SimplifyLibCalls] Fold memchr() with size 1
If the memchr() size is 1, then we can convert the call into a
single-byte comparison. This works even if both the string and the
character are unknown.
Split off from https://reviews.llvm.org/D122836.
Martin Sebor [Mon, 4 Apr 2022 08:32:40 +0000 (10:32 +0200)]
[InstCombine] Add additional memchr test (NFC)
And fix some test names / comments.
Florian Hahn [Mon, 4 Apr 2022 08:27:15 +0000 (09:27 +0100)]
[VPlan] Remember previous loop and reset vector loop.
At the moment this is NFC, but will be needed once nested loops are also
modeled as regions. Preparation for D123005.
Nikita Popov [Fri, 1 Apr 2022 14:33:35 +0000 (16:33 +0200)]
[MemCpyOpt] Work around PR54682
As discussed on https://github.com/llvm/llvm-project/issues/54682,
MemorySSA currently has a bug when computing the clobber of calls
that access loop-varying locations. I think a "proper" fix for this
on the MemorySSA side might be non-trivial, but we can easily work
around this in MemCpyOpt:
Currently, MemCpyOpt uses a location-less getClobberingMemoryAccess()
call to find a clobber on either the src or dest location, and then
refines it for the src and dest clobber. This was intended as an
optimization, as the location-less API is cached, while the
location-affected APIs are not.
However, I don't think this really makes a difference in practice,
because I don't think anything will use the cached clobbers on
those calls later anyway. On CTMark, this patch seems to be very
mildly positive actually.
So I think this is a reasonable way to avoid the problem for now,
though MemorySSA should also get a fix.
Differential Revision: https://reviews.llvm.org/D122911
Nikita Popov [Fri, 1 Apr 2022 10:28:21 +0000 (12:28 +0200)]
[Float2Int] Make sure dependent ranges are calculated first (PR54669)
The range calculation in walkForwards() assumes that the ranges of
the operands have already been calculated. With the used visit
order, this is not necessarily the case when there are multiple
roots. (There is nothing guaranteeing that instructions are visited
in topological order.)
Fix this by queuing instructions for reprocessing if the operand
ranges haven't been calculated yet.
Fixes https://github.com/llvm/llvm-project/issues/54669.
Differential Revision: https://reviews.llvm.org/D122817
Jean Perier [Mon, 4 Apr 2022 07:47:03 +0000 (09:47 +0200)]
[flang] Fold instantiated PDT character component length when needed
In case a character component PDT length only depends on kind parameters,
fold it while instantiating the PDT. This is especially important if the
component has an initializer because later semantic phases (offset
computation or runtime type info generation) might get confused and
generate offset/type info that will lead to crashes in lowering.
Differential Revision: https://reviews.llvm.org/D122938
Valentin Clement [Mon, 4 Apr 2022 07:25:28 +0000 (09:25 +0200)]
[flang][NFC] Add tests for fir.address_of
This patch adds FIR to LLVM test for fir.address_of.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D122889
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Fangrui Song [Mon, 4 Apr 2022 06:57:31 +0000 (23:57 -0700)]
[ELF][test] Fix RUN lines in lto/sample-profile.ll
Reported at https://github.com/llvm/llvm-project/issues/54679#issuecomment-
1086862116
Min-Yih Hsu [Fri, 17 Dec 2021 03:34:36 +0000 (11:34 +0800)]
[M68k] Adopt VarLenCodeEmitter for shift / rotate instructions
This patch is covered by existing MC tests.
Min-Yih Hsu [Mon, 4 Apr 2022 05:39:20 +0000 (22:39 -0700)]
[M68k][test] Remove redundant CHECK-LABEL directive
The associated test had a redundant CHECK-LABEL directive that might fail
the test since the inception, but this issue was "burried" by a missing
colon, which was addressed in
fb65aaf0be09936e657d339f3dc8e62666a41956.
Thus, the test finally failed after the said commit.
This patch remove that CHECK-LABEL directive.
Yuanfang Chen [Mon, 4 Apr 2022 03:14:26 +0000 (20:14 -0700)]
Reland "[lit] Use sharding for GoogleTest format"
This relands commit
a87ba5c86d5d72defdbcdb278baad6515ec99463.
Adjust llvm/utils/lit/tests/googletest-timeout.py for new test output.
Argyrios Kyrtzidis [Mon, 4 Apr 2022 04:02:02 +0000 (21:02 -0700)]
[Support/BLAKE3] CMake: Remove the workaround that checks for "CC=ccache /path/to/clang"
The LLVM builders that were doing that have been updated to use "-DLLVM_CCACHE_BUILD=ON" instead.
Augie Fackler [Thu, 31 Mar 2022 18:46:51 +0000 (14:46 -0400)]
AttributorAttributes: guard against TLI being nullptr
I didn't dig into this very much because it appears to be totally valid
(especially once these properties can come from attributes instead
of only from hard-coded library functions) for TLI to not be defined,
and nothing broke when I added this check, including with all my other
patches applied.
Differential Revision: https://reviews.llvm.org/D122917
Augie Fackler [Thu, 31 Mar 2022 14:30:26 +0000 (10:30 -0400)]
CallBase: fix getFnAttr so it also checks the function
Prior to this change, CallBase::hasFnAttr checked the called function to
see if it had an attribute if it wasn't set on the CallBase, but
getFnAttr didn't do the same delegation, which led to very confusing
behavior. This patch fixes the issue by making CallBase::getFnAttr also
check the function under the same circumstances.
Test changes look (to me) like they're cleaning up redundant attributes
which no longer get specified both on the callee and call. We also clean
up the one ad-hoc implementation of this getter over in InlineCost.cpp.
Differential Revision: https://reviews.llvm.org/D122821
Philip Reames [Mon, 4 Apr 2022 03:09:03 +0000 (20:09 -0700)]
[LV] Handle non-integral types when considering interleave widening legality
In general, anywhere we might need to insert a blind bitcast, we need to make sure the types are losslessly convertible.
This fixes pr54634.
Philip Reames [Tue, 29 Mar 2022 03:29:41 +0000 (20:29 -0700)]
[memcpyopt] Restructure store(load src, dest) form of callslotopt for compile time
The search for the clobbering call is fairly expensive if uses are not optimized at construction. Defer the clobber walk to the point in the implementation we need it; there are a bunch of bailouts before that point. (e.g. If the source pointer is not an alloca, we can't do callslotopt.)
On a test case which involves a bunch of copies from argument pointers, this switches memcpyopt from > 1/2 second to < 10ms.
Yuanfang Chen [Mon, 4 Apr 2022 03:04:55 +0000 (20:04 -0700)]
Revert "[lit] Use sharding for GoogleTest format"
This reverts commit
a87ba5c86d5d72defdbcdb278baad6515ec99463.
Breaks bots:
https://lab.llvm.org/buildbot/#/builders/196/builds/10454
Yuanfang Chen [Sat, 2 Apr 2022 19:28:23 +0000 (12:28 -0700)]
[lit] Use sharding for GoogleTest format
This helps lit unit test performance by a lot, especially on windows. The performance gain comes from launching one gtest executable for many subtests instead of one (this is the current situation).
The shards are executed by the test runner and the results are stored in the
json format supported by the GoogleTest. Later in the test reporting stage,
all test results in the json file are retrieved to continue the test results
summary etc.
On my Win10 desktop, before this patch: `check-clang-unit`: 177s, `check-llvm-unit`: 38s; after this patch: `check-clang-unit`: 37s, `check-llvm-unit`: 11s.
On my Linux machine, before this patch: `check-clang-unit`: 46s, `check-llvm-unit`: 8s; after this patch: `check-clang-unit`: 7s, `check-llvm-unit`: 4s.
Reviewed By: yln, rnk
Differential Revision: https://reviews.llvm.org/D122251
Xiang1 Zhang [Mon, 4 Apr 2022 00:27:28 +0000 (08:27 +0800)]
Correct spelling error in TLS-Load-Hoist
Dávid Bolvanský [Sun, 3 Apr 2022 23:14:34 +0000 (01:14 +0200)]
Revert "[NFCI] Regenerate SROA/LoopVectorize test checks"
This reverts commit
14e3450fb57305aa9ff3e9e60687b458e43835c9.
Dávid Bolvanský [Sun, 3 Apr 2022 22:55:54 +0000 (00:55 +0200)]
[NFCI] Regenerate SROA test checks
Dávid Bolvanský [Sun, 3 Apr 2022 22:28:57 +0000 (00:28 +0200)]
[NFCI] Regenerate PhaseOrdering test checks
Dávid Bolvanský [Sun, 3 Apr 2022 22:21:00 +0000 (00:21 +0200)]
[NFCI] Regenerate LoopIdiomRecognize test checks
Nico Weber [Sun, 3 Apr 2022 21:21:06 +0000 (17:21 -0400)]
Revert "[GH54588]Fix ItaniumMangler for NTTP unnamed unions w/ unnamed structs"
This reverts commit
4cf98f973a13c5049322abff43f0dff3c214311b.
The test fails on mac bots, see comments on https://reviews.llvm.org/D122820
Also reverts follow-ups
eb920989865d992093993143ba3c6e71126cbb89 and
861c189d2a5203ba8c8e983e8d2e109c0de153a5.
David Green [Sun, 3 Apr 2022 21:16:39 +0000 (22:16 +0100)]
[AArch64] Remove unsued WideningBaseCost. NFC
The WideningBaseCost is always 0. This removes it to clean up the code.
Louis Dionne [Sun, 3 Apr 2022 16:40:39 +0000 (12:40 -0400)]
[libc++] Remove unused <iosfwd> include from <__debug>
Differential Revision: https://reviews.llvm.org/D122999
Dávid Bolvanský [Sun, 3 Apr 2022 19:55:58 +0000 (21:55 +0200)]
[NFCI] Regenerate LoopVectorize test checks
Kazu Hirata [Sun, 3 Apr 2022 19:54:54 +0000 (12:54 -0700)]
[IR] Remove unused forward declarations (NFC)
Dávid Bolvanský [Sun, 3 Apr 2022 18:54:13 +0000 (20:54 +0200)]
[NFCI] Regenerate instsimplify test checks
Louis Dionne [Sun, 3 Apr 2022 16:47:21 +0000 (12:47 -0400)]
[libc++][NFC] Fix weird indentation in test
Vladislav Khmelevsky [Sun, 20 Mar 2022 14:15:56 +0000 (17:15 +0300)]
[BOLT] AArch64: Read all static relocations
Read static relocs on the same address, as dynamic in order to update
constant island data address properly.
Differential Revision: https://reviews.llvm.org/D122100
Kiran Chandramohan [Sun, 3 Apr 2022 15:23:54 +0000 (15:23 +0000)]
Revert "[Flang][OpenMP] Add semantic check for OpenMP Private, Firstprivate and Lastprivate clauses."
This reverts commit
a2ca6bbda6160c1b474fffd6204bcac9456c7eb1.
D93213 performs some checks to ensure that variables that appear in
statement functions are not in privatisation clauses. The point at
which this check is currently performed, there can be misparses that
cause more constructs to be identified as statement functions. This
can lead to various kinds of errors, hence reverting.
This revert hopefully fixes:
https://github.com/llvm/llvm-project/issues/54477
https://github.com/llvm/llvm-project/issues/54161
https://github.com/llvm/llvm-project/issues/54163
Reviewed By: shraiysh
Differential Revision: https://reviews.llvm.org/D122650
Luboš Luňák [Sun, 3 Apr 2022 15:32:11 +0000 (17:32 +0200)]
[lldb][gui] underline the current token
Just like the non-gui listing already does.
Luboš Luňák [Sun, 3 Apr 2022 15:01:54 +0000 (17:01 +0200)]
[lldb][gui] use symbolic names rather than hardcoded values
Luboš Luňák [Sun, 3 Apr 2022 14:29:44 +0000 (16:29 +0200)]
[lldb][gui] fix background of syntax-highlighted non-selected PC line
It is the PC line, selected or not, that gets the blue-background
highlight. Without this, a keyword like 'bool' got black background
if the line wasn't selected.
And the blue-background highlight is handled by OutputColoredStringTruncated(),
so no point in setting it explicitly in the calling code.
Luboš Luňák [Sun, 3 Apr 2022 14:08:02 +0000 (16:08 +0200)]
[lldb][gui] draw highlight for selected line even if empty
Kazu Hirata [Sun, 3 Apr 2022 15:14:11 +0000 (08:14 -0700)]
Revert "Apply clang-tidy fixes for readability-redundant-declaration in Debug.cpp (NFC)"
This reverts commit
0fe01a9346658c0955b68b123f2b470b018114b1.
The commit caused build failures like:
llvm/lib/Support/Debug.cpp:65:3: error: ‘setCurrentDebugTypes’ was
not declared in this scope; did you mean ‘setCurrentDebugType’?
LLVM GN Syncbot [Sun, 3 Apr 2022 15:09:33 +0000 (15:09 +0000)]
[gn build] Port
e476df5629ee
Nikolas Klauser [Sun, 3 Apr 2022 07:17:01 +0000 (09:17 +0200)]
[libc++][ranges] Implement ranges::max
Reviewed By: Mordante, var-const, #libc
Spies: sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D122002
Kazu Hirata [Sun, 3 Apr 2022 15:04:12 +0000 (08:04 -0700)]
Apply clang-tidy fixes for readability-redundant-declaration in Debug.cpp (NFC)
Kazu Hirata [Sun, 3 Apr 2022 15:04:11 +0000 (08:04 -0700)]
Apply clang-tidy fixes for readability-redundant-member-init in YAMLParser.cpp (NFC)
Danny Mösch [Sun, 3 Apr 2022 13:48:39 +0000 (15:48 +0200)]
[clang-tidy] Add release notes for changes made in
2b21fc5520b39fba555f4e5f2480a5651056be84
Valentin Clement [Sun, 3 Apr 2022 13:25:36 +0000 (15:25 +0200)]
[flang][NFC] Add tests for fir.array_modify in array-value-copy pass
This patch adds some test for the `fir.array_modify` operation
in the array-value-copy pass
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D122809
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Sun, 3 Apr 2022 13:24:20 +0000 (15:24 +0200)]
[flang][NFC] Add more test cases for the array-value-copy pass
This patch adds some test cases for the array-value-copy pass with slices.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D122807
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Sun, 3 Apr 2022 13:21:42 +0000 (15:21 +0200)]
[flang][NFC] Add tests for fir.is_present
This patch adds tests for the `fir.is_present`
translation.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D122813
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Sun, 3 Apr 2022 13:19:38 +0000 (15:19 +0200)]
[flang] Add global and global box initialization tests
This patch addes some global initialization and global
box initialization tests.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D122881
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Sun, 3 Apr 2022 13:17:21 +0000 (15:17 +0200)]
[flang][NFC] Add tests for select constructs
Add tests for fir.select_rank and
fir.select_case.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D122888
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Hirochika Matsumoto [Sun, 3 Apr 2022 13:05:18 +0000 (22:05 +0900)]
Reapply "[InstSimplify][NFC] Add baseline tests for folds of icmp with ctpop"
This change was previously reverted because I forgot rerunning
update_test_checks.py and tests were not actually baseline.
Extracted from: https://reviews.llvm.org/D122757
Louis Dionne [Sun, 3 Apr 2022 12:55:57 +0000 (08:55 -0400)]
[libunwind] Add missing licenses in test files
Dávid Bolvanský [Sun, 3 Apr 2022 12:42:35 +0000 (14:42 +0200)]
[NFCI] Fixed missing colon in CHECK directives - part 2
Iain Sandoe [Sun, 3 Apr 2022 08:50:20 +0000 (09:50 +0100)]
[C++20][Modules] Fix a testcase warning on Windows [NFC].
As reported, using "-DTDIR=%t" with a path name of 'C:\Users\...' causes
a warning to be emitted about the use of \U without following hex digits.
Since the value is only required for the FileCheck cases resolve this by
omitting the -D from the compile lines.
Dávid Bolvanský [Sun, 3 Apr 2022 09:51:33 +0000 (11:51 +0200)]
[NFCI] Fixed missing colon in CHECK directives
Simon Pilgrim [Sun, 3 Apr 2022 09:05:10 +0000 (10:05 +0100)]
[X86] lowerShuffleAsRepeatedMaskAndLanePermute - allow v16i32 sub-lane permutes for v64i8 shuffles
Without VBMI, we are better off permuting v16i32 sub-lanes, even though its a variable shuffle, if it allows us to then shuffle v64i8 inlane repeated masks (PSHUFB etc.)
Fixes #54658
Alexander Shaposhnikov [Sun, 3 Apr 2022 03:57:05 +0000 (03:57 +0000)]
[InstCombine] Fold srem(X, PowerOf2) == C into (X & Mask) == C for positive C
This diff extends InstCombinerImpl::foldICmpSRemConstant to handle the cases
srem(X, PowerOf2) == C and
srem(X, PowerOf2) != C
for positive C.
This addresses the issue https://github.com/llvm/llvm-project/issues/54650
Differential revision: https://reviews.llvm.org/D122942
Test plan: make check-all
Alexander Shaposhnikov [Sun, 3 Apr 2022 03:26:47 +0000 (03:26 +0000)]
[InstCombine][NFC] Add baseline tests for folds of srem(X, PowerOf2) == C
Extracted from: https://reviews.llvm.org/D122942
Test plan: make check-all
Sanjay Patel [Sat, 2 Apr 2022 23:23:42 +0000 (19:23 -0400)]
[InstCombine] limit icmp fold with sub if other sub user is a phi
This is a hacky fix for:
https://github.com/llvm/llvm-project/issues/54558
As discussed there, codegen regressed when we opened up this transform
to allow extra uses (
61580d0949fd3465 ), and it's not clear how to
undo the transforms at the later stage of compilation.
As noted in the code comments, there's a set of remaining folds that
are still limited to one-use, so we can try harder to refine and
expand the limitations on these folds, but it's likely to be an
up-and-down battle as we find and overcome similar regressions.
Differential Revision: https://reviews.llvm.org/D122909
Sanjay Patel [Sat, 2 Apr 2022 22:52:18 +0000 (18:52 -0400)]
[InstCombine] fold fcmp with lossy casted constant (2nd try)
This is a retry of
9397bdc67eb2 - that was reverted until
we had a clang warning in place to alert users about a
possible mistake in source. The warning was added with
ab982eace6e4.
This is noted as a missing clang warning in #54222,
but it is also a missing optimization opportunity.
Alive2 proofs:
https://alive2.llvm.org/ce/z/Q8drDq
https://alive2.llvm.org/ce/z/pE6LRt
I don't see a single conversion for all predicates
using "getFCmpCode" logic, so other predicates are
left as a TODO item.
Groverkss [Sat, 2 Apr 2022 22:36:11 +0000 (04:06 +0530)]
[MLIR][Presburger] Use PresburgerSpace in SetCoalescer
This patch changes the implementation of SetCoalescer to use PresburgerSpace
instead of reimplementing parts of PresburgerSpace.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D122984
Roman Lebedev [Sat, 2 Apr 2022 20:54:33 +0000 (23:54 +0300)]
[InstCombine] Fold `(X | C2) ^ C1 --> (X & ~C2) ^ (C1^C2)`
These two are equivalent,
and i *think* the `and` form is more-ish canonical.
General proof: https://alive2.llvm.org/ce/z/RrF5s6
If constant on the (outer) `xor` is an `undef`,
the whole lane is dead: https://alive2.llvm.org/ce/z/mu4Sh2
However, if the constant on the (inner) `or` is an `undef`,
we must sanitize it first: https://alive2.llvm.org/ce/z/MHYJL7
I guess, producing a zero `and`-mask is optimal in that case.
alive-tv is happy about the entirety of `xor-of-or.ll`.
Roman Lebedev [Sat, 2 Apr 2022 21:03:15 +0000 (00:03 +0300)]
[NFC][InstCombine] Autogenerate check lines in a test affected by the future change
Roman Lebedev [Sat, 2 Apr 2022 20:04:44 +0000 (23:04 +0300)]
[NFC][InstCombine] Add some tests for `(X | C2) ^ C1` pattern
Martin Storsjö [Fri, 1 Apr 2022 08:50:25 +0000 (11:50 +0300)]
[Support] [BLAKE3] Fix compilation with CMAKE_OSX_ARCHITECTURES
With CMake, one can build for multiple macOS architectures
at the same time by setting CMAKE_OSX_ARCHITECTURES to multiple
architectures (avoiding needing to do two separate builds and
gluing the binaries together after the build).
In this case, while targeting x86_64 and arm64, neither IS_X64
nor IS_ARM64 is set, while compilation of the individual source
files will hit those cases (in either architecture mode).
Therefore, if we on the CMake level decide not to include the
architecture specific SIMD implementation files, also tell the
source this explicitly by passing the defines indicating that we
don't expect to use them.
Such a build clearly is less ideal than explicitly targeting one
architecture at a time if it won't include all the SIMD optimizations,
but that's a tradeoff that is up to the one deciding to do such an
universal build.
This also fixes builds for i386. The blake3 source code automatically
enables the SIMD implementations when building for i386, but we don't
provide the sources for that build configuration.
Differential Revision: https://reviews.llvm.org/D122884
Martin Storsjö [Fri, 1 Apr 2022 11:29:54 +0000 (14:29 +0300)]
[Support] [BLAKE3] Remove .hidden directives from windows-gnu assembly sources
COFF symbols don't have anything corresponding to a `.hidden` flag;
both GNU binutils as and LLVM's built-in assembler errors out on
these directives.
This reverts one part of
7f05aa2d4c36d6d53f97ac3e0db30ec600abbc62, fixing builds for
mingw x86_64.
Differential Revision: https://reviews.llvm.org/D122893
Florian Hahn [Sat, 2 Apr 2022 18:33:58 +0000 (19:33 +0100)]
[VPlan] Set VPlan header block name to vector.body.
This brings the VPlan block naming in line with the naming of the
generated basic blocks.
Groverkss [Sat, 2 Apr 2022 18:09:57 +0000 (23:39 +0530)]
[MLIR][Presburger][NFC] Rename getCompatibleSpace to getSpaceWithoutLocals
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D122973
Walter Erquinigo [Fri, 1 Apr 2022 04:13:03 +0000 (21:13 -0700)]
[trace][intel pt] Handle better tsc in the decoder
A problem that I introduced in the decoder is that I was considering TSC decoding
errors as actual instruction errors, which mean that the trace has a gap. This is
wrong because a TSC decoding error doesn't mean that there's a gap in the trace.
Instead, now I'm just counting how many of these errors happened and I'm using
the `dump info` command to check for this number.
Besides that, I refactored the decoder a little bit to make it simpler, more
readable, and to handle TSCs in a cleaner way.
Differential Revision: https://reviews.llvm.org/D122867
Hirochika Matsumoto [Sat, 2 Apr 2022 17:27:59 +0000 (02:27 +0900)]
Revert "[InstSimplify][NFC] Add baseline tests for folds of icmp with ctpop"
This reverts commit
b48abeea44ac3c7860b13b863210116e8db1d978.
Accidentally added already optimized tests, not baseline tests.
Hirochika Matsumoto [Sat, 2 Apr 2022 17:14:51 +0000 (02:14 +0900)]
[InstSimplify][NFC] Add baseline tests for folds of icmp with ctpop
Extracted from: https://reviews.llvm.org/D122757
Florian Hahn [Sat, 2 Apr 2022 15:55:04 +0000 (16:55 +0100)]
[ConstraintElimination] Move logic to build worklist to helper (NFC).
This refactor makes it easier to extend the logic to collect information
from blocks in the future, without even further increasing the size of
eliminateConstriants.
tyb0807 [Mon, 7 Mar 2022 10:17:00 +0000 (10:17 +0000)]
[Driver][AArch64] Split up aarch64-cpus.c tests further
This is the continuation of https://reviews.llvm.org/D120875. Now
aarch64-cpus-[12].c are further splitted and renamed to better reflect
the tests.
Differential Revision: https://reviews.llvm.org/D121093
tyb0807 [Thu, 3 Mar 2022 02:12:00 +0000 (02:12 +0000)]
[AArch64] Avoid scanning feature list for target parsing
As discussed in https://reviews.llvm.org/D120111, this patch proposes an
alternative implementation to avoid scanning feature list for
architecture version over and over again. The insertion position for
default extensions is also captured during this single scan of the
feature list.
Differential Revision: https://reviews.llvm.org/D120864
tyb0807 [Tue, 1 Feb 2022 13:37:43 +0000 (13:37 +0000)]
[AArch64] Default HBC/MOPS features in clang
This implements minimum support in clang for default HBC/MOPS features
on v8.8-a/v9.3-a or later architectures.
Differential Revision: https://reviews.llvm.org/D120111
Ron Lieberman [Sat, 2 Apr 2022 13:25:50 +0000 (13:25 +0000)]
Revert "[AMDPU][Sanitizer] Refactor sanitizer options handling for AMDGPU Toolchain"
This reverts commit
cc2139524f77248c7e147d4cc3befb31fe3e6daa.
failed a few buildbots
Groverkss [Sat, 2 Apr 2022 12:44:38 +0000 (18:14 +0530)]
[MLIR][Presburger] Make constructors from PresburgerSpace explicit
This patch makes constructors of IntegerRelation, IntegerPolyhedron,
PresburgerRelation, PresburgerSet from PresburgerSpace explicit. This
prevents bugs like:
```
void fun(IntegerRelation a, IntegerRelation b) {
IntegerPolyhedron c = a.intersect(b);
}
```
Here, `a.intersect(b)` will return `IntegerRelation`, which will be implicitly
converted to `PresburgerSpace` and will use the `PresburgerSpace` constructor
for IntegerPolyhedron. Leading to loss of any constraints in the intersection
of `a` and `b`. After this patch, this will give a compile error.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D122972
Ron Lieberman [Sat, 2 Apr 2022 11:01:04 +0000 (11:01 +0000)]
[AMDPU][Sanitizer] Refactor sanitizer options handling for AMDGPU Toolchain
authored by amit.pandey@amd.com ampandey-AMD
Differential Revision: https://reviews.llvm.org/D122781
Arjun P [Fri, 1 Apr 2022 17:46:52 +0000 (18:46 +0100)]
[MLIR][Presburger] LexSimplex: support is{Redundant,Separate}Inequality
Add integer-exact checks for inequalities being separate and redundant in LexSimplex.
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D122921