platform/upstream/llvm.git
3 years ago[llvm] Make Sequence reverse-iterable
Guillaume Chatelet [Thu, 10 Jun 2021 11:15:28 +0000 (11:15 +0000)]
[llvm] Make Sequence reverse-iterable

This is a roll forward of D102679.
This patch simplifies the implementation of Sequence and makes it compatible with llvm::reverse.
It exposes the reverse iterators through rbegin/rend which prevents a dangling reference in std::reverse_iterator::operator++().

Note: Compared to D102679, this patch introduces a `asSmallVector()` member function and fixes compilation issue with GCC 5.

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

3 years ago[NFC][XCOFF] Replace structs FileHeader32/SectionHeader32 with constants.
Esme-Yi [Thu, 10 Jun 2021 11:10:45 +0000 (11:10 +0000)]
[NFC][XCOFF] Replace structs FileHeader32/SectionHeader32 with constants.

Summary: Some structs like FileHeader32/SectionHeader32
defined in llvm/include/llvm/BinaryFormat/XCOFF.h seem
unnecessary, because we only need their size. So this
patch removes them and defines size constants directly.

Reviewed By: jhenderson

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

3 years ago[llvm][PPC] Add missing case for 'I' asm memory operands
Timm Bäder [Thu, 10 Jun 2021 04:48:09 +0000 (06:48 +0200)]
[llvm][PPC] Add missing case for 'I' asm memory operands

From https://llvm.org/docs/LangRef.html#asm-template-argument-modifiers:

I: Print the letter ‘i’ if the operand is an integer constant,
otherwise nothing. Used to print ‘addi’ vs ‘add’ instructions.

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

3 years agoReland "[gn build] port d1d36f7ad (llvm-tapi-diff)"
Nico Weber [Thu, 10 Jun 2021 10:22:03 +0000 (06:22 -0400)]
Reland "[gn build] port d1d36f7ad (llvm-tapi-diff)"

This reverts commit d84ed15c649616a50abdd7fbd9b28ddebb9f432c
The original change relanded in 5b5ab80e3195.

3 years ago[flang][windows] Run regression tests under Windows. NFCI.
Michael Kruse [Thu, 10 Jun 2021 10:06:56 +0000 (05:06 -0500)]
[flang][windows] Run regression tests under Windows. NFCI.

Allow the lit test suite to run under Windows. This encompasses the following changes:

 * Define `lit_tools_dir` for flang's test configuration
 * Replace `(<command> || true)` idiom with `not <command>`
 * Add `REQUIRES: shell` on tests that invoke a shell script

Reviewed By: awarzynski

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

3 years agoRevert "Implementation of global.get/set for reftypes in LLVM IR"
David Spickett [Thu, 10 Jun 2021 10:11:17 +0000 (10:11 +0000)]
Revert "Implementation of global.get/set for reftypes in LLVM IR"

This reverts commit 31859f896cf90d64904134ce7b31230f374c3fcc.

Causing SVE and RISCV-V test failures on bots.

3 years agoFix MSVC int64_t -> uint64_t "narrowing conversion" warning.
Simon Pilgrim [Thu, 10 Jun 2021 09:55:06 +0000 (10:55 +0100)]
Fix MSVC int64_t -> uint64_t "narrowing conversion" warning.

3 years agoAdd explicit braces to silence warning about ambiguous 'else' inside the EXPECT_EQ...
Simon Pilgrim [Wed, 9 Jun 2021 17:19:49 +0000 (18:19 +0100)]
Add explicit braces to silence warning about ambiguous 'else' inside the EXPECT_EQ macro. NFCI.

3 years ago[TargetLowering] getABIAlignmentForCallingConv - pass DataLayout by const reference...
Simon Pilgrim [Wed, 9 Jun 2021 16:30:00 +0000 (17:30 +0100)]
[TargetLowering] getABIAlignmentForCallingConv - pass DataLayout by const reference. NFCI.

Avoid unnecessary copies and match every other method in TargetLowering that takes DataLayout as an argument.

3 years ago[clang][Arm] Require arm and aarch64 target for bf16 intrinsics test
David Spickett [Thu, 10 Jun 2021 09:44:34 +0000 (09:44 +0000)]
[clang][Arm] Require arm and aarch64 target for bf16 intrinsics test

3 years ago[mlir] make LLVMPointerType implement the data layout type interface
Alex Zinenko [Wed, 9 Jun 2021 09:51:15 +0000 (11:51 +0200)]
[mlir] make LLVMPointerType implement the data layout type interface

This brings us closer to replacing the LLVM data layout string with a
first-class layout modeling in MLIR.

Depends On D103945

Reviewed By: nicolasvasilache

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

3 years ago[OpenCL] Relax test implicit members in C++ for OpenCL
Ole Strohm [Thu, 10 Jun 2021 08:36:37 +0000 (09:36 +0100)]
[OpenCL] Relax test implicit members in C++ for OpenCL

Addresses the issue from a comment in D103252

Relaxes the test to account for some targets with added attributes
to inside the pattern.

3 years ago[OpenCL] Add builtin header test
Sven van Haastregt [Thu, 10 Jun 2021 09:05:53 +0000 (10:05 +0100)]
[OpenCL] Add builtin header test

Add a test to verify OpenCL builtin declarations using
OpenCLBuiltins.td.

This test consists of parsing a 60k line generated input file.  The
entire test takes about 60s with a debug build on a decent machine.
Admittedly this is not the fastest test, but doesn't seem excessive
compared to other tests in clang/test/Headers (with one of the tests
taking 85s for example).

RFC: https://lists.llvm.org/pipermail/cfe-dev/2021-April/067973.html

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

3 years agoImplementation of global.get/set for reftypes in LLVM IR
Paulo Matos [Thu, 10 Jun 2021 08:02:10 +0000 (10:02 +0200)]
Implementation of global.get/set for reftypes in LLVM IR

This change implements new DAG notes GLOBAL_GET/GLOBAL_SET, and
lowering methods for load and stores of reference types from IR
globals. Once the lowering creates the new nodes, tablegen pattern
matches those and converts them to Wasm global.get/set.

Reviewed By: tlively

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

3 years agoRevert "[Verifier] Speed up and parallelize dominance checking. NFC"
Alexander Kornienko [Thu, 10 Jun 2021 07:58:05 +0000 (09:58 +0200)]
Revert "[Verifier] Speed up and parallelize dominance checking.  NFC"

This reverts commit 08664d005c02003180371049b19c7e5d01541c58, which according to
https://reviews.llvm.org/D103373 was pushed accidentally, and I believe it
causes timeouts in some internal mlir tests.

3 years agoRevert "[AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier"
Martin Storsjö [Thu, 10 Jun 2021 07:30:13 +0000 (10:30 +0300)]
Revert "[AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier"

This reverts commit d96ea46629803641038ebe46d8cd512f8cf7e20f, as it
caused various misoptimizations, see https://reviews.llvm.org/D103597
for discussion on the issues.

3 years ago[LangRef] Fix missing code highlighting format
Juneyoung Lee [Thu, 10 Jun 2021 07:11:43 +0000 (16:11 +0900)]
[LangRef] Fix missing code highlighting format

3 years ago[XCOFF][llvm-objdump] Dump the debug type in `--section-headers` option.
Esme-Yi [Thu, 10 Jun 2021 07:08:23 +0000 (07:08 +0000)]
[XCOFF][llvm-objdump] Dump the debug type in `--section-headers` option.

Summary: Add XCOFF recognition of debug section types
under `--section-headers` option.

Reviewed By: jhenderson

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

3 years ago[mlir] Support pre-existing tokens in 'gpu-async-region'
Christian Sigg [Thu, 10 Jun 2021 05:50:29 +0000 (07:50 +0200)]
[mlir] Support pre-existing tokens in 'gpu-async-region'

Allow gpu ops implementing the async interface to already be async when running the GpuAsyncRegionPass.
That pass threads a 'current token' through a block with ops implementing the gpu async interface.

After this change, existing async ops (returning a !gpu.async.token) set the current token.
Existing synchronous `gpu.wait` ops reset the current token.

Reviewed By: herhut

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

3 years ago[NFC] Pre-commit tests for VectorCombine scalarize
Qiu Chaofan [Thu, 10 Jun 2021 06:28:33 +0000 (14:28 +0800)]
[NFC] Pre-commit tests for VectorCombine scalarize

3 years ago[Docs] Fix incorrect return type for example code
Jim Lin [Thu, 10 Jun 2021 03:30:31 +0000 (11:30 +0800)]
[Docs] Fix incorrect return type for example code

3 years agoUpdate my mailmap
Qiu Chaofan [Thu, 10 Jun 2021 06:14:57 +0000 (14:14 +0800)]
Update my mailmap

3 years ago[libcxx][optional] adds missing constexpr operations
Christopher Di Bella [Sun, 9 May 2021 01:30:32 +0000 (01:30 +0000)]
[libcxx][optional] adds missing constexpr operations

Makes the following operations constexpr:
  * `std::swap(optional, optional)`
  * `optional(optional<U> const&)`
  * `optional(optional<U>&&)`
  * `~optional()`
  * `operator=(nullopt_t)`
  * `operator=(U&&)`
  * `operator=(optional<U> const&)`
  * `operator=(optional<U>&&)`
  * `emplace(Args&&...)`
  * `emplace(initializer_list<U>, Args&&...)`
  * `swap(optional&)`
  * `reset()`

P2231 has been accepted by plenary, with the committee recommending
implementers retroactively apply to C++20. It's necessary for us to
implement _`semiregular-box`_ and _`non-propagating-cache`_, both of
which are required for ranges (otherwise we'll need to reimplement
`std::optional` with these members `constexpr`ified).

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

3 years ago[libc] Remove libc-fuzzer as a dependency to check-libc.
Siva Chandra Reddy [Thu, 10 Jun 2021 05:05:11 +0000 (05:05 +0000)]
[libc] Remove libc-fuzzer as a dependency to check-libc.

3 years ago[ConstantFolding] Enable folding of min/max/copysign for all floats
Serge Pavlov [Wed, 9 Jun 2021 03:49:17 +0000 (10:49 +0700)]
[ConstantFolding] Enable folding of min/max/copysign for all floats

Previously such folding was enabled for half, float and double values
only. With this change it is allowed for other floating point values
also.

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

3 years ago[Utils][vim] Highlight 'ptr' type
Tom Stellard [Fri, 14 May 2021 03:54:04 +0000 (20:54 -0700)]
[Utils][vim] Highlight 'ptr' type

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

3 years ago[llvm-objdump][XCOFF] Enable the -l (--line-numbers) option.
Esme-Yi [Thu, 10 Jun 2021 04:37:06 +0000 (04:37 +0000)]
[llvm-objdump][XCOFF] Enable the -l (--line-numbers) option.

Summary: Add support for dumping line number
information for XCOFF object files in llvm-objdump.

Reviewed By: jhenderson

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

3 years agoReland "[llvm] llvm-tapi-diff"
Sam Powell [Thu, 10 Jun 2021 04:13:31 +0000 (21:13 -0700)]
Reland "[llvm] llvm-tapi-diff"

This is relanding commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 .
This patch additionally addresses failures found in buildbots due to unstable build ordering & post review comments.

This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files.

Reviewed By: ributzka, JDevlieghere

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

3 years ago[HIP] Add --gpu-bundle-output
Yaxun (Sam) Liu [Thu, 29 Apr 2021 19:10:06 +0000 (15:10 -0400)]
[HIP] Add --gpu-bundle-output

Added --gpu-bundle-output to control bundling/unbundling output of HIP device compilation.

By default preprocessor expansion, llvm bitcode and assembly are unbundled, code objects are
bundled.

Reviewed by: Artem Belevich, Jan Svoboda

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

3 years ago[AMDGPU] Fix missing lowering of LDS used in global scope.
hsmahesha [Thu, 10 Jun 2021 02:30:23 +0000 (08:00 +0530)]
[AMDGPU] Fix missing lowering of LDS used in global scope.

Reviewed By: rampitec

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

3 years ago[AIX] Add traceback ssp canary bit support
Jinsong Ji [Thu, 10 Jun 2021 02:39:57 +0000 (02:39 +0000)]
[AIX] Add traceback ssp canary bit support

We will need to set the ssp canary bit in traceback table to communicate
with unwinder about the canary.

Reviewed By: #powerpc, shchenz

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

3 years ago[lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEAR...
Nico Weber [Wed, 9 Jun 2021 19:16:45 +0000 (15:16 -0400)]
[lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING

For debugging dylib loading, it's useful to have some insight into what
the linker is doing.

ld64 has the undocumented RC_TRACE_DYLIB_SEARCHING env var
for this printing dylib search candidates.

This adds a flag --print-dylib-search to make lld print the seame information.
It's useful for users, but also for writing tests. The output is formatted
slightly differently than ld64, but we still support RC_TRACE_DYLIB_SEARCHING
to offer at least a compatible way to trigger this.

ld64 has both `-print_statistics` and `-trace_symbol_output` to enable
diagnostics output. I went with "print" since that seems like a more
straightforward name.

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

3 years ago[libomptarget][amdgpu] Remove stray fprintf in rtl.cpp
Ron Lieberman [Thu, 10 Jun 2021 01:52:45 +0000 (01:52 +0000)]
[libomptarget][amdgpu] Remove stray fprintf in rtl.cpp

remove unintended fprintf in rtl.cpp

Reviewed By: pdhaliwal

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

3 years agoAdd .mailmap entries for myself, and sort the list
Jon Roelofs [Thu, 10 Jun 2021 01:35:13 +0000 (18:35 -0700)]
Add .mailmap entries for myself, and sort the list

3 years ago[clang][RISCV][test] Add more tests of the -mabi and -march options
Ben Shi [Thu, 10 Jun 2021 01:14:14 +0000 (09:14 +0800)]
[clang][RISCV][test] Add more tests of the -mabi and -march options

1. There is no tests for mabi=ilp32e, and my patch covers that.
2. The tests in riscv-abi.c will show default ABI changes for special archs
   in the future, especially the arch with the F but without the D extension.
3. The tests in riscv-arch.c will show default arch changes for abi=ilp32,
   which is rv32imacfd currently, but it is better to be rv32imac.
   And it is also better for abi=ilp32f defaults to arch=imacf.

Reviewed By: MaskRay, luismarques

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

3 years agoAnnotate memcpy's of globals with info about the src/dst
Jon Roelofs [Wed, 9 Jun 2021 23:36:38 +0000 (16:36 -0700)]
Annotate memcpy's of globals with info about the src/dst

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

3 years agoSave/restore OuterTemplateParams in AbstractManglingParser::parseEncoding.
Justin Lebar [Wed, 9 Jun 2021 23:57:22 +0000 (16:57 -0700)]
Save/restore OuterTemplateParams in AbstractManglingParser::parseEncoding.

Previously we were only saving plain TemplateParams.

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

3 years ago[lld/mac] Make framework symlinks in tests more realistic
Nico Weber [Thu, 10 Jun 2021 00:27:55 +0000 (20:27 -0400)]
[lld/mac] Make framework symlinks in tests more realistic

In a framework Foo.framework, Foo.framework/Foo is usually a relative
symbolic link to Foo.framework/Versions/Current/Foo,
and Foo.framework/Versions/Current is usually a relative symbolic
link to A.

Our tests used absolute symbolic links. Now they use relative symbolic links.

No behavior change, just makes the tests more representative of the real world.

(implicit-dylib.s omits the "Current" folder too, but I'm not changing that
here.)

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

3 years ago[lld/mac] When handling @loader_path, use realpath() of symlinks
Nico Weber [Wed, 9 Jun 2021 20:09:44 +0000 (16:09 -0400)]
[lld/mac] When handling @loader_path, use realpath() of symlinks

This is important for Frameworks, which are usually symlinks.

ld64 gets this right for @rpath that's replaced with @loader_path, but not for
bare @loader_path -- ld64's code calls realpath() in that case too, but ignores
the result.

ld64 somehow manages to find libbar1.dylib in the test without the
explicit `-rpath` in Foo1. I don't understand why or how. But this
change is a step forward and fixes an immediate problem I'm having,
so let's start with this :)

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

3 years agoFix to Windows temp file change.
Amy Huang [Wed, 9 Jun 2021 23:11:27 +0000 (16:11 -0700)]
Fix to Windows temp file change.

Original change passed wrong parameters to the raw_fd_ostream ctor.
Fixes a bug in https://reviews.llvm.org/D102736.

3 years agoFolds linalg.pad_tensor with zero padding
Ahmed Taei [Wed, 9 Jun 2021 19:04:38 +0000 (12:04 -0700)]
Folds linalg.pad_tensor with zero padding

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

3 years ago[RISCV] Remove unused method from RISCVInsertVSETVLI. NFC
Craig Topper [Wed, 9 Jun 2021 22:07:27 +0000 (15:07 -0700)]
[RISCV] Remove unused method from RISCVInsertVSETVLI. NFC

If this becomes needed its trivial to add it back.

3 years ago[tests] Precommit test for D103991
Philip Reames [Mon, 7 Jun 2021 23:20:25 +0000 (16:20 -0700)]
[tests] Precommit test for D103991

3 years ago[ms] [llvm-ml] Add support for INCLUDE environment variable
Eric Astor [Wed, 9 Jun 2021 20:05:12 +0000 (16:05 -0400)]
[ms] [llvm-ml] Add support for INCLUDE environment variable

Also adds support for the ML.exe command-line flag /X, which ignores the INCLUDE environment variable.

This relands commit c43f413b01b021a8f7b6fce013296114fa92a245 using lit's cross-platform `env` support.

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

3 years agoAdd a static assertions for custom Op<> to not defined data members (NFC)
Mehdi Amini [Tue, 8 Jun 2021 18:28:39 +0000 (18:28 +0000)]
Add a static assertions for custom Op<> to not defined data members (NFC)

A common mistake for newcomers to MLIR is to try to store extra member
on the Op class. However these are intended to be thing wrapper around
an Operation*, all the storage is meant to be encoded in attribute on
the underlying Operation. This can be confusing to debug, so better
catch it at build time.

Reviewed By: ftynse

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

3 years ago[SCEV] Minor code motion to simplify a later patch [nfc]
Philip Reames [Wed, 9 Jun 2021 21:17:06 +0000 (14:17 -0700)]
[SCEV] Minor code motion to simplify a later patch [nfc]

3 years agoRevert "Reland "[llvm] llvm-tapi-diff""
Cyndy Ishida [Wed, 9 Jun 2021 20:46:12 +0000 (13:46 -0700)]
Revert "Reland "[llvm] llvm-tapi-diff""

This reverts commit 20126c9fd4afe2fe11510becccaa769332da302f.
The sorting fixes failed to have stable output on different platforms.

3 years agoRevert "[llvm-tapi-diff] Apply stable sorting to output"
Cyndy Ishida [Wed, 9 Jun 2021 20:45:13 +0000 (13:45 -0700)]
Revert "[llvm-tapi-diff] Apply stable sorting to output"

This reverts commit 90a26a41e9ce16a4d471d25c2f7b36b5538fb4ce.
This failed to fix ubuntu failures.

3 years agoCleanup for final comment on https://reviews.llvm.org/D103304
Kevin Athey [Wed, 9 Jun 2021 14:26:38 +0000 (07:26 -0700)]
Cleanup for final comment on https://reviews.llvm.org/D103304

Consolidate DEFINE_STACK_MALLOC to simplify.

Reviewed By: vitalybuka

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

3 years ago[clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical type...
Felix Berger [Mon, 24 May 2021 13:14:59 +0000 (09:14 -0400)]
[clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical type when checking for aliases.

This fixes a false positive case where for instance a pointer is obtained and declared using `auto`.

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

Reviewed-by: ymandel
3 years ago[Polly][Matmul] Re-pack A in every iteration.
Michael Kruse [Sun, 6 Jun 2021 11:26:24 +0000 (06:26 -0500)]
[Polly][Matmul] Re-pack A in every iteration.

Packed_A must be copied repeatedly, not just for the first iteration of
the outer tile.

This fixes llvm.org/PR50557

3 years ago[Attributor] Set floating point loads and stores as nofree in AANoFreeFloating
Joseph Huber [Wed, 9 Jun 2021 18:43:59 +0000 (14:43 -0400)]
[Attributor] Set floating point loads and stores as nofree in AANoFreeFloating

Summary:
The current implementation of AANoFreeFloating will incorrectly list floating
point loads and stores as may-free. This prevents other attributor instances
like HeapToStack from pushing some allocations to the stack.

Reviewed By: jdoerfert

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

3 years ago[OpenMP][NFC] Precommit change to hide_mem_transfer_latency test flags
Joseph Huber [Wed, 9 Jun 2021 18:32:56 +0000 (14:32 -0400)]
[OpenMP][NFC] Precommit change to hide_mem_transfer_latency test flags

3 years ago[llvm-tapi-diff] Apply stable sorting to output
Sam Powell [Wed, 9 Jun 2021 20:06:32 +0000 (13:06 -0700)]
[llvm-tapi-diff] Apply stable sorting to output

* For the output, the attributes within the target slice should be
  grouped by the input order, then sorted by value ordering.
This is to fix current ubuntu buildbot inconsistences.

3 years ago[compiler-rt][hwasan] Decouple use of the TLS global for getting the shadow base...
Leonard Chan [Mon, 7 Jun 2021 21:27:07 +0000 (14:27 -0700)]
[compiler-rt][hwasan] Decouple use of the TLS global for getting the shadow base and using the frame record feature

This allows for using the frame record feature (which uses __hwasan_tls)
independently from however the user wants to access the shadow base, which
prior was only usable if shadow wasn't accessed through the TLS variable or ifuncs.

Frame recording can be explicitly set according to ShadowMapping::WithFrameRecord
in ShadowMapping::init. Currently, it is only enabled on Fuchsia and if TLS is
used, so this should mimic the old behavior.

Added an extra case to prologue.ll that covers this new case.

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

3 years ago[clang-tidy] performance-unnecessary-copy-initialization: Remove the complete stateme...
Felix Berger [Mon, 10 May 2021 15:26:00 +0000 (11:26 -0400)]
[clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

It is not useful to keep the statement around and can lead to compiler
warnings when -Wall (-Wunused-variable specifically) turned on.

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

Reviewed-by: ymandel
3 years agoRevert "[ms] [llvm-ml] Add support for INCLUDE environment variable"
Eric Astor [Wed, 9 Jun 2021 19:49:51 +0000 (15:49 -0400)]
Revert "[ms] [llvm-ml] Add support for INCLUDE environment variable"

This reverts commit c43f413b01b021a8f7b6fce013296114fa92a245 due to Windows environment build breaks

3 years ago[ms] [llvm-ml] Add support for INCLUDE environment variable
Eric Astor [Wed, 9 Jun 2021 18:41:24 +0000 (14:41 -0400)]
[ms] [llvm-ml] Add support for INCLUDE environment variable

Also adds support for the ML.exe command-line flag /X, which ignores the INCLUDE environment variable.

3 years agoRevert "[InstSimplify] Treat invariant group insts as bitcasts for load operands"
Arthur Eubanks [Wed, 9 Jun 2021 18:46:10 +0000 (11:46 -0700)]
Revert "[InstSimplify] Treat invariant group insts as bitcasts for load operands"

This reverts commit 26044c6a54de3e03c73c5515702b95acdb0b7f22.

Breaks on invalid IR (see D101103).

3 years ago[libc++][nfc] Test std::unique_ptr self move assignment.
Mark de Wever [Sun, 6 Jun 2021 11:44:10 +0000 (13:44 +0200)]
[libc++][nfc] Test std::unique_ptr self move assignment.

The post-conditions for the self move assignment of `std::unique_ptr`
were changed. This requires no implementation changes. A test was added
to validate the new post-conditions.

Addresses
- LWG-3455: Incorrect Postconditions on `unique_ptr` move assignment

Reviewed By: #libc, ldionne

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

3 years ago[LangRef] Add link to opaque pointers
madhur13490 [Wed, 9 Jun 2021 17:42:35 +0000 (23:12 +0530)]
[LangRef] Add link to opaque pointers

Reviewed By: aeubanks

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

3 years ago[docs] Collate CMake options
Nathan Sidwell [Fri, 14 May 2021 11:24:28 +0000 (04:24 -0700)]
[docs] Collate CMake options

I found the documentation of the various CMake variables difficult to
navigate, because they are unsorted. I can see they've grown
organically with new clusters of somewhat-related options, but the
result is hard to use. This collates them (treating '_' as space).

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

3 years ago[mlir][tosa] Update tosa.matmul lowering to linalg.batch_matmul
Rob Suderman [Wed, 9 Jun 2021 18:05:32 +0000 (11:05 -0700)]
[mlir][tosa] Update tosa.matmul lowering to linalg.batch_matmul

tosa.matmul is a batched matmul, update the lowering for linalg
with the tests.

Reviewed By: sjarus

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

3 years ago[mlir][spirv] Use SingleBlock + NoTerminator for spv.module
Lei Zhang [Wed, 9 Jun 2021 17:58:13 +0000 (13:58 -0400)]
[mlir][spirv] Use SingleBlock + NoTerminator for spv.module

This allows us to remove the `spv.mlir.endmodule` op and
all the code associated with it.

Along the way, tightened the APIs for `spv.module` a bit
by removing some aliases. Now we use `getRegion` to get
the only region, and `getBody` to get the region's only
block.

Reviewed By: mravishankar, hanchung

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

3 years ago[CSSPGO] Emit mangled dwarf names for line tables debug option under -fpseudo-probe...
Hongtao Yu [Tue, 8 Jun 2021 16:35:28 +0000 (09:35 -0700)]
[CSSPGO] Emit mangled dwarf names for line tables debug option under -fpseudo-probe-for-profiling

Reviewed By: wenlei

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

3 years agoCorrects some minor issues with the CXX status page.
Aaron Ballman [Wed, 9 Jun 2021 17:37:51 +0000 (13:37 -0400)]
Corrects some minor issues with the CXX status page.

1) Adds some </p> tags where they were missing.
2) Documents that C++14 is the current default language mode, not C++98

3 years agoReland "[llvm] llvm-tapi-diff"
Sam Powell [Wed, 9 Jun 2021 17:29:29 +0000 (10:29 -0700)]
Reland "[llvm] llvm-tapi-diff"

This is relanding commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 .
This patch additionally addresses failures found in buildbots & post review comments.

This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files.

Reviewed By: ributzka, JDevlieghere

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

3 years ago[ms] [llvm-ml] Fix parity errors in error handling for INCLUDE directive
Eric Astor [Wed, 9 Jun 2021 17:34:18 +0000 (13:34 -0400)]
[ms] [llvm-ml] Fix parity errors in error handling for INCLUDE directive

Also adds basic testing for "include" directive.

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

3 years agoRevert "Do not generate calls to the 128-bit function __multi3() on 32-bit ARM"
Nico Weber [Wed, 9 Jun 2021 17:21:05 +0000 (13:21 -0400)]
Revert "Do not generate calls to the 128-bit function __multi3() on 32-bit ARM"

This reverts commit 64e9aa33020d68a98c30bf05362ffc1c1778890c.
Breaks check-llvm everywhere, see https://reviews.llvm.org/D103906

3 years ago[libc++] Fix libc++ build with assertions enabled
Louis Dionne [Wed, 9 Jun 2021 13:41:27 +0000 (09:41 -0400)]
[libc++] Fix libc++ build with assertions enabled

This fixes http://llvm.org/PR50534. This is another take on D103960
which is less disruptive.

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

3 years ago[lldb] Use C++11 default member initializers
Jonas Devlieghere [Wed, 9 Jun 2021 16:25:29 +0000 (09:25 -0700)]
[lldb] Use C++11 default member initializers

This converts a default constructor's member initializers into C++11
default member initializers. This patch was automatically generated with
clang-tidy and the modernize-use-default-member-init check.

$ run-clang-tidy.py -header-filter='lldb' -checks='-*,modernize-use-default-member-init' -fix

This is a mass-refactoring patch and this commit will be added to
.git-blame-ignore-revs.

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

3 years ago[mlir][gpu][NFC] Simplify conversion of MMA type to NVVM
thomasraoux [Tue, 8 Jun 2021 05:25:30 +0000 (22:25 -0700)]
[mlir][gpu][NFC] Simplify conversion of MMA type to NVVM

Consolidate the type conversion in a single function to make it simpler
to use. This allow to re-use the type conversion for up coming ops.

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

3 years ago[SCEV] Keep common NUW flags when inlining Add operands.
Florian Hahn [Wed, 9 Jun 2021 10:06:21 +0000 (11:06 +0100)]
[SCEV] Keep common NUW flags when inlining Add operands.

Currently, NoWrapFlags are dropped if we inline operands of SCEVAddExpr
operands. As a consequence, we always drop flags when building
expressions like `getAddExpr(A, getAddExpr(B, C, NUW), NUW)`.

We should be able to retain NUW flags common among all inlined
SCEVAddExpr and the original flags.

Reviewed By: nikic, mkazantsev

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

3 years agoFix typo in Toy tutorial Ch1
Pavel Krajcevski [Wed, 9 Jun 2021 16:07:56 +0000 (16:07 +0000)]
Fix typo in Toy tutorial Ch1

This aligns the website with the actual test case in the repo.

Reviewed By: mehdi_amini

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

3 years agoclang/darwin: use response files with ld64
Keith Smiley [Tue, 8 Jun 2021 23:40:30 +0000 (16:40 -0700)]
clang/darwin: use response files with ld64

This crasher was fixed with Xcode 13.0 beta 1 / ld64 705. This is an
updated revert of https://reviews.llvm.org/D92357

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

3 years ago[mlir] fix a crash if the dialect is missing a data layout interface
Alex Zinenko [Wed, 9 Jun 2021 09:51:04 +0000 (11:51 +0200)]
[mlir] fix a crash if the dialect is missing a data layout interface

The top-level verifier of data layout specifications delegates verification of
entries with identifier keys to the dialect of the identifier prefix. This flow
was missing a check whether the dialect actually implements the relevant
interface.

Reviewed By: gysit

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

3 years ago[libcxx][ci] enables assertions for runtimes-build
Christopher Di Bella [Tue, 8 Jun 2021 00:09:36 +0000 (00:09 +0000)]
[libcxx][ci] enables assertions for runtimes-build

This will catch nasty Clang bugs like
https://bugs.llvm.org/show_bug.cgi?id=50592 before we merge stuff into
libc++ main.

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

3 years ago[InstCombine] add tests for casts-around-ctlz; NFC
Sanjay Patel [Wed, 9 Jun 2021 15:16:51 +0000 (11:16 -0400)]
[InstCombine] add tests for casts-around-ctlz; NFC

Baseline for D103788

3 years agoDo not generate calls to the 128-bit function __multi3() on 32-bit ARM
Koutheir Attouchi [Wed, 9 Jun 2021 15:02:14 +0000 (16:02 +0100)]
Do not generate calls to the 128-bit function __multi3() on 32-bit ARM

The function __multi3() is undefined on 32-bit ARM, so a call to it
should never be emitted. Instead, plain instructions need to be
generated to perform 128-bit multiplications.

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

3 years ago[mlir][ArmSVE] Add basic load/store operations
Javier Setoain [Wed, 2 Jun 2021 16:31:58 +0000 (17:31 +0100)]
[mlir][ArmSVE] Add basic load/store operations

ArmSVE-specific memory operations are needed to generate end-to-end
code for as long as MLIR core doesn't support scalable vectors. This
instructions will be eventually unnecessary, for now they're required
for more complex testing.

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

3 years agoRevert "[OpenMP] libomp: implement OpenMP 5.1 inoutset task dependence type"
AndreyChurbanov [Wed, 9 Jun 2021 14:35:50 +0000 (17:35 +0300)]
Revert "[OpenMP] libomp: implement OpenMP 5.1 inoutset task dependence type"

This reverts commit a1f550e052543f75acac9089b760cbc61729131f.

Revert in order to fix backwards compatibility breakage
caused by type size change for task dependence flag.

3 years ago[SROA] Avoid splitting loads/stores with irregular type
LemonBoy [Wed, 9 Jun 2021 14:35:18 +0000 (16:35 +0200)]
[SROA] Avoid splitting loads/stores with irregular type

Upon encountering loads/stores on types whose size is not a multiple of 8 bits the SROA pass would either trip an assertion or use logic that was not meant to work with such irregularly-sized types.

Reviewed By: aeubanks

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

3 years ago[mlir][openacc][NFC] move index in processDataOperands
Valentin Clement [Wed, 9 Jun 2021 14:28:07 +0000 (10:28 -0400)]
[mlir][openacc][NFC] move index in processDataOperands

Move the index variable used to track variables inside of the specific
processDataOperands functions.

Reviewed By: kiranchandramohan

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

3 years ago[X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTrunca...
Craig Topper [Wed, 9 Jun 2021 14:08:16 +0000 (07:08 -0700)]
[X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTruncateWithSat.

Fixes crash reported here https://reviews.llvm.org/D73607

Using a store to keep the trunc intact. Returning v16i24 would
cause the trunc to be optimized away in SelectionDAGBuilder.

Reviewed By: RKSimon

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

3 years ago[SDAG] fix miscompile from merging stores of different sizes
Sanjay Patel [Wed, 9 Jun 2021 13:44:58 +0000 (09:44 -0400)]
[SDAG] fix miscompile from merging stores of different sizes

As shown in:
https://llvm.org/PR50623
...and the similar tests here, we were not accounting for
store merging of different sizes that do not cover the
entire range of the wide value to be stored.

This is the easy fix: just make sure that all of the
original stores are the same size, so when we calculate
the wide width, it's a simple N * M check.

This still allows all of the motivating optimizations from:
D86420 / 54a5dd485c4d
D87112 / 7a06b166b1af

We could enhance this code to track individual bytes and
allow merging multiple sizes.

3 years agoSanitizers.h - remove MathExtras.h include dependency
Simon Pilgrim [Wed, 9 Jun 2021 13:37:56 +0000 (14:37 +0100)]
Sanitizers.h - remove MathExtras.h include dependency

The MathExtras.h header is included purely for the countPopulation() method - by moving this into Sanitizers.cpp we can remove the use of this costly header.

We only ever use isPowerOf2() / countPopulation() inside asserts so this shouldn't have any performance effects on production code.

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

3 years ago[ARM] Fix Machine Outliner LDRD/STRD handling in Thumb mode.
Yvan Roux [Wed, 9 Jun 2021 13:30:50 +0000 (15:30 +0200)]
[ARM] Fix Machine Outliner LDRD/STRD handling in Thumb mode.

This is a fix for PR50481

Immediate values for AddrModeT2_i8s4 are already scaled in MCinst operand.
This patch changes the number of bits and scale factor to reflect that
state when checking stack offset status. AddrModeT2_i7s[2|4] also have
this particularity but since MVE instructions are not outlined, just move
these cases to the unhandled ones.

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

3 years ago[TableGen] Fix ProfileFoldOpInit so that parameters are named consistently [NFC]
Paul C. Anagnostopoulos [Mon, 7 Jun 2021 15:56:26 +0000 (11:56 -0400)]
[TableGen] Fix ProfileFoldOpInit so that parameters are named consistently [NFC]

See https://bugs.llvm.org/show_bug.cgi?id=50595

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

3 years ago[x86] add tests for store merging miscompile (PR50623); NFC
Sanjay Patel [Wed, 9 Jun 2021 12:57:38 +0000 (08:57 -0400)]
[x86] add tests for store merging miscompile (PR50623); NFC

3 years ago[OpenCL] Add OpenCL builtin test generator
Sven van Haastregt [Wed, 9 Jun 2021 11:43:50 +0000 (12:43 +0100)]
[OpenCL] Add OpenCL builtin test generator

Add a new clang-tblgen flag `-gen-clang-opencl-builtin-tests` that
generates a .cl file containing calls to every builtin function
defined in the .td input.

This patch does not add any use of the new flag yet, so the only way
to obtain a generated test file is through a manual invocation of
clang-tblgen.  A test making use of this emitter will be added in a
followup commit.

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

3 years ago[X86][SLM] Adjust XMM non-PMULLD throughput costs to half rate.
Simon Pilgrim [Wed, 9 Jun 2021 12:31:52 +0000 (13:31 +0100)]
[X86][SLM] Adjust XMM non-PMULLD throughput costs to half rate.

Match what's reported in the costs table, Agner's tables and the Intel AOM

3 years ago[X86][SSE] Regenerate slow-pmulld.ll test checks
Simon Pilgrim [Wed, 9 Jun 2021 11:23:13 +0000 (12:23 +0100)]
[X86][SSE] Regenerate slow-pmulld.ll test checks

3 years ago[clang] p1099 using-enum feature macro & web page
Nathan Sidwell [Fri, 7 May 2021 19:46:39 +0000 (12:46 -0700)]
[clang] p1099 using-enum feature macro & web page

This completes the series implementing p1099, by adding the feature
macro and updating the web page.

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

3 years ago[clang-cl] Parse /await:strict, new in MSVC 16.10
Hans Wennborg [Wed, 9 Jun 2021 12:26:54 +0000 (14:26 +0200)]
[clang-cl] Parse /await:strict, new in MSVC 16.10

3 years ago[SLP]Improve gathering of scalar elements.
Alexey Bataev [Tue, 1 Jun 2021 13:21:18 +0000 (06:21 -0700)]
[SLP]Improve gathering of scalar elements.

1. Better sorting of scalars to be gathered. Trying to insert
   constants/arguments/instructions-out-of-loop at first and only then
   the instructions which are inside the loop. It improves hoisting of
   invariant insertelements instructions.
2. Better detection of shuffle candidates in gathering function.
3. The cost of insertelement for constants is 0.

Part of D57059.

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

3 years ago[Test] Add more elaborate case of symbolic execution of 1-iteration loop
Max Kazantsev [Wed, 9 Jun 2021 12:07:50 +0000 (19:07 +0700)]
[Test] Add more elaborate case of symbolic execution of 1-iteration loop

3 years ago[mlir] Expose a function to populate tensor constant bufferization patterns
Benjamin Kramer [Mon, 7 Jun 2021 19:57:55 +0000 (21:57 +0200)]
[mlir] Expose a function to populate tensor constant bufferization patterns

This makes it easier to use it from other bufferization passes.

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

3 years ago[OpenMP][Tools] Fix Archer handling of task dependencies
Joachim Protze [Sat, 21 Nov 2020 23:23:35 +0000 (00:23 +0100)]
[OpenMP][Tools] Fix Archer handling of task dependencies

The current handling of dependencies in Archer has two flaws:

- annotation of dependency synchronization is not limited to sibling tasks
- annotation of in/out dependencies is based on the assumption, that dependency
  variables will rarely be byte-sized variables.

This patch introduces a map in the generating task to manage the dependency
variables for the child tasks. The map is only accesses from the generating
task, so no locking is necessary. This also limits the dependency-based
synchronization to sibling tasks.
This patch also introduces proper handling for new dependency types such as
mutexinoutset and inoutset.

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

3 years ago[OpenMP][Tools] Cleanup memory pool used in Archer
Joachim Protze [Thu, 19 Nov 2020 22:27:43 +0000 (23:27 +0100)]
[OpenMP][Tools] Cleanup memory pool used in Archer

The main motivation for reusing objects is that it helps to avoid creating and
leaking synchronization clocks in TSan. The reused object will reuse the
synchronization clock in TSan.

Before, new and delete operators were overloaded to get and return memory for
the object from/to the object pool.
This patch replaces the operator overloading with explicit static New/Delete
functions.

Objects for parallel regions and implicit tasks will always be recruited and
returned to the thread-local object pool. Only for explicit task, there is a
chance that an other thread completes the task and will free the object. This
patch optimizes the thread-local New/Delete calls by avoiding locks and only
lock if the pool is empty. Remote threads return the object into a separate
queue.

The chunk size for allocations is now decided based on page size. The objects
will also be aligned to cache lines avoiding false sharing.

This is the first patch in a series to provide better tasking support.

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

3 years ago[OpenMP][Tools] Fix Archer for MACOS
Joachim Protze [Sat, 21 Nov 2020 23:08:39 +0000 (00:08 +0100)]
[OpenMP][Tools] Fix Archer for MACOS

Archer uses weak symbol overloads of TSan functions to enable loading the tool
even if the application is not built with TSan. For MACOS the tool collects
the function pointer at runtime.
When adding the function entry/exit markers, we missed to add the functions
in the MACOS codepath.
This patch also replaces the repeated function lookup by a single initial
function lookup and fixes the disabling logic in RunningOnValgrind.

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