OSDN Git Service

android-x86/external-llvm-project.git
3 years ago[OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts
Joseph Huber [Wed, 21 Oct 2020 13:55:21 +0000 (09:55 -0400)]
[OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts

The changes made in D88594 caused the test OpenMP/driver.c to fail on a 32-bit host becuase it was offloading to a 64-bit architecture by default. The offloading test was moved to a new file and a feature was added to the lit config to check for a 64-bit host.

Reviewed By: daltenty

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

3 years ago[libc++] Fix compiler-rt build by copying libc++ headers to <build>/include
Louis Dionne [Wed, 21 Oct 2020 20:52:21 +0000 (16:52 -0400)]
[libc++] Fix compiler-rt build by copying libc++ headers to <build>/include

This commit should really be named "Workaround external projects depending
on libc++ build system implementation details". It seems that the compiler-rt
build (and perhaps other projects) is relying on the fact that we copy libc++
and libc++abi headers to `<build-root>/include/c++/v1`. This was changed
by 5d796645, which moved the headers to `<build-root>/projects/libcxx/include/c++/v1`
and broke the compiler-rt build.

I'm committing this workaround to fix the compiler-rt build, but we should
remove reliance on implementation details like that. The correct way to
setup the compiler-rt build would be to "link" against the `cxx-headers`
target in CMake, or to run `install-cxx-headers` using an appropriate
installation prefix, and then manually add a `-I` path to that location.

3 years ago[spirv] Fix legalize standard to spir-v for transfer ops
Thomas Raoux [Wed, 21 Oct 2020 20:42:29 +0000 (13:42 -0700)]
[spirv] Fix legalize standard to spir-v for transfer ops

Forward missing attributes when creating the new transfer op otherwise the
builder would use default values.

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

3 years agoSimple fix to basic-block-sections to replace emit-obj with emit-llvm
Sriraman Tallam [Wed, 21 Oct 2020 20:38:55 +0000 (13:38 -0700)]
Simple fix to basic-block-sections to replace emit-obj with emit-llvm

emit-obj is unnecessary here and further wasn't redirected to /dev/null.

3 years ago[test] Fix quadradic-exit-value.ll under NPM
Arthur Eubanks [Wed, 21 Oct 2020 20:33:01 +0000 (13:33 -0700)]
[test] Fix quadradic-exit-value.ll under NPM

3 years ago[test] Fix alloca-offset-lifetime.ll under NPM
Arthur Eubanks [Wed, 21 Oct 2020 20:30:45 +0000 (13:30 -0700)]
[test] Fix alloca-offset-lifetime.ll under NPM

3 years ago[mlir] Add missing dependency for MLIRSCFTransforms
Lei Zhang [Wed, 21 Oct 2020 20:22:41 +0000 (16:22 -0400)]
[mlir] Add missing dependency for MLIRSCFTransforms

MLIRTransforms is needed to provide BufferizeTypeConverter
definitions.

3 years agoAdd more test coverage for APValue serialization / deserialization and
Richard Smith [Wed, 21 Oct 2020 19:59:08 +0000 (12:59 -0700)]
Add more test coverage for APValue serialization / deserialization and
fix a few exposed bugs.

3 years ago[c++20] For P0732R2 / P1907R1: Basic frontend support for class types as
Richard Smith [Mon, 21 Sep 2020 06:16:08 +0000 (23:16 -0700)]
[c++20] For P0732R2 / P1907R1: Basic frontend support for class types as
non-type template parameters.

Create a unique TemplateParamObjectDecl instance for each such value,
representing the globally unique template parameter object to which the
template parameter refers.

No IR generation support yet; that will follow in a separate patch.

3 years ago[test] Fix no-wrap-symbolic-becount.ll under NPM
Arthur Eubanks [Wed, 21 Oct 2020 20:14:44 +0000 (13:14 -0700)]
[test] Fix no-wrap-symbolic-becount.ll under NPM

3 years ago[libcxxabi] Stub out 'sleep' call when _LIBCXXABI_HAS_NO_THREADS is defined.
Hafiz Abid Qadeer [Wed, 21 Oct 2020 19:56:24 +0000 (20:56 +0100)]
[libcxxabi] Stub out 'sleep' call when _LIBCXXABI_HAS_NO_THREADS is defined.

While running this test on a bare metal target, I got an error as 'sleep' was not available on that system. As 'sleep' call is not doing anything useful for cases when _LIBCXXABI_HAS_NO_THREADS is defined. This patch puts it under this check.

Reviewed By: ldionne

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

3 years ago[BlockExtract][NewPM] Port -extract-blocks to NPM
Arthur Eubanks [Wed, 7 Oct 2020 22:15:09 +0000 (15:15 -0700)]
[BlockExtract][NewPM] Port -extract-blocks to NPM

Reviewed By: thakis

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

3 years ago[sanitizer] Convert PrintModuleMap to DumpProcessMap
Teresa Johnson [Sat, 17 Oct 2020 17:46:19 +0000 (10:46 -0700)]
[sanitizer] Convert PrintModuleMap to DumpProcessMap

As discussed in the review for D87120 (specifically at
https://reviews.llvm.org/D87120#inline-831939), clean up PrintModuleMap
and DumpProcessMap usage differences. The former is only implemented for
Mac OSX, whereas the latter is implemented for all OSes. The former is
called by asan and tsan, and the latter by hwasan and now memprof, under
the same option. Simply rename the PrintModuleMap implementation for Mac
to DumpProcessMap, remove other empty PrintModuleMap implementations,
and convert asan/tsan to new name. The existing posix DumpProcessMap is
disabled for SANITIZER_MAC.

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

3 years ago[LowerMatrixIntrinsics][NewPM] Fix PreservedAnalyses result
Arthur Eubanks [Sat, 10 Oct 2020 00:58:27 +0000 (17:58 -0700)]
[LowerMatrixIntrinsics][NewPM] Fix PreservedAnalyses result

PreservedCFGCheckerInstrumentation was saying that LowerMatrixIntrinsics
didn't properly preserve CFG even though it claimed to. The legacy pass
says it doesn't. Match the legacy pass's preserved analyses.

Reviewed By: thakis

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

3 years ago[RS4GC] NFC. Preparatory refactoring to make GC parseable memcpy
Artur Pilipenko [Fri, 2 Oct 2020 03:01:39 +0000 (20:01 -0700)]
[RS4GC] NFC. Preparatory refactoring to make GC parseable memcpy

For GC parseable element atomic memcpy/memmove we'll need to
shuffle statepoint arguments. Make it possible by storing the
arguments as Value *, not Use *.

3 years ago[NFC] Fixes Doxygen copy-paste error.
Mark de Wever [Wed, 21 Oct 2020 19:19:04 +0000 (21:19 +0200)]
[NFC] Fixes Doxygen copy-paste error.

3 years ago[mlir][CAPI][Python] Plumb OpPrintingFlags to C and Python APIs.
Stella Laurenzo [Wed, 21 Oct 2020 06:20:04 +0000 (23:20 -0700)]
[mlir][CAPI][Python] Plumb OpPrintingFlags to C and Python APIs.

* Adds a new MlirOpPrintingFlags type and supporting accessors.
* Adds a new mlirOperationPrintWithFlags function.
* Adds a full featured python Operation.print method with all options and the ability to print directly to files/stdout in text or binary.
* Adds an Operation.get_asm which delegates to print and returns a str or bytes.
* Reworks Operation.__str__ to be based on get_asm.

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

3 years ago[mlir][shape] Split out structural type conversions for shape dialect.
Sean Silva [Mon, 19 Oct 2020 22:59:03 +0000 (15:59 -0700)]
[mlir][shape] Split out structural type conversions for shape dialect.

A "structural" type conversion is one where the underlying ops are
completely agnostic to the actual types involved and simply need to update
their types. An example of this is shape.assuming -- the shape.assuming op
and the corresponding shape.assuming_yield op need to update their types
accordingly to the TypeConverter, but otherwise don't care what type
conversions are happening.

Also, the previous conversion code would not correctly materialize
conversions for the shape.assuming_yield op. This should have caused a
verification failure, but shape.assuming's verifier wasn't calling
RegionBranchOpInterface::verifyTypes (which for reasons can't be called
automatically as part of the trait verification, and requires being
called manually). This patch also adds that verification.

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

3 years ago[mlir] Add structural type conversions for SCF dialect.
Sean Silva [Fri, 16 Oct 2020 03:17:25 +0000 (20:17 -0700)]
[mlir] Add structural type conversions for SCF dialect.

A "structural" type conversion is one where the underlying ops are
completely agnostic to the actual types involved and simply need to update
their types. An example of this is scf.if -- the scf.if op and the
corresponding scf.yield ops need to update their types accordingly to the
TypeConverter, but otherwise don't care what type conversions are happening.

To test the structural type conversions, it is convenient to define a
bufferize pass for a dialect, which exercises them nicely.

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

3 years ago[CostModel] remove cost-kind predicate for scatter/gather cost
Sanjay Patel [Wed, 21 Oct 2020 18:19:52 +0000 (14:19 -0400)]
[CostModel] remove cost-kind predicate for scatter/gather cost

This is similar in spirit to 01ea93d85d6e (memcpy) except that
here the underlying caller assumptions were created for vectorizer
use (throughput) rather than other passes.

That meant ARM could have an enormous throughput cost with no
corresponding size, latency, or blended cost increase. X86 has
the same throughput restriction as the basic implementation, so
it is still unchanged.

Paraphrasing from the previous commit:
This may not make sense for some callers, but at least now the
costs will be consistently wrong instead of mysteriously wrong.

Targets should provide better overrides if the current modeling
is not accurate.

3 years ago[ARM] add cost-kind tests for intrinsics; NFC
Sanjay Patel [Wed, 21 Oct 2020 18:10:14 +0000 (14:10 -0400)]
[ARM] add cost-kind tests for intrinsics; NFC

This is a copy of the x86 file to provide better coverage;
x86 may have strange overrides that mask changes in the
generic model.

3 years ago[NFC][OpenMP] Update description of OMPGridValues enums
Saiyedul Islam [Wed, 21 Oct 2020 18:20:16 +0000 (18:20 +0000)]
[NFC][OpenMP] Update description of OMPGridValues enums

Update comments describing how OMPGridValues enums will be used in
clang, deviceRTLs, and hsa and cuda plugins.

Reviewed By: jdoerfert

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

3 years ago[gn build] try to fix clang build after 37c030f81a9fdd
Nico Weber [Wed, 21 Oct 2020 18:11:16 +0000 (14:11 -0400)]
[gn build] try to fix clang build after 37c030f81a9fdd

37c030f81a9fdd made it so that depending on //libcxx/include
automatically added the copied header dir to the include search path.
For some reason, clang can't build against the copied libcxx headers
(it complains about ldiv_t not being a type). I don't have a mac
to debug right now, but for the clang target this change was
unintentional anyways -- only depend on the copies target, instead
of on the target that also adjusts the include path.

3 years ago[NFC] Clean up always false variables
Arthur Eubanks [Thu, 8 Oct 2020 02:35:39 +0000 (19:35 -0700)]
[NFC] Clean up always false variables

Reviewed By: arsenm

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

3 years ago[libomptarget] Require LLVM source tree to build libomptarget
Jon Chesterfield [Wed, 21 Oct 2020 17:52:53 +0000 (18:52 +0100)]
[libomptarget] Require LLVM source tree to build libomptarget

[libomptarget] Require LLVM source tree to build libomptarget

This is to permit reliably #including files from the LLVM tree in libomptarget,
as an improvement on the copy and paste that is currently in use. See D87841
for the first example of removing duplication given this new requirement.

The weekly openmp dev call reached consensus on this approach. See also D87841
for some alternatives that were considered. In the future, we may want to
introduce a new top level repo for shared constants, or start using the ADT
library within openmp.

This will break sufficiently exotic build systems, trivial fixes as below.

Building libomptarget as part of the monorepo will continue to work.
If openmp is built separately, it now requires a cmake macro indicating
where to find the LLVM source tree.

If openmp is built separately, without the llvm source tree already on disk,
the build machine will need a copy of a subset of the llvm source tree and
the cmake macro indicating where it is.

Reviewed By: protze.joachim

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

3 years ago[ARM][SchedModels] Convert IsLdrAm3RegOffPred to MCSchedPredicate
Evgeny Leviant [Wed, 21 Oct 2020 17:49:10 +0000 (20:49 +0300)]
[ARM][SchedModels] Convert IsLdrAm3RegOffPred to MCSchedPredicate

Differential revision: https://reviews.llvm.org/D89876

3 years agoFix missing c++ mode comment
Matt Arsenault [Fri, 9 Oct 2020 00:05:18 +0000 (20:05 -0400)]
Fix missing c++ mode comment

3 years ago[NFC] Fix the definition of SuitableAlign
Xiangling Liao [Wed, 21 Oct 2020 17:34:56 +0000 (13:34 -0400)]
[NFC] Fix the definition of SuitableAlign

3 years ago[flang] Another validity of the TARGET= argument of ASSOCIATED() for objects
Peter Steinfeld [Mon, 19 Oct 2020 18:01:13 +0000 (11:01 -0700)]
[flang] Another validity of the TARGET= argument of ASSOCIATED() for objects

In my previous implementation of the semantic checks for ASSOCIATED(), I
had neglected to check the TARGET= argument for objects to ensure that
it has either the POINTER or TARGET attributes.

I added an implementation and a test.

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

3 years ago[AMDGPU] Fixed v_swap_b32 match
Stanislav Mekhanoshin [Fri, 16 Oct 2020 22:22:42 +0000 (15:22 -0700)]
[AMDGPU] Fixed v_swap_b32 match

1. Fixed liveness issue with implicit kills.
2. Fixed potential problem with an indirect mov.

Fixes: SWDEV-256848

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

3 years ago[ELF] --gc-sections: retain dependent sections of non-SHF_ALLOC sections
Fangrui Song [Wed, 21 Oct 2020 17:11:20 +0000 (10:11 -0700)]
[ELF] --gc-sections: retain dependent sections of non-SHF_ALLOC sections

Fix http://lists.llvm.org/pipermail/llvm-dev/2020-October/145908.html

Currently non-SHF_ALLOC SHT_REL[A] (due to --emit-relocs) and SHF_LINK_ORDER are not
marked live.

Reviewed By: grimar, psmith

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

3 years ago[X86] Improve variable vector insertion test coverage.
Simon Pilgrim [Wed, 21 Oct 2020 17:10:33 +0000 (18:10 +0100)]
[X86] Improve variable vector insertion test coverage.

Add tests for insertion into non-undef vectors

Add SSE2/AVX512F/AVX512BW coverage

3 years ago[X86] Regenerate old vector-variable-insertion test
Simon Pilgrim [Wed, 21 Oct 2020 17:00:23 +0000 (18:00 +0100)]
[X86] Regenerate old vector-variable-insertion test

3 years ago[clang] Improve Serialization/Imporing/Dumping of APValues
Tyker [Thu, 1 Oct 2020 15:58:07 +0000 (17:58 +0200)]
[clang] Improve Serialization/Imporing/Dumping of APValues

Changes:
 - initializer expressions of constexpr variable are now wraped in a ConstantExpr. this is mainly used for testing purposes. the old caching system has not yet been removed.
 - Add all the missing Serialization and Importing for APValue.
 - Improve dumping of APValue when ASTContext isn't available.
 - Cleanup leftover from last patch.
 - Add Tests for Import and serialization.

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

3 years ago[gn build] try to fix up deps of __config_site after 37c030f81a
Nico Weber [Wed, 21 Oct 2020 16:57:50 +0000 (12:57 -0400)]
[gn build] try to fix up deps of __config_site after 37c030f81a

3 years ago[libc++] Fix the installation of libc++ headers since the __config_site change
Louis Dionne [Wed, 21 Oct 2020 16:53:24 +0000 (12:53 -0400)]
[libc++] Fix the installation of libc++ headers since the __config_site change

3 years ago[gn build] (manually) port 5d796645d6c8cade (libcxx __config change)
Nico Weber [Wed, 21 Oct 2020 16:50:22 +0000 (12:50 -0400)]
[gn build] (manually) port 5d796645d6c8cade (libcxx __config change)

3 years ago[gn build] (manually) port 54fa9ecd3088
Nico Weber [Wed, 21 Oct 2020 16:43:01 +0000 (12:43 -0400)]
[gn build] (manually) port 54fa9ecd3088

3 years agoUse -### in arm-float-abi.c test
John Brawn [Wed, 21 Oct 2020 16:34:47 +0000 (17:34 +0100)]
Use -### in arm-float-abi.c test

This is needed to prevent the test from failing when llvm is
configured so that the arm target is not present, which is the case
for some buildbots.

3 years ago[AMDGPU] Refactor SOPC & SOPP .td for extension
Joe Nash [Mon, 19 Oct 2020 20:52:51 +0000 (16:52 -0400)]
[AMDGPU] Refactor SOPC & SOPP .td for extension

We use the Real vs Pseudo instruction abstraction for other
types of instructions to facilitate changes in opcode
between gpu generations.
This patch introduces that abstraction to SOPC and SOPP.

Reviewed By: rampitec

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

Change-Id: I59d53c2c7058b49d05b60350f4062a9b542d3138

3 years ago[mlir][gpu] Add lowering to LLVM for `gpu.wait` and `gpu.wait async`.
Christian Sigg [Wed, 21 Oct 2020 06:24:53 +0000 (08:24 +0200)]
[mlir][gpu] Add lowering to LLVM for `gpu.wait` and `gpu.wait async`.

Reviewed By: herhut

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

3 years ago[mlir][gpu] Add customer printer/parser for gpu.launch_func.
Christian Sigg [Wed, 21 Oct 2020 09:46:32 +0000 (11:46 +0200)]
[mlir][gpu] Add customer printer/parser for gpu.launch_func.

Reviewed By: herhut

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

3 years ago[mlir]: Clarify docs for external OpTrait::FunctionLike ops
Frej Drejhammar [Wed, 21 Oct 2020 16:07:30 +0000 (18:07 +0200)]
[mlir]: Clarify docs for external OpTrait::FunctionLike ops

The documentation claims that an op with the trait FunctionLike has a
single region containing the blocks that corresponding to the body of
the function. It then goes on to say that the absence of a region
corresponds to an external function when, in fact, this is represented
by a single empty region. This patch changes the wording in the
documentation to match the implementation.

Signed-off-by: Frej Drejhammar <frej.drejhammar@gmail.com>
Co-authored-by: Frej Drejhammar <frej.drejhammar@gmail.com>
Co-authored-by: Klas Segeljakt <klasseg@kth.se>
Reviewed By: ftynse

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

3 years agoAMDGPU: Lower the threshold reported for maximum stack size exceeded
Matt Arsenault [Fri, 16 Oct 2020 18:15:03 +0000 (14:15 -0400)]
AMDGPU: Lower the threshold reported for maximum stack size exceeded

Check the actual maximum supported stack size for a kernel.

3 years agoAMDGPU: Propagate amdgpu-flat-work-group-size attributes
Matt Arsenault [Mon, 19 Oct 2020 20:53:00 +0000 (16:53 -0400)]
AMDGPU: Propagate amdgpu-flat-work-group-size attributes

Fixes being overly conservative with the register counts in called
functions. This should try to do a conservative range merge, but for
now just clone.

Also fix not being able to functionally run the pass standalone.

3 years ago[libomptarget][amdgcn] Refactor memcpy to eliminate maps
JonChesterfield [Wed, 21 Oct 2020 15:59:16 +0000 (16:59 +0100)]
[libomptarget][amdgcn] Refactor memcpy to eliminate maps

[libomptarget][amdgcn] Refactor memcpy to eliminate maps

Builds on D89776 to remove now dead code.

Reviewed By: pdhaliwal

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

3 years ago[lldb] Fix windows build for fa5fa63fd140f
Pavel Labath [Wed, 21 Oct 2020 15:45:51 +0000 (17:45 +0200)]
[lldb] Fix windows build for fa5fa63fd140f

3 years ago[take 2] [libc++] Include <__config_site> from <__config>
Louis Dionne [Fri, 26 Jun 2020 16:08:59 +0000 (12:08 -0400)]
[take 2] [libc++] Include <__config_site> from <__config>

Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

This commit was originally applied in 1e46d1aa3 and reverted in eb60c487
because it broke the libc++abi and libunwind test suites. This has now
been fixed.

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

3 years agoFix "Unknown arguments specified" to if in lldb
Christopher Tetreault [Wed, 21 Oct 2020 14:23:54 +0000 (07:23 -0700)]
Fix "Unknown arguments specified" to if in lldb

Reviewed By: labath

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

3 years ago[lldb] Port lldb gdb-server to libOption
Pavel Labath [Thu, 15 Oct 2020 15:22:33 +0000 (17:22 +0200)]
[lldb] Port lldb gdb-server to libOption

The existing help text was very terse and was missing several important
options. In the new version, I add a short description of each option
and a slightly longer description of the tool as a whole.

The new option list does not include undocumented no-op options:
--debug and --verbose. It also does not include undocumented short
aliases for long options, with two exceptions: -h, because it's
well-known; and -S (--setsid), as it's used in one test. Using these
options will now produce an error. I believe that is acceptable as users
aren't generally invoking lldb-server directly, and the only way to
learn about the short aliases was by looking at the source.

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

3 years agoRemove .svn from exclude list as we moved to git
Sylvestre Ledru [Wed, 21 Oct 2020 14:09:07 +0000 (16:09 +0200)]
Remove .svn from exclude list as we moved to git

Reviewed By: emaste

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

3 years ago[ARM] [TableGen] Clean up !if(!eq(boolean, 1) and related booleans
Paul C. Anagnostopoulos [Tue, 20 Oct 2020 20:41:56 +0000 (16:41 -0400)]
[ARM] [TableGen] Clean up !if(!eq(boolean, 1) and related booleans

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

3 years ago[nfc] [lldb] Fix harmless slicing of DWARFDIE
Jan Kratochvil [Wed, 21 Oct 2020 13:49:53 +0000 (15:49 +0200)]
[nfc] [lldb] Fix harmless slicing of DWARFDIE

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

3 years ago[DebugInfo] Follow up c521e44defb5 with an API improvement
Jeremy Morse [Wed, 21 Oct 2020 13:28:28 +0000 (14:28 +0100)]
[DebugInfo] Follow up c521e44defb5 with an API improvement

As mentioned post-commit in D85749, the 'substituteDebugValuesForInst'
method added in c521e44defb5 would be better off with a limit on the
number of operands to substitute. This handles the common case of
"substitute the first operand between these two differing instructions",
or possibly up to N first operands.

3 years agoOnly run when `arm` is registered. NFC.
Michael Liao [Wed, 21 Oct 2020 13:28:50 +0000 (09:28 -0400)]
Only run when `arm` is registered. NFC.

3 years ago[libc++] Revert "Include <__config_site> from <__config>"
Louis Dionne [Wed, 21 Oct 2020 13:17:30 +0000 (09:17 -0400)]
[libc++] Revert "Include <__config_site> from <__config>"

This temporarily reverts commit 1e46d1aa until I find a solution to fix
the libc++abi and libunwind test suites with that change.

3 years ago[CostModel] remove cost-kind predicate for memcpy cost
Sanjay Patel [Wed, 21 Oct 2020 12:25:09 +0000 (08:25 -0400)]
[CostModel] remove cost-kind predicate for memcpy cost

The default implementation base returns TCC_Expensive (currently
set to '4'), so that explains the test diff. This probably does
not make sense for most callers, but at least now the costs will
be consistently wrong instead of mysteriously wrong.

The ARM target has an override that tries to model codegen expansion,
and that should likely be adapted for general usage.

This probably does not affect anything because the vectorizers are
the primary users of the throughput cost, but memcpy is not listed
as a trivially vectorizable intrinsic.

3 years ago[libc++] Include <__config_site> from <__config>
Louis Dionne [Fri, 26 Jun 2020 16:08:59 +0000 (12:08 -0400)]
[libc++] Include <__config_site> from <__config>

Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

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

3 years ago[SystemZ] Mark unsaved argument R6 as live throughout function.
Jonas Paulsson [Thu, 15 Oct 2020 08:04:06 +0000 (10:04 +0200)]
[SystemZ] Mark unsaved argument R6 as live throughout function.

For historical reasons, the R6 register is a callee-saved argument
register. This means that if it is used to pass an argument to a function
that does not clobber it, it is live throughout the function.

This patch makes sure that in this special case any kill flags of it are
removed.

Review: Ulrich Weigand, Eli Friedman

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

3 years ago[LIT] fixed up accidentally committed EOF problems.
Ben Dunbobbin [Wed, 21 Oct 2020 12:29:58 +0000 (13:29 +0100)]
[LIT] fixed up accidentally committed EOF problems.

3 years ago[LIT] error if directly named test won't be run indirectly
Ben Dunbobbin [Wed, 21 Oct 2020 12:09:15 +0000 (13:09 +0100)]
[LIT] error if directly named test won't be run indirectly

Currently, a LIT test named directly (on the command line) will
be run even if the name of the test file does not meet the rules
to be considered a test in the LIT test configuration files for
its test suite. For example, if the test does not have a
recognised file extension.

This makes it relatively easy to write a LIT test that won't
actually be run. I did in: https://reviews.llvm.org/D82567

This patch adds an error to avoid users doing that. There is a
small performance overhead for this check. A command line option
has been added so that users can opt into the old behaviour.

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

3 years ago[llvm] Use early exits and get rid of if-return-else-return pattern; NFC
Kirill Bobyrev [Wed, 21 Oct 2020 12:18:36 +0000 (14:18 +0200)]
[llvm] Use early exits and get rid of if-return-else-return pattern; NFC

https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code

Reviewed By: kadircet

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

3 years ago[llvm-mca] Add test for cortex-a57 memory instructions
Evgeny Leviant [Wed, 21 Oct 2020 12:09:26 +0000 (15:09 +0300)]
[llvm-mca] Add test for cortex-a57 memory instructions

3 years ago[clang testing] Fix a read-only source build system failure
David Zarzycki [Wed, 21 Oct 2020 12:07:26 +0000 (08:07 -0400)]
[clang testing] Fix a read-only source build system failure

3 years ago[Clang] Update newpm pipeline test in clang after D87322.
Florian Hahn [Wed, 21 Oct 2020 11:59:50 +0000 (12:59 +0100)]
[Clang] Update newpm pipeline test in clang after D87322.

This fixes a test failure because a LLVM pipeline test file in clang/
did not get updated in 88241ffb5636.

3 years ago[InstCombine] foldOrOfICmps - use m_Specific instead of explicit comparisons. NFCI.
Simon Pilgrim [Wed, 21 Oct 2020 10:53:25 +0000 (11:53 +0100)]
[InstCombine] foldOrOfICmps - use m_Specific instead of explicit comparisons. NFCI.

3 years ago[DAG] getNode(ISD::EXTRACT_SUBVECTOR) Drop unnecessary N2C null check - we assert...
Simon Pilgrim [Wed, 21 Oct 2020 10:08:25 +0000 (11:08 +0100)]
[DAG] getNode(ISD::EXTRACT_SUBVECTOR) Drop unnecessary N2C null check - we assert that this isn't null and have already used the pointer. NFCI.

Fixes cppcheck + null dereference warning.

3 years agoAdd "SkipDead" parameter to TargetInstrInfo::DefinesPredicate
Nicholas Guy [Mon, 28 Sep 2020 15:49:41 +0000 (16:49 +0100)]
Add "SkipDead" parameter to TargetInstrInfo::DefinesPredicate

Some instructions may be removable through processes such as IfConversion,
however DefinesPredicate can not be made aware of when this should be considered.
This parameter allows DefinesPredicate to distinguish these removable instructions
on a per-call basis, allowing for more fine-grained control from processes like
ifConversion.

Renames DefinesPredicate to ClobbersPredicate, to better reflect it's purpose

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

3 years ago[TargetLowering] Check boolean content when folding bit compare
Sven van Haastregt [Wed, 21 Oct 2020 10:46:55 +0000 (11:46 +0100)]
[TargetLowering] Check boolean content when folding bit compare

Updates an optimization that relies on boolean contents being either 0
or 1 to properly check for this before triggering.

The following:
  (X & 8) != 0 --> (X & 8) >> 3
Produces unexpected results when a boolean 'true' value is represented
by negative one.

Patch by Erik Hogeman.

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

3 years ago[TargetLowering] Add test for bit comparison fold
Sven van Haastregt [Wed, 21 Oct 2020 09:02:50 +0000 (10:02 +0100)]
[TargetLowering] Add test for bit comparison fold

This adds a test covering an issue in bit comparison folding.  The
issue will be addressed in the subsequent commit.

Patch by Erik Hogeman.

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

3 years ago[AMDGPU] Fix off by one in assert
Sebastian Neubauer [Tue, 20 Oct 2020 16:23:24 +0000 (18:23 +0200)]
[AMDGPU] Fix off by one in assert

D89217 did not subtract one when accessing SubRegFromChannelTable in one
place.

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

3 years ago[Driver] Incorporate -mfloat-abi in the computed triple on ARM
John Brawn [Wed, 21 Oct 2020 10:18:04 +0000 (11:18 +0100)]
[Driver] Incorporate -mfloat-abi in the computed triple on ARM

LLVM assumes that when it creates a call to a C library function it
can use the C calling convention. On ARM the effective calling
convention is determined from the target triple, however using
-mfloat-abi=hard on ARM means that calls to (and definitions of) C
library functions use the arm_aapcs_vfpcc calling convention which can
result in a mismatch.

Fix this by incorporating -mfloat-abi into the target triple, similar
to how -mbig-endian and -march/-mcpu are. This only works for EABI
targets and not Android or iOS, but there the float abi is fixed so
instead give an error.

Fixes PR45524

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

3 years ago[ADT] Fix for ImmutableMapRef
Adam Balogh [Thu, 15 Oct 2020 13:07:48 +0000 (15:07 +0200)]
[ADT] Fix for ImmutableMapRef

The `Root` member of `ImmutableMapRef` was changed recently from a plain
pointer to `IntrusiveRefCntPtr`. However, the `Profile` member function
was not adjusted. This results in comilation error whenever the
`Profile` method is used on an `ImmutableMapRef`. This patch fixes this
issue and also adds unit tests for `ImmutableMapRef`.

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

3 years ago[InstructionSimplify] And precommit more tests for D89317. NFC.
Sjoerd Meijer [Wed, 21 Oct 2020 09:53:28 +0000 (10:53 +0100)]
[InstructionSimplify] And precommit more tests for D89317. NFC.

3 years ago[mlir] ODS: support TableGen dag objects to specify OpBuilder parameters
Alex Zinenko [Fri, 16 Oct 2020 09:40:34 +0000 (11:40 +0200)]
[mlir] ODS: support TableGen dag objects to specify OpBuilder parameters

Historically, custom builder specification in OpBuilder has been accepting the
formal parameter list for the builder method as a raw string containing C++.
While this worked well to connect the signature and the body, this became
problematic when ODS needs to manipulate the parameter list, e.g. to inject
OpBuilder or to trim default values when generating the definition. This has
also become inconsistent with other method declarations, in particular in
interface definitions.

Introduce the possibility to define OpBuilder formal parameters using a
TableGen dag similarly to other methods. Additionally, introduce a mechanism to
declare parameters with default values using an additional class. This
mechanism can be reused in other methods. The string-based builder signature
declaration is deprecated and will be removed after a transition period.

Reviewed By: jpienaar

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

3 years ago[Passes] Move ADCE before DSE & LICM.
Florian Hahn [Wed, 21 Oct 2020 09:21:50 +0000 (10:21 +0100)]
[Passes] Move ADCE before DSE & LICM.

The adjustment seems to have very little impact on optimizations.
The only binary change with -O3 MultiSource/SPEC2000/SPEC2006 on X86 is
in consumer-typeset and the size there actually decreases by -0.1%, with
not significant changes in the stats.

On its own, it is mildly positive in terms of compile-time, most likely
due to LICM & DSE having to process slightly less instructions. It
should also be unlikely that DSE/LICM make much new code dead.

http://llvm-compile-time-tracker.com/compare.php?from=df63eedef64d715ce1f31843f7de9c11fe1e597f&to=e3bdfcf94a9eeae6e006d010464f0c1b3550577d&stat=instructions

With DSE & MemorySSA, it gives some nice compile-time improvements, due
to the fact that DSE can re-use the PDT from ADCE, if it does not make
any changes:

http://llvm-compile-time-tracker.com/compare.php?from=15fdd6cd7c24c745df1bb419e72ff66fd138aa7e&to=481f494515fc89cb7caea8d862e40f2c910dc994&stat=instructions

Reviewed By: xbolva00

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

3 years ago[InstructionSimplify] Precommit more tests for D89317. NFC.
Sjoerd Meijer [Wed, 21 Oct 2020 09:02:04 +0000 (10:02 +0100)]
[InstructionSimplify] Precommit more tests for D89317. NFC.

3 years ago[AMDGPU][TableGen] Make more use of !ne !not !and !or. NFC.
Jay Foad [Wed, 21 Oct 2020 08:17:28 +0000 (09:17 +0100)]
[AMDGPU][TableGen] Make more use of !ne !not !and !or. NFC.

3 years agoReapply "[clang] Improve handling of physical registers in inline
Jonas Paulsson [Wed, 14 Oct 2020 06:48:29 +0000 (08:48 +0200)]
Reapply "[clang] Improve handling of physical registers in inline
         assembly operands."

Earlyclobbers are now excepted from this change (original commit: c78da03).

Review: Ulrich Weigand, Nick Desaulniers

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

3 years ago[compiler-rt][builtins][RISCV] Always include __mul[sd]i3 builtin definitions
Luís Marques [Wed, 21 Oct 2020 08:47:25 +0000 (09:47 +0100)]
[compiler-rt][builtins][RISCV] Always include __mul[sd]i3 builtin definitions

The RISC-V implementations of the `__mulsi3`, `__muldi3` builtins were
conditionally compiling the actual function definitions depending on whether
the M extension was present or not. This caused Compiler-RT testing failures
for RISC-V targets with the M extension, as when these sources were included
the `librt_has_mul*i3` features were still being defined. These `librt_has_*`
definitions are used to conditionally run the respective tests. Since the
actual functions were not being compiled-in, the generic test for `__muldi3`
would fail. This patch makes these implementations follow the normal
Compiler-RT convention of always including the definition, and conditionally
running the respective tests by using the lit conditional
`REQUIRES: librt_has_*`.

Since the `mulsi3_test.c` wasn't actually RISC-V-specific, this patch also
moves it out of the `riscv` directory. It now only depends on
`librt_has_mulsi3` to run.

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

3 years ago[NFC][LSAN] Use InitializeCommonFlags in LSAN
Vitaly Buka [Wed, 21 Oct 2020 08:33:21 +0000 (01:33 -0700)]
[NFC][LSAN] Use InitializeCommonFlags in LSAN

3 years ago[X86] Add clang release notes for HRESET and minor change for llvm release notes...
Wang, Pengfei [Wed, 21 Oct 2020 07:57:43 +0000 (15:57 +0800)]
[X86] Add clang release notes for HRESET and minor change for llvm release notes. (NFC)

3 years ago[mlir] Fix copy-pasted docstrings in Python bindings
Alex Zinenko [Tue, 20 Oct 2020 09:22:29 +0000 (11:22 +0200)]
[mlir] Fix copy-pasted docstrings in Python bindings

Docstrings for `__str__` method in many classes was recycling the constant
string defined for `Type`, without being types themselves. Use proper
docstrings instead. Since they are succint, use string literals instead of
top-level constants to avoid further mistakes.

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

3 years ago[mlir] Use the correct base class for Attributes in Python bindings
Alex Zinenko [Tue, 20 Oct 2020 09:22:02 +0000 (11:22 +0200)]
[mlir] Use the correct base class for Attributes in Python bindings

The pybind class typedef for concrete attribute classes was erroneously
deriving all of them from PyAttribute instead of the provided base class. This
has not been triggering any error because only one level of the hierarchy is
currently exposed.

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

3 years ago[mlir] Expose Value hierarchy to Python bindings
Alex Zinenko [Tue, 20 Oct 2020 09:21:05 +0000 (11:21 +0200)]
[mlir] Expose Value hierarchy to Python bindings

Values are ubiquitous in the IR, in particular block argument and operation
results are Values. Define Python classes for BlockArgument, OpResult and their
common ancestor Value. Define pseudo-container classes for lists of block
arguments and operation results, and use these containers to access the
corresponding values in blocks and operations.

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

3 years ago[X86] Remove period from end of error message in assembler
Craig Topper [Wed, 21 Oct 2020 07:42:39 +0000 (00:42 -0700)]
[X86] Remove period from end of error message in assembler

Addresses post-commit feedback from D89837.

3 years ago[SVE][CodeGen] Replace use of TypeSize comparison operator in CreateStackTemporary
David Sherwood [Wed, 30 Sep 2020 12:36:59 +0000 (13:36 +0100)]
[SVE][CodeGen] Replace use of TypeSize comparison operator in CreateStackTemporary

We were previously relying upon the TypeSize comparison operators to
obtain the maximum size of two types, however use of such operators is
being deprecated in favour of making the caller aware that it could
be dealing with scalable vector types. I have changed the code to assert
that the two types have the same scalable property and thus we can
simply take the maximum of the known minimum sizes instead.

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

3 years ago[SVE] Remove reliance on TypeSize comparison operators in unit tests
David Sherwood [Fri, 9 Oct 2020 13:29:15 +0000 (14:29 +0100)]
[SVE] Remove reliance on TypeSize comparison operators in unit tests

The EXPECT_XY comparison functions all rely upon using the existing
TypeSize comparison operators, which we are deprecating in favour
of isKnownXY. I've changed all such cases to compare either the known
minimum size or the fixed size.

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

3 years ago[libcxx] [test] Split the file_time_type synopsis test
Martin Storsjö [Fri, 16 Oct 2020 09:49:01 +0000 (12:49 +0300)]
[libcxx] [test] Split the file_time_type synopsis test

Split the resolution check to a separate test, which is marked as
unsupported on windows.

On windows (both with MS STL and libstdc++), the file time has
100 ns resolution; the standard doesn't mandate a specific resolution.

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

3 years agoRevert "[InstCombine] Add or((icmp ult/ule (A + C1), C3), (icmp ult/ule (A + C2)...
Martin Storsjö [Wed, 21 Oct 2020 06:33:51 +0000 (09:33 +0300)]
Revert "[InstCombine] Add or((icmp ult/ule (A + C1), C3), (icmp ult/ule (A + C2), C3)) uniform vector support"

Also revert "[InstCombine] foldOrOfICmps - use m_Specific instead of
explicit comparisons. NFCI." to make the primarily intended revert
work.

This reverts commits ce13549761b6a22263e051dda09ef5122435008b and
e372a5f86f6488bb0c2593a665d51fdd3a97c6e4.

This commit caused failed asserts e.g. like this:

$ cat repro.cpp
bool a(char b) {
  return b >= '0' && b <= '9' || (b | 32) >= 'a' && (b | 32) <= 'z';
$ clang++ -target x86_64-linux-gnu -c -O2 repro.cpp
clang++: ../include/llvm/ADT/APInt.h:1151: bool llvm::APInt::operator==(const
llvm::APInt&) const: Assertion `BitWidth == RHS.BitWidth && "Comparison
requires equal bit widths"' failed.

3 years ago[NFC][PowerPC]Add tests for folding RLWINM before and after RA.
Esme-Yi [Wed, 21 Oct 2020 06:38:22 +0000 (06:38 +0000)]
[NFC][PowerPC]Add tests for folding RLWINM before and after RA.

3 years agoRevert "[SCEV] Prove implications of different type via truncation"
Max Kazantsev [Wed, 21 Oct 2020 06:03:46 +0000 (13:03 +0700)]
Revert "[SCEV] Prove implications of different type via truncation"

This reverts commit 80852a4f2fb154c6094bb9d9e3457757d5a60ad1.

Test is now broken because underlying required patch was also reverted SUDDENLY.

3 years ago[SCEV] Prove implications of different type via truncation
Max Kazantsev [Wed, 21 Oct 2020 05:42:40 +0000 (12:42 +0700)]
[SCEV] Prove implications of different type via truncation

When we need to prove implication of expressions of different type width,
the default strategy is to widen everything to wider type and prove in this
type. This does not interact well with AddRecs with negative steps and
unsigned predicates: such AddRec will likely not have a `nuw` flag, and its
`zext` to wider type will not be an AddRec. In contraty, `trunc` of an AddRec
in some cases can easily be proved to be an `AddRec` too.

This patch introduces an alternative way to handling implications of different
type widths. If we can prove that wider type values actually fit in the narrow type,
we truncate them and prove the implication in narrow type.

Differential Revision: https://reviews.llvm.org/D89548
Reviewed By: fhahn

3 years ago[X86] Error on using h-registers with REX prefix in the assembler instead of leaving...
Craig Topper [Wed, 21 Oct 2020 03:59:27 +0000 (20:59 -0700)]
[X86] Error on using h-registers with REX prefix in the assembler instead of leaving it to a fatal error in the encoder.

Using a fatal error is bad for user experience.

Reviewed By: pengfei

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

3 years agoRevert D89381 "[SCEV] Recommit "Use nw flag and symbolic iteration count to sharpen...
Fangrui Song [Wed, 21 Oct 2020 04:03:58 +0000 (21:03 -0700)]
Revert D89381 "[SCEV] Recommit "Use nw flag and symbolic iteration count to sharpen ranges of AddRecs", attempt 2"

This reverts commit a10a64e7e334dc878d281aba9a46f751fe606567.

It broke polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
The difference suggests that this may be a serious issue.

3 years ago[NFC][MC] Use [MC]Register in MachineVerifier
Mircea Trofin [Tue, 20 Oct 2020 19:09:38 +0000 (12:09 -0700)]
[NFC][MC] Use [MC]Register in MachineVerifier

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

3 years agoRemove unnecessary header include which violates layering
Geoffrey Martin-Noble [Wed, 21 Oct 2020 02:35:17 +0000 (19:35 -0700)]
Remove unnecessary header include which violates layering

This was introduced in https://reviews.llvm.org/D89774, but I don't
think it should be necessary.

Reviewed By: TaWeiTu, aeubanks

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

3 years ago[AMDGPU][NFC] Fix missing size in comment
Carl Ritson [Wed, 21 Oct 2020 02:38:21 +0000 (11:38 +0900)]
[AMDGPU][NFC] Fix missing size in comment

3 years ago[Polly] Delete unused lambda capture after 7175cffb2133048018df74c1b49d1d4962ea18f2
Fangrui Song [Wed, 21 Oct 2020 01:34:31 +0000 (18:34 -0700)]
[Polly] Delete unused lambda capture after 7175cffb2133048018df74c1b49d1d4962ea18f2

3 years agoRevert "This is a test commit"
TaWeiTu [Wed, 21 Oct 2020 01:34:15 +0000 (09:34 +0800)]
Revert "This is a test commit"

This reverts commit cbe0ee1a94d11bd32019920c8f55ebd58054542a.