peter klausler [Wed, 20 Jan 2021 01:09:55 +0000 (17:09 -0800)]
[flang] Fix ASSOCIATE statement name resolution
F18 Clause 19.4p9 says:
The associate names of an ASSOCIATE construct have the scope of the
block.
Clause 11.3.1p1 says the ASSOCIATE statement is not itself in the block:
R1102 associate-construct is: associate-stmt block end-associate-stmt
Associate statement associations are currently fully processed from left
to right, incorrectly interposing associating entities earlier in the
list on same-named entities in the host scope.
1 program p
2 logical :: a = .false.
3 real :: b = 9.73
4 associate (b => a, a => b)
5 print*, a, b
6 end associate
7 print*, a, b
8 end
Associating names 'a' and 'b' at line 4 in this code are now both
aliased to logical host entity 'a' at line 2. This happens because the
reference to 'b' in the second association incorrectly resolves 'b' to
the entity in line 4 (already associated to 'a' at line 2), rather than
the 'b' at line 3. With bridge code to process these associations,
f18 output is:
F F
F 9.73
It should be:
9.73 F
F 9.73
To fix this, names in right-hand side selector variables/expressions
must all be resolved before any left-hand side entities are resolved.
This is done by maintaining a stack of lists of associations, rather
than a stack of associations. Each ASSOCIATE statement's list of
assocations is then visited once for right-hand side processing, and
once for left-hand side processing.
Note that other construct associations do not have this problem.
SELECT RANK and SELECT TYPE each have a single assocation, not a list.
Constraint C1113 prohibits the right-hand side of a CHANGE TEAM
association from referencing any left-hand side entity.
Differential Revision: https://reviews.llvm.org/D95010
Mircea Trofin [Tue, 19 Jan 2021 18:05:25 +0000 (10:05 -0800)]
[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor
When using 2 InlinePass instances in the same CGSCC - one for other
mandatory inlinings, the other for the heuristic-driven ones - the order
in which the ImportedFunctionStats would be output-ed would depend on
the destruction order of the inline passes, which is not deterministic.
This patch moves the ImportedFunctionStats responsibility to the
InlineAdvisor to address this problem.
Differential Revision: https://reviews.llvm.org/D94982
Hans Wennborg [Wed, 20 Jan 2021 19:03:02 +0000 (20:03 +0100)]
Revert "[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE"
It caused "Vector shift amounts must be in the same as their first arg"
asserts in Chromium builds. See the code review for repro instructions.
> Add DemandedElts support inside the TRUNCATE analysis.
>
> Differential Revision: https://reviews.llvm.org/D56387
This reverts commit
cad4275d697c601761e0819863f487def73c67f8.
George Burgess IV [Wed, 20 Jan 2021 18:56:21 +0000 (10:56 -0800)]
Revert "[clang] Change builtin object size when subobject is invalid"
This reverts commit
275f30df8ad6de75e1f29e4b33eaeb67686caf0d.
As noted on the code review (https://reviews.llvm.org/D92892), this
change causes us to reject valid code in a few cases. Reverting so we
have more time to figure out what the right fix{es are, is} here.
Reid Kleckner [Wed, 20 Jan 2021 19:00:58 +0000 (11:00 -0800)]
[COFF] Use range for on relocations, NFC
Dávid Bolvanský [Wed, 20 Jan 2021 18:45:13 +0000 (19:45 +0100)]
[BuildLibcalls] Mark some libcalls with inaccessiblememonly and inaccessiblemem_or_argmemonly
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D94850
Craig Topper [Wed, 20 Jan 2021 18:32:03 +0000 (10:32 -0800)]
[RISCV] Remove unnecessary APInt copy. NFC
getAPIntValue returns a const APInt& so keep it as a reference.
Simon Pilgrim [Wed, 20 Jan 2021 18:15:39 +0000 (18:15 +0000)]
[X86][AVX] Handle vperm2x128 shuffling of a subvector splat.
We already handle "vperm2x128 (ins ?, X, C1), (ins ?, X, C1), 0x31" for shuffling of the upper subvectors, but we weren't dealing with the case when we were splatting the upper subvector from a single source.
Fangrui Song [Wed, 20 Jan 2021 18:14:10 +0000 (10:14 -0800)]
[AArch64] Fix -Wunused-but-set-variable in GCC -DLLVM_ENABLE_ASSERTIONS=off build
Frederik Gossen [Wed, 20 Jan 2021 17:52:55 +0000 (18:52 +0100)]
[MLIR][Standard] Add log1p operation to std
Differential Revision: https://reviews.llvm.org/D95041
Albion Fung [Wed, 20 Jan 2021 17:55:03 +0000 (12:55 -0500)]
[PowerPC][Power10] Exploit splat instruction xxsplti32dx in Power10
Exploits the instruction xxsplti32dx.
It can be used to materialize any 64 bit scalar/vector splat by using two instances, one for the upper 32 bits and the other for the lower 32 bits. It should not materialize the cases which can be materialized by using the instruction xxspltidp.
Differential Revision: https://https://reviews.llvm.org/D90173
Med Ismail Bennani [Wed, 20 Jan 2021 17:33:00 +0000 (18:33 +0100)]
[lldb/Commands] Refactor ProcessLaunchCommandOptions to use TableGen (NFC)
This patch refactors the current implementation of
`ProcessLaunchCommandOptions` to be generated by TableGen.
The patch also renames the class to `CommandOptionsProcessLaunch` to
align better with the rest of the codebase style and moves it to
separate files.
Differential Review: https://reviews.llvm.org/D95059
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Tobias Gysi [Wed, 20 Jan 2021 17:35:51 +0000 (18:35 +0100)]
[mlir] fix the rocm runtime wrapper to account for cuda / rocm api differences
The patch adapts the rocm runtime wrapper due to subtle differences between the cuda and the rocm/hip runtime api.
Reviewed By: csigg
Differential Revision: https://reviews.llvm.org/D95027
Jacques Pienaar [Wed, 20 Jan 2021 17:45:22 +0000 (09:45 -0800)]
Avoid unused variable warning in opt mode
Craig Topper [Wed, 20 Jan 2021 17:19:57 +0000 (09:19 -0800)]
[RISCV] Add way to mark CompressPats that should only be used for compressing.
There can be muliple patterns that map to the same compressed
instruction. Reversing those leads to multiple ways to uncompress
an instruction, but its not easily controllable which one will
be chosen by the tablegen backend.
This patch adds a flag to mark patterns that should only be used
for compressing. This allows us to leave one canonical pattern
for uncompressing.
The obvious benefit of this is getting c.mv to uncompress to
the addi patern that is aliased to the mv pseudoinstruction. For
the add/and/or/xor/li patterns it just removes some unreachable
code from the generated code.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D94894
Diego Caballero [Wed, 20 Jan 2021 01:24:57 +0000 (03:24 +0200)]
[mlir][Affine] Add support for multi-store producer fusion
This patch adds support for producer-consumer fusion scenarios with
multiple producer stores to the AffineLoopFusion pass. The patch
introduces some changes to the producer-consumer algorithm, including:
* For a given consumer loop, producer-consumer fusion iterates over its
producer candidates until a fixed point is reached.
* Producer candidates are gathered beforehand for each iteration of the
consumer loop and visited in reverse program order (not strictly guaranteed)
to maximize the number of loops fused per iteration.
In general, these changes were needed to simplify the multi-store producer
support and remove some of the workarounds that were introduced in the past
to support more fusion cases under the single-store producer limitation.
This patch also preserves the existing functionality of AffineLoopFusion with
one minor change in behavior. Producer-consumer fusion didn't fuse scenarios
with escaping memrefs and multiple outgoing edges (from a single store).
Multi-store producer scenarios will usually (always?) have multiple outgoing
edges so we couldn't fuse any with escaping memrefs, which would greatly limit
the applicability of this new feature. Therefore, the patch enables fusion for
these scenarios. Please, see modified tests for specific details.
Reviewed By: andydavis1, bondhugula
Differential Revision: https://reviews.llvm.org/D92876
Shilei Tian [Wed, 20 Jan 2021 17:01:51 +0000 (12:01 -0500)]
[OpenMP][NVPTX] Replaced CUDA builtin vars with LLVM intrinsics
Replaced CUDA builtin vars with LLVM intrinsics such that we don't need
definitions of those intrinsics.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D95013
Sameer Sahasrabuddhe [Wed, 20 Jan 2021 16:32:09 +0000 (22:02 +0530)]
[AMDGPU] pin lit test divergent-unswitch.ll to the old pass manager
The loop-unswitch transform should not be performed on a loop whose
condition is divergent. For this to happen correctly, divergence
analysis must be available. The existing divergence analysis has not
been ported to the new pass manager yet. As a result, loop unswitching
on the new pass manager is currently unsafe on targets that care about
divergence.
This test is temporarily disabled to unblock work on the new pass
manager. The issue is now tracked in bug 48819.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D95051
Sanjay Patel [Wed, 20 Jan 2021 13:32:47 +0000 (08:32 -0500)]
[SLP] reduce reduction code for checking vectorizable ops; NFC
This is another step towards removing `OperationData` and
fixing FMF matching/propagation bugs when forming reductions.
Sanjay Patel [Wed, 20 Jan 2021 13:11:30 +0000 (08:11 -0500)]
[SLP] refactor more reduction functions; NFC
We were able to remove almost all of the state from
OperationData, so these don't make sense as members
of that class - just pass the RecurKind in as a param.
More streamlining is possible, but I'm trying to avoid
logic/typo bugs while fixing this. Eventually, we should
not need the `OperationData` class.
Sanjay Patel [Tue, 19 Jan 2021 19:13:59 +0000 (14:13 -0500)]
[SLP] move reduction createOp functions; NFC
We were able to remove almost all of the state from
OperationData, so these don't make sense as members
of that class - just pass the RecurKind in as a param.
Louis Dionne [Mon, 18 Jan 2021 20:08:55 +0000 (15:08 -0500)]
[docs] Fix overly specific link to uploading patches on Phabricator
The documentation for contributing to LLVM currently links to the section
explaining how to submit a Phabricator review using the web interface.
I believe it would be better to link to the general page for using
Phabricator instead, which explains how to sign up with Phabricator,
and also how to submit patches using either the web interface or the
command-line.
I think this is worth changing because what currently *appears* to be our
preferred way of submitting a patch (through the web interface) isn't
actually what we prefer. Indeed, patches submitted from the command-line
have more meta-data available (such as which repository the patch targets),
and also can't suffer from missing context.
Differential Revision: https://reviews.llvm.org/D94929
Joseph Tremoulet [Wed, 20 Jan 2021 16:01:09 +0000 (11:01 -0500)]
Loop peeling: check that latch is conditional branch
Loop peeling assumes that the loop's latch is a conditional branch. Add
a check to canPeel that explicitly checks for this, and testcases that
otherwise fail an assertion when trying to peel a loop whose back-edge
is a switch case or the non-unwind edge of an invoke.
Reviewed By: skatkov, fhahn
Differential Revision: https://reviews.llvm.org/D94995
Stephen Kelly [Sun, 17 Jan 2021 16:29:49 +0000 (16:29 +0000)]
Implement dynamic mapAnyOf in terms of ASTNodeKinds
This reduces template bloat, but more importantly, makes it possible to
construct one from clang-query without template types.
Differential Revision: https://reviews.llvm.org/D94879
Jon Chesterfield [Wed, 20 Jan 2021 15:50:41 +0000 (15:50 +0000)]
[libomptarget][devicertl] Wrap source in declare target pragmas
[libomptarget][devicertl] Wrap source in declare target pragmas
Factored out of D93135 / D94745. C++ and cuda ignore unknown pragmas
so this is a NFC for the current implementation language. Removes noise
from patches for building deviceRTL as openmp.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D95048
Alex Richardson [Wed, 20 Jan 2021 15:43:57 +0000 (15:43 +0000)]
[libc++] Split re.alg tests into locale-dependent and independent tests
Currently all these tests are XFAILED on Linux even though the problem
only seems to be with the few checks that look at collation. To retain
test coverage this splits the locale-dependent tests into a separate
.pass.cpp that is XFAILed as before.
This commit also XFAILs the locale-dependent tests on FreeBSD since the
[=M=] and [.ch.] behaviour for cs_CZ also doesn't seem to match the
behaviour that is expected by these tests.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D94969
Stephen Kelly [Sun, 17 Jan 2021 16:24:01 +0000 (16:24 +0000)]
Make it possible to store a ASTNodeKind in VariantValue
Differential Revision: https://reviews.llvm.org/D94878
Simon Pilgrim [Wed, 20 Jan 2021 15:39:30 +0000 (15:39 +0000)]
[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE
Add DemandedElts support inside the TRUNCATE analysis.
Differential Revision: https://reviews.llvm.org/D56387
Hans Wennborg [Wed, 20 Jan 2021 14:25:33 +0000 (15:25 +0100)]
Revert "Following up on PR48517, fix handling of template arguments that refer"
Combined with 'da98651 - Revert "DR2064:
decltype(E) is only a dependent', this change (5a391d3) caused verifier
errors when building Chromium. See https://crbug.com/1168494#c1 for a
reproducer.
Additionally it reverts changes that were dependent on this one, see
below.
> Following up on PR48517, fix handling of template arguments that refer
> to dependent declarations.
>
> Treat an id-expression that names a local variable in a templated
> function as being instantiation-dependent.
>
> This addresses a language defect whereby a reference to a dependent
> declaration can be formed without any construct being value-dependent.
> Fixing that through value-dependence turns out to be problematic, so
> instead this patch takes the approach (proposed on the core reflector)
> of allowing the use of pointers or references to (but not values of)
> dependent declarations inside value-dependent expressions, and instead
> treating template arguments as dependent if they evaluate to a constant
> involving such dependent declarations.
>
> This ends up affecting a bunch of OpenMP tests, due to OpenMP
> imprecisely handling instantiation-dependent constructs, bailing out
> early instead of processing dependent constructs to the extent possible
> when handling the template.
>
> Previously committed as
8c1f2d15b826591cdf6bd6b468b8a7d23377b29e, and
> reverted because a dependency commit was reverted.
This reverts commit
5a391d38ac6c561ba908334d427f26124ed9132e.
It also restores clang/test/SemaCXX/coroutines.cpp to its state before
da986511fb9da1a46a0ca4dba2e49e2426036303.
Revert "[c++20] P1907R1: Support for generalized non-type template arguments of scalar type."
> Previously committed as
9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and
> reverted because a dependency commit was reverted. This incorporates the
> following follow-on commits that were also reverted:
>
>
7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 by Simon Pilgrim
>
ed13d8c66781b50ff007cb089c5905f9bb9e8af2 by me
>
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc by Sam McCall
>
430d5d8429473c2b10b109991d7577a3cea41140 by Dave Zarzycki
This reverts commit
4b574008aef5a7235c1f894ab065fe300d26e786.
Revert "[msabi] Mangle a template argument referring to array-to-pointer decay"
> [msabi] Mangle a template argument referring to array-to-pointer decay
> applied to an array the same as the array itself.
>
> This follows MS ABI, and corrects a regression from the implementation
> of generalized non-type template parameters, where we "forgot" how to
> mangle this case.
This reverts commit
18e093faf726d15f210ab4917142beec51848258.
Paul C. Anagnostopoulos [Wed, 20 Jan 2021 14:44:54 +0000 (09:44 -0500)]
Revert "[TableGen] Improve algorithm for inheriting class template args and fields"
This reverts commit
c056f824340ff0189f3ef7870b83e3730de401d1.
That commit causes build failures.
Simon Pilgrim [Wed, 20 Jan 2021 14:19:18 +0000 (14:19 +0000)]
[X86][AVX] Fold extract_subvector(VSRLI/VSHLI(x,32)) -> VSRLI/VSHLI(extract_subvector(x),32)
As discussed on D56387, if we're shifting to extract the upper/lower half of a vXi64 vector then we're actually better off performing this at the subvector level as its very likely to fold into something.
combineConcatVectorOps can perform this in reverse if necessary.
Paul C. Anagnostopoulos [Fri, 8 Jan 2021 14:44:27 +0000 (09:44 -0500)]
[TableGen] Improve algorithm for inheriting class template args and fields
Differential Revision: https://reviews.llvm.org/D94822
Amanieu d'Antras [Wed, 20 Jan 2021 13:30:47 +0000 (13:30 +0000)]
[AArch64] Add support for the GNU ILP32 ABI
Add the aarch64[_be]-*-gnu_ilp32 targets to support the GNU ILP32 ABI for AArch64.
The needed codegen changes were mostly already implemented in D61259, which added support for the watchOS ILP32 ABI. The main changes are:
- Wiring up the new target to enable ILP32 codegen and MC.
- ILP32 va_list support.
- ILP32 TLSDESC relocation support.
There was existing MC support for ELF ILP32 relocations from D25159 which could be enabled by passing "-target-abi ilp32" to llvm-mc. This was changed to check for "gnu_ilp32" in the target triple instead. This shouldn't cause any issues since the existing support was slightly broken: it was generating ELF64 objects instead of the ELF32 object files expected by the GNU ILP32 toolchain.
This target has been tested by running the full rustc testsuite on a big-endian ILP32 system based on the GCC ILP32 toolchain.
Reviewed By: kristof.beyls
Differential Revision: https://reviews.llvm.org/D94143
Mindong Chen [Wed, 20 Jan 2021 12:26:16 +0000 (20:26 +0800)]
[SCEV] Add a test with wrong exit counts. (NFC)
This patch pre-commits a test case with wrong exit count
analysis for D92367.
Reviewed by: mkazantsev
Differential Revision: https://reviews.llvm.org/D94657
Bjorn Pettersson [Mon, 11 Jan 2021 12:08:38 +0000 (13:08 +0100)]
[PM] Avoid duplicates in the Used/Preserved/Required sets
The pass analysis uses "sets" implemented using a SmallVector type
to keep track of Used, Preserved, Required and RequiredTransitive
passes. When having nested analyses we could end up with duplicates
in those sets, as there was no checks to see if a pass already
existed in the "set" before pushing to the vectors. This idea with
this patch is to avoid such duplicates by avoiding pushing elements
that already is contained when adding elements to those sets.
To align with the above PMDataManager::collectRequiredAndUsedAnalyses
is changed to skip adding both the Required and RequiredTransitive
passes to its result vectors (since RequiredTransitive always is
a subset of Required we ended up with duplicates when traversing
both sets).
Main goal with this is to avoid spending time verifying the same
analysis mulitple times in PMDataManager::verifyPreservedAnalysis
when iterating over the Preserved "set". It is assumed that removing
duplicates from a "set" shouldn't have any other negative impact
(I have not seen any problems so far). If this ends up causing
problems one could do some uniqueness filtering of the vector being
traversed in verifyPreservedAnalysis instead.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D94416
Haojian Wu [Fri, 8 Jan 2021 10:56:30 +0000 (11:56 +0100)]
[clangd] Extend find-refs to include overrides.
find-references on `virtual void meth^od() = 0` will include override references.
Differential Revision: https://reviews.llvm.org/D94390
Christian Sigg [Wed, 20 Jan 2021 12:11:03 +0000 (13:11 +0100)]
Fix cuda-runner tests.
Mark Murray [Tue, 19 Jan 2021 09:58:43 +0000 (09:58 +0000)]
[AArch64] Add missing "flagm" feature to the .arch_extension directive.
Depends on D94970
Differential Revision: https://reviews.llvm.org/D94971
Mark Murray [Mon, 18 Jan 2021 17:23:47 +0000 (17:23 +0000)]
[AArch64] Add missing "pauth" feature to the .arch_extension directive.
Differential Revision: https://reviews.llvm.org/D94970
Kadir Cetinkaya [Fri, 15 Jan 2021 10:12:11 +0000 (11:12 +0100)]
[clangd] Fix division by zero when computing scores
NameMatch could be a float close to zero, in such cases we were
dividing by zero and moreover propogating a "NaN" to clients, which is invalid
per JSON.
This fixes the issue by only using Quality scores whenever the NameMatch is low,
as we do in CodeCompletion ranking.
Fixes https://github.com/clangd/clangd/issues/648.
Differential Revision: https://reviews.llvm.org/D94755
James Henderson [Tue, 12 Jan 2021 10:11:49 +0000 (10:11 +0000)]
[llvm-symbolizer][doc] Reorder --relativenames in options list
This puts it in alphabetical order, matching the rest of the list.
Reviewed by: MaskRay, saugustine
Differential Revision: https://reviews.llvm.org/D94481
Florian Hahn [Wed, 20 Jan 2021 11:43:59 +0000 (11:43 +0000)]
[LV] Add test cases with multiple exits which require versioning.
This adds some test coverage for
caafdf07bbccbe89219539e2b56043c2a98358f1, which relaxed an assertion
to only require a unique exit block.
Jeremy Morse [Wed, 20 Jan 2021 11:43:27 +0000 (11:43 +0000)]
[LLD][ELF] Correct test temporary file paths
In
8031785f4a7ebd the temporary object being built was moved to %t/main.o,
but not all run lines were updated to reflect this. Observe the failure
on this buildbot:
http://lab.llvm.org:8011/#/builders/5/builds/3646/steps/9/logs/stdio
It might pass locally for some people due to a stale %t.o hanging around
the build directory.
Julian Gross [Wed, 13 Jan 2021 10:13:41 +0000 (11:13 +0100)]
Added check if there are regions that do not implement the RegionBranchOpInterface.
Add a check if regions do not implement the RegionBranchOpInterface. This is not
allowed in the current deallocation steps. Furthermore, we handle edge-cases,
where a single region is attached and the parent operation has no results.
This fixes: https://bugs.llvm.org/show_bug.cgi?id=48575
Differential Revision: https://reviews.llvm.org/D94586
Christian Sigg [Mon, 11 Jan 2021 12:04:09 +0000 (13:04 +0100)]
[mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers.
The runtime-wrappers depend on LLVMSupport, pulling in static initialization code (e.g. command line arguments). Dynamically loading multiple such libraries results in ODR violoations.
So far this has not been an issue, but in D94421, I would like to load both the async-runtime and the cuda-runtime-wrappers as part of a cuda-runner integration test. When doing this, code that asserts that an option category is only registered once fails (note that I've only experienced this in Google's bazel where the async-runtime depends on LLVMSupport, but a similar issue would happen in cmake if more than one runtime-wrapper starts to depend on LLVMSupport).
The underlying issue is that we have a mix of static and dynamic linking. If all dependencies were loaded as shared objects (i.e. if LLVMSupport was linked dynamically to the runtime wrappers), each dependency would only get loaded once. However, linking dependencies dynamically would require special attention to paths (one could dynamically load the dependencies first given explicit paths). The simpler approach seems to be to link all dependencies statically into a single shared object.
This change basically applies the same logic that we have in the c_runner_utils: we have a shared object target that can be loaded dynamically, and we have a static library target that can be linked to other runtime-wrapper shared object targets.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D94399
Arun R [Wed, 20 Jan 2021 11:00:15 +0000 (16:30 +0530)]
[PostRASched] Regenerate Whole Test with update_llc_test_checks.py
Reviewed by xbolva00
Reviewers: llvm-commits, MatzeB, craig.topper, kparzysz, efriedma, pengfei, wxiao3, xbolva00
Subscribers: llvm-commits, xbolva00
Differential Revision: https://reviews.llvm.org/D94904
Chuanqi Xu [Wed, 20 Jan 2021 10:54:46 +0000 (18:54 +0800)]
[Coroutine] Remain alignment information when merging frame variables
Summary: This is to address bug48712.
The solution in this patch is that when we want to merge two variable a
into the storage frame of variable b only if the alignment of a is
multiple of b.
There may be other strategies. But now I think they are hard to handle
and benefit little. Or we can implement them in the future.
Test-plan: check-llvm
Reviewers: jmorse, lxfind, junparser
Differential Revision: https://reviews.llvm.org/D94891
Mirko Brkusanin [Wed, 20 Jan 2021 10:38:05 +0000 (11:38 +0100)]
[AMDGPU][GlobalISel] Avoid selecting S_PACK with constants
If constants are hidden behind G_ANYEXT we can treat them same way as G_SEXT.
For that purpose we extend getConstantVRegValWithLookThrough with option
to handle G_ANYEXT same way as G_SEXT.
Differential Revision: https://reviews.llvm.org/D92219
Sam McCall [Thu, 14 Jan 2021 22:50:35 +0000 (23:50 +0100)]
[clangd] Retire some flags for uncontroversial, stable features.
And mark a couple to be retired afther the next release branch.
Differential Revision: https://reviews.llvm.org/D94727
Sam McCall [Thu, 14 Jan 2021 22:27:32 +0000 (23:27 +0100)]
[clangd] Remove the recovery-ast options.
These force a couple of flags or that are now on by default.
So the flags don't currently do anything unless the compile command has
-fno-recovery-ast explicitly.
(For turning recovery *off* for debugging we can inject the flag with config)
This leaves the command-line flags around with no effect, I'm planning to add
a "retired flag" mechanism shortly in a separate patch.
Differential Revision: https://reviews.llvm.org/D94724
Sam McCall [Wed, 13 Jan 2021 14:31:20 +0000 (15:31 +0100)]
[clangd] Move DirBasedCDB broadcasting onto its own thread.
This is on the critical path (it blocks getting the compile command for
the first file).
It's not trivially fast: it involves processing all filenames in the CDB
and doing some IO to look for shadowing CDBs.
And we may make this slower soon - making CDB configurable implies evaluating
the config for each listed to see which ones really are owned by the
broadcasted CDB.
Differential Revision: https://reviews.llvm.org/D94606
Sam McCall [Wed, 13 Jan 2021 15:50:44 +0000 (16:50 +0100)]
[clangd] Allow CDBs to have background work to block on.
In preparation for moving DirectoryBasedCompilationDatabase broadcasting off
the main thread.
Differential Revision: https://reviews.llvm.org/D94603
Arun R [Wed, 20 Jan 2021 09:44:01 +0000 (15:14 +0530)]
[Test Commit] This is a test commit for https://reviews.llvm.org/D94904
D94904 Reviewed by xbolva00
Reviewers for D94904: llvm-commits, MatzeB, craig.topper, kparzysz, efriedma, pengfei, wxiao3, xbolva00
Subscribers for D94904: llvm-commits, xbolva00
D94904 Differential Revision: https://reviews.llvm.org/D94904
Jan Svoboda [Tue, 12 Jan 2021 13:04:06 +0000 (14:04 +0100)]
[clang][cli] Port more options to new parsing system
This patch adds marshalling information to more options.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D94957
Petar Avramovic [Wed, 20 Jan 2021 09:09:59 +0000 (10:09 +0100)]
[AMDGPU][MC] Add tfe disassembler support MIMG opcodes
With tfe on there can be a vgpr write to vdata+1.
Add tablegen support for 5 register vdata store.
This is required for 4 register vdata store with tfe.
Differential Revision: https://reviews.llvm.org/D94960
Gabriel Hjort Åkerlund [Wed, 20 Jan 2021 09:06:42 +0000 (10:06 +0100)]
[GlobalISel] Add missing operand update when copy is required
When constraining an operand register using constrainOperandRegClass(),
the function may emit a COPY in case the provided register class does
not match the current operand register class. However, the operand
itself is not updated to make use of the COPY, thereby resulting in
incorrect code. This patch fixes that bug by updating the machine
operand accordingly.
Reviewed By: dsanders
Differential Revision: https://reviews.llvm.org/D91244
Raphael Isemann [Wed, 20 Jan 2021 09:29:08 +0000 (10:29 +0100)]
[lldb][docs] Expand CSS fix for LLDB doc tables
Apparently the sphinx version on the server doesn't place <p> tags in the
table cells, so the previous fix from commit
7fce3b240b6b313b1becf19ddf3f2a90
didn't fix the bug for that sphinx version. Just expand the CSS workaround
to all <td> tags.
David Sherwood [Mon, 11 Jan 2021 16:56:10 +0000 (16:56 +0000)]
[NFC][InstructionCost] Use InstructionCost in lib/Transforms/IPO/IROutliner.cpp
In places where we call a TTI.getXXCost() function I have changed
the code to use InstructionCost instead of unsigned. This is in
preparation for later on when we will change the TTI interfaces
to return InstructionCost.
See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html
Differential Revision: https://reviews.llvm.org/D94427
Raphael Isemann [Wed, 20 Jan 2021 08:06:38 +0000 (09:06 +0100)]
[lldb][docs] Filter out 'thisown' attribute and inheritance boilerplate
This patch implements a filter that post-processes some of the generated RST sources
of the Python API docs. I mainly want to avoid two things:
1. Filter out all the inheritance boilerplate that just keeps mentioning for
every class that it inherits from the builtin 'object'. There is no inheritance
in the SB API.
2. More importantly, removes the SWIG generated `thisown` attribute from the
public documentation. I don't think we want users to mess with that attribute
and this is probably causing more confusion than it would help anyone. It also
makes the documentation for some smaller classes more verbose than necessary.
This patch just uses the sphinx event for reading source and removes the parts
that we don't want in documentation.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D94967
Raphael Isemann [Wed, 20 Jan 2021 08:05:09 +0000 (09:05 +0100)]
[lldb][docs] Remove -webkit-hyphens in table cells so that table widths are correct on Safari
The tables in the new LLDB documentation currently are less wide than their
contents. The reason for that seems to be the `-webkit-hyphens: auto` property
that sphinx is setting for all `p` tags. The `p` tags in the generated Python
documentation seem to trigger some Safari layout issue, so Safari is calculating
the cell width to be smaller than it should be (which ends up looking like this
{
F15104344} ).
This patch just sets that property back to the browser default `manual`. Not
sure if that's the proper workaround, but I clicked around on the website with
the changed CSS and nothing looked funny (which is I believe how webdev unit
testing works).
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D94991
Bill Wendling [Thu, 14 Jan 2021 09:51:04 +0000 (01:51 -0800)]
[X86] Add segment and address-size override prefixes
X86 allows for the "addr32" and "addr16" address size override prefixes.
Also, these and the segment override prefixes should be recognized as
valid prefixes.
Differential Revision: https://reviews.llvm.org/D94726
Hsiangkai Wang [Thu, 31 Dec 2020 09:14:15 +0000 (17:14 +0800)]
[RISCV] Implement vlseg intrinsics.
For Zvlsseg, we need continuous vector registers for the values. We need
to define new register classes for the different combinations of (number
of fields and LMUL). For example,
when the number of fields(NF) = 3, LMUL = 2, the values will be assigned
to (V0M2, V2M2, V4M2), (V2M2, V4M2, V6M2), (V4M2, V6M2, V8M2), ...
We define the vlseg intrinsics with multiple outputs. There is no way to
describe the codegen patterns with multiple outputs in the tablegen
files. We do the codegen in RISCVISelDAGToDAG and use EXTRACT_SUBREG to
extract the values of output.
The multiple scalable vector values will be put into a struct. This
patch is depended on the support for scalable vector struct.
Differential Revision: https://reviews.llvm.org/D94229
Fangrui Song [Wed, 20 Jan 2021 05:23:57 +0000 (21:23 -0800)]
[ELF] --wrap: Produce a dynamic symbol for undefined __wrap_
```
// a.s
jmp fcntl
// b.s
.globl fcntl
fcntl:
ret
```
`ld.lld -shared --wrap=fcntl a.o b.o` has an `R_X86_64_JUMP_SLOT` referencing
the index 0 undefined symbol, which will cause a glibc `symbol lookup error` at
runtime. This is because `__wrap_fcntl` is not in .dynsym
We use an approximation `!wrap->isUndefined()`, which doesn't set
`isUsedInRegularObj` of `__wrap_fcntl` when `fcntl` is referenced and
`__wrap_fcntl` is undefined.
Fix this by using `sym->referenced`.
Fangrui Song [Wed, 20 Jan 2021 05:05:16 +0000 (21:05 -0800)]
[ELF][test] Improve --wrap tests
Aart Bik [Wed, 20 Jan 2021 02:34:26 +0000 (18:34 -0800)]
[mlir][sparse] add narrower choices for pointers/indices
Use cases with 16- or even 8-bit pointer/index structures have been identified.
Reviewed By: penpornk
Differential Revision: https://reviews.llvm.org/D95015
Kazu Hirata [Wed, 20 Jan 2021 04:19:17 +0000 (20:19 -0800)]
[llvm] Use llvm::all_of (NFC)
Kazu Hirata [Wed, 20 Jan 2021 04:19:15 +0000 (20:19 -0800)]
[llvm] Use llvm::any_of (NFC)
Kazu Hirata [Wed, 20 Jan 2021 04:19:14 +0000 (20:19 -0800)]
[llvm] Use llvm::find (NFC)
Juneyoung Lee [Wed, 20 Jan 2021 03:41:30 +0000 (12:41 +0900)]
[SimplifyCFG] Reapply update_test_checks.py (NFC)
ShihPo Hung [Tue, 19 Jan 2021 07:58:36 +0000 (23:58 -0800)]
[RISCV] refactor VPatBinary (NFC)
Make it easier to reuse for intrinsic vrgatherei16
which needs to encode both LMUL & EMUL in the instruction name,
like PseudoVRGATHEREI16_VV_M1_M1 and PseudoVRGATHEREI16_VV_M1_M2.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94951
Juneyoung Lee [Wed, 13 Jan 2021 02:43:38 +0000 (11:43 +0900)]
Allow nonnull/align attribute to accept poison
Currently LLVM is relying on ValueTracking's `isKnownNonZero` to attach `nonnull`, which can return true when the value is poison.
To make the semantics of `nonnull` consistent with the behavior of `isKnownNonZero`, this makes the semantics of `nonnull` to accept poison, and return poison if the input pointer isn't null.
This makes many transformations like below legal:
```
%p = gep inbounds %x, 1 ; % p is non-null pointer or poison
call void @f(%p) ; instcombine converts this to call void @f(nonnull %p)
```
Instead, this semantics makes propagation of `nonnull` to caller illegal.
The reason is that, passing poison to `nonnull` does not immediately raise UB anymore, so such program is still well defined, if the callee does not use the argument.
Having `noundef` attribute there re-allows this.
```
define void @f(i8* %p) { ; functionattr cannot mark %p nonnull here anymore
call void @g(i8* nonnull %p) ; .. because @g never raises UB if it never uses %p.
ret void
}
```
Another attribute that needs to be updated is `align`. This patch updates the semantics of align to accept poison as well.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D90529
wlei [Wed, 20 Jan 2021 00:20:11 +0000 (16:20 -0800)]
[llvm-profgen][NFC] Fix the incorrect computation of callsite sample count
Differential Revision: https://reviews.llvm.org/D95009
Sergey Dmitriev [Wed, 20 Jan 2021 00:40:52 +0000 (16:40 -0800)]
[llvm-link] Improve link time for bitcode archives [NFC]
Linking large bitcode archives currently takes a lot of time with llvm-link,
this patch adds couple improvements which reduce link time for archives
- Use one Linker instance for archive instead of recreating it for each member
- Lazy load archive members
Reviewed By: tra, jdoerfert
Differential Revision: https://reviews.llvm.org/D94643
Stella Laurenzo [Wed, 20 Jan 2021 00:02:02 +0000 (16:02 -0800)]
[mlir][python] Swap shape and element_type order for MemRefType.
* Matches how all of the other shaped types are declared.
* No super principled reason fro this ordering beyond that it makes the one that was different be like the rest.
* Also matches ordering of things like ndarray, et al.
Reviewed By: ftynse, nicolasvasilache
Differential Revision: https://reviews.llvm.org/D94812
Nico Weber [Wed, 20 Jan 2021 00:02:40 +0000 (19:02 -0500)]
[gn build] fix libcxx gn file with libcxx_abi_namespace set
Nico Weber [Tue, 19 Jan 2021 23:51:39 +0000 (18:51 -0500)]
[gn build] (manually) port
933518fff82c
Ian Levesque [Thu, 15 Oct 2020 02:18:30 +0000 (22:18 -0400)]
[xray] Honor xray-never function-instrument attribute
function-instrument=xray-never wasn't actually honored before. We were
getting lucky that it worked because CodeGenFunction would omit the
other xray attributes when a function was annotated with
xray_never_instrument. This patch adds proper support.
Differential Revision: https://reviews.llvm.org/D89441
Wei Mi [Tue, 19 Jan 2021 23:26:52 +0000 (15:26 -0800)]
Fix Wmissing-field-initializers warnings.
Wei Mi [Wed, 6 Jan 2021 07:24:43 +0000 (23:24 -0800)]
[SampleFDO] Add the support to split the function profiles with context into
separate sections.
For ThinLTO, all the function profiles without context has been annotated to
outline functions if possible in prelink phase. In postlink phase, profile
annotation in postlink phase is only meaningful for function profile with
context. If the profile is large, it is better to split the profile into two
parts, one with context and one without, so the profile reading in postlink
phase only has to read the part with context. To have the profile splitting,
we extend the ExtBinary format to support different section arrangement. It
will be flexible to add other section layout in the future without the need
to create new class inheriting from ExtBinary class.
Differential Revision: https://reviews.llvm.org/D94435
Jackson Fellows [Tue, 19 Jan 2021 22:41:45 +0000 (22:41 +0000)]
Implement constant folding for DivFOp
Add a constant folder for DivFOp. Analogous to existing folders for
AddFOp, SubFOp, and MulFOp. Matches the behavior of existing LLVM
constant folding (https://github.com/llvm/llvm-project/blob/
999f5da6b3088fa4c0bb9d05b358d015ca74c71f/llvm/lib/IR/ConstantFold.cpp#L1432).
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94939
Sam Clegg [Tue, 19 Jan 2021 22:29:05 +0000 (14:29 -0800)]
Revert "[WebAssembly] call_indirect issues table number relocs"
This reverts commit
418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1.
This change broke emscripten tests, I believe because it started
generating 5-byte a wide table index in the call_indirect instruction.
Neither v8 nor wabt seem to be able to handle that. The spec
currently says that this is single 0x0 byte and:
"In future versions of WebAssembly, the zero byte occurring in the
encoding of the call_indirectcall_indirect instruction may be used to
index additional tables."
So we need to revisit this change. For backwards compat I guess
we need to guarantee that __indirect_function_table is always at
address zero. We could also consider making this a single-byte
relocation with and assert if have more than 127 tables (for now).
Differential Revision: https://reviews.llvm.org/D95005
Stephen Kelly [Sun, 17 Jan 2021 16:22:41 +0000 (16:22 +0000)]
Add API to retrieve a clade kind from ASTNodeKind
Differential Revision: https://reviews.llvm.org/D94877
Eric Christopher [Tue, 19 Jan 2021 22:31:31 +0000 (14:31 -0800)]
Remove unused functions.
Stephen Kelly [Sun, 17 Jan 2021 16:26:02 +0000 (16:26 +0000)]
Remove TypedMatcherOps from VariantValue
It provides no features or advantage over ASTNodeKind-based handling.
Differential Revision: https://reviews.llvm.org/D94876
Richard Smith [Tue, 19 Jan 2021 22:37:10 +0000 (14:37 -0800)]
[msabi] Mangle a template argument referring to array-to-pointer decay
applied to an array the same as the array itself.
This follows MS ABI, and corrects a regression from the implementation
of generalized non-type template parameters, where we "forgot" how to
mangle this case.
Craig Topper [Tue, 19 Jan 2021 22:31:42 +0000 (14:31 -0800)]
[RISCV] Remove NotHasStdExtZbb predicate from zext.h/sext.b/sext.h InstAliases. NFC
NotHasStdExtZbb doesn't have an AssemblerPredicate associated with it
so it didn't do anything. We don't need it either because the sorting
rules in tablegen prioritize by number of predicates. So the
dedicated instructions in the B extension that have predicates
will be prioritized automatically.
Stephen Kelly [Sat, 16 Jan 2021 14:25:11 +0000 (14:25 +0000)]
[ASTMatchers] Allow use of mapAnyOf in more contexts
Add an operator overload to ArgumentAdaptingMatcherFunc to allow use of
mapAnyOf within hasAncestor, hasParent etc.
Differential Revision: https://reviews.llvm.org/D94864
Stella Stamenova [Tue, 19 Jan 2021 22:09:09 +0000 (14:09 -0800)]
[lldb/test] Skip TestProcessAttach: test_attach_to_process_from_different_dir_by_id on Windows
This test is flakey on Windows and on failure it hangs causing the test suite to fail and future builds (on the buildbot, especially) to fail because they cannot re-write the files that are currently in use
Sean Silva [Fri, 15 Jan 2021 02:28:48 +0000 (18:28 -0800)]
[mlir][splitting std] move 2 more ops to `tensor`
- DynamicTensorFromElementsOp
- TensorFromElements
Differential Revision: https://reviews.llvm.org/D94994
Stephen Kelly [Tue, 19 Jan 2021 20:50:54 +0000 (20:50 +0000)]
[ASTMatchers] NFC Rearrange declarations to allow more arg adapting
Stella Laurenzo [Tue, 19 Jan 2021 21:16:16 +0000 (13:16 -0800)]
[mlir][python] Add facility for extending generated python ODS.
* This isn't exclusive with other mechanisms for more ODS centric op definitions, but based on discussions, we feel that we will always benefit from a python escape hatch, and that is the most natural way to write things that don't fit the mold.
* I suspect this facility needs further tweaking, and once it settles, I'll document it and add more tests.
* Added extensions for linalg, since it is unusable without them and continued to evolve my e2e example.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94752
Sam Clegg [Tue, 19 Jan 2021 20:10:15 +0000 (12:10 -0800)]
[lld][WebAssembly] Don't defined indirect function table in relocatable output
Object files (and the output --relocatable) should never define
__indirect_function_table. It should always be linker synthesized
with the final output executable.
Differential Revision: https://reviews.llvm.org/D94993
Richard Smith [Tue, 19 Jan 2021 19:54:06 +0000 (11:54 -0800)]
Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not
if E is merely instantiation-dependent."
This change leaves us unable to distinguish between different function
templates that differ in only instantiation-dependent ways, for example
template<typename T> decltype(int(T())) f();
template<typename T> decltype(int(T(0))) f();
We'll need substantially better support for types that are
instantiation-dependent but not dependent before we can go ahead with
this change.
This reverts commit
e3065ce238475ec202c707f4c58d90df171626ca.
Richard Smith [Tue, 19 Jan 2021 20:09:12 +0000 (12:09 -0800)]
Ensure we don't strip the ConstantExpr carrying a non-type template
argument's value off it during substitution.
Siva Chandra [Fri, 15 Jan 2021 09:34:58 +0000 (01:34 -0800)]
[libc] Extend the current fenv functions to aarch64.
This change does not try to move the common parts of x86 and aarch64 and
build few abstractions over them. While this is possible, x86 story
needs a bit of cleanup, especially around manipulation of the mxcsr
register. Moreover, on x86 one can raise exceptions without performing
exception raising operations. So, all of this can be done in follow up
patches.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D94947
Alexey Bataev [Tue, 19 Jan 2021 20:22:53 +0000 (12:22 -0800)]
[OPENMP]Do not use OMP_MAP_TARGET_PARAM for data movement directives.
OMP_MAP_TARGET_PARAM flag is used to mark the data that shoud be passed
as arguments to the target kernels, nothing else. But the compiler still
marks the data with OMP_MAP_TARGET_PARAM flags even if the data is
passed to the data movement directives, like target data, target update
etc. This flag is just ignored for this directives and the compiler does
not need to emit it.
Reviewed By: cchen
Differential Revision: https://reviews.llvm.org/D91261
Arthur Eubanks [Thu, 7 Jan 2021 22:01:04 +0000 (14:01 -0800)]
[polly][NewPM][test] Fix polly tests under -enable-new-pm
In preparation for turning on opt's -enable-new-pm by default, this pins
uses of passes via the legacy "opt -passname" with pass names beginning
with "polly-" and "polyhedral-info" to the legacy PM. Many of these
tests use -analyze, which isn't supported in the new PM.
(This doesn't affect uses of "opt -passes=passname").
rL240766 accidentally removed `-polly-prepare` in
phi_not_grouped_at_top.ll, and it also doesn't use the output of
-analyze.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D94266
Mircea Trofin [Sat, 16 Jan 2021 02:19:56 +0000 (18:19 -0800)]
[NFC] Disallow unused prefixes under Other
Differential Revision: https://reviews.llvm.org/D94853
Alexey Bataev [Tue, 19 Jan 2021 19:19:09 +0000 (11:19 -0800)]
Revert "[SLP]Merge reorder and reuse shuffles."
This reverts commit
438682de6a38ac97f89fa38faf5c8dc9b09cd9ad to fix the
bug with the reducing size of the resulting vector for the entry node
with multiple users.
Jeroen Dobbelaere [Tue, 19 Jan 2021 19:45:35 +0000 (20:45 +0100)]
[NFC] cleanup noalias2.ll test
D75825 and D75828 modified llvm/test/Transforms/Inline/noalias2.ll to handle llvm.assume. The checking though was broken.
The NO_ASSUME has been replaced by a normal CHECK; the ASSUME rules were never triggered and have been removed.
The test checks have been regenerated.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D94978