platform/upstream/llvm.git
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

3 years ago[AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier
Meera Nakrani [Wed, 2 Jun 2021 14:17:08 +0000 (14:17 +0000)]
[AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier

Our initial motivating case was memcpy's with alignments > 16. The
loads/stores, to which small memcpy's expand, are kept together in
several places so that we get a sequence like this for a 64 bit copy:
LD w0
LD w1
ST w0
ST w1
The load/store optimiser can generate a LDP/STP w0, w1 from this because
the registers read/written are consecutive. In our case however, the
sequence is optimised during ISel, resulting in:
LD w0
ST w0
LD w0
ST w0
This instruction reordering allows reuse of registers. Since the registers
are no longer consecutive (i.e. they are the same), it inhibits LDP/STP
creation. The approach here is to perform renaming:
LD w0
ST w0
LD w1
ST w1
to enable the folding of the stores into a STP. We do not yet generate
the LDP due to a limitation in the renaming implementation, but plan to
look at that in a follow-up so that we fully support this case. While
this was initially motivated by certain memcpy's, this is a general
approach and thus is beneficial for other cases too, as can be seen
in some test changes.

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

3 years ago[ValueTypes][RISCV] Cap RVV fixed-length vectors by size
Fraser Cormack [Mon, 7 Jun 2021 07:39:22 +0000 (08:39 +0100)]
[ValueTypes][RISCV] Cap RVV fixed-length vectors by size

This patch changes RVV's policy for its supported list of fixed-length
vector types by capping by vector size rather than element count. Now
all 1024-byte vectors (of supported element types) are supported, rather
than all 256-element vectors.

This is a more natural fit for the architecture, and allows us to, for
example, improve the support for vector bitcasts.

This change necessitated the adding of some new simple types to avoid
"regressing" on the number of currently-supported vectors. We round out
the 1024-byte types by adding `v512i8`, `v1024i8`, `v512i16` and
`v512f16`.

Reviewed By: craig.topper

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

3 years agoCorrect the behavior of va_arg checking in C++
Aaron Ballman [Wed, 9 Jun 2021 11:15:15 +0000 (07:15 -0400)]
Correct the behavior of va_arg checking in C++

Clang checks whether the type given to va_arg will automatically cause
undefined behavior, but this check was issuing false positives for
enumerations in C++. The issue turned out to be because
typesAreCompatible() in C++ checks whether the types are *the same*, so
this uses custom logic if the type compatibility check fails.

This issue was found by a user on code like:

typedef enum {
  CURLINFO_NONE,
  CURLINFO_EFFECTIVE_URL,
  CURLINFO_LASTONE = 60
} CURLINFO;

...

__builtin_va_arg(list, CURLINFO); // false positive warning

Given that C++ defers to C for the rules around va_arg, the behavior
should be the same in both C and C++ and not diagnose because int and
CURLINFO are "compatible enough" types for va_arg.

3 years ago[clang] NFC: rename SK_CastDerivedToBaseRValue to SK_CastDerivedToBasePRValue
Matheus Izvekov [Tue, 8 Jun 2021 23:00:48 +0000 (01:00 +0200)]
[clang] NFC: rename SK_CastDerivedToBaseRValue to SK_CastDerivedToBasePRValue

This is a follow up to the "rvalue-to-prvalue" rename at D103720.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Depends on D103720

Reviewed By: rsmith

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

3 years agoRevert "[SROA] Avoid splitting loads/stores with irregular type"
Nico Weber [Wed, 9 Jun 2021 10:32:58 +0000 (06:32 -0400)]
Revert "[SROA] Avoid splitting loads/stores with irregular type"

This reverts commit 905f4eb537c118783969fded19e96fe6504c2956.
Breaks check-llvm on most (all?) bots, see https://reviews.llvm.org/D99435

3 years ago[clang] NFC: Rename rvalue to prvalue
Matheus Izvekov [Fri, 4 Jun 2021 21:15:23 +0000 (23:15 +0200)]
[clang] NFC: Rename rvalue to prvalue

This renames the expression value categories from rvalue to prvalue,
keeping nomenclature consistent with C++11 onwards.

C++ has the most complicated taxonomy here, and every other language
only uses a subset of it, so it's less confusing to use the C++ names
consistently, and mentally remap to the C names when working on that
context (prvalue -> rvalue, no xvalues, etc).

Renames:
* VK_RValue -> VK_PRValue
* Expr::isRValue -> Expr::isPRValue
* SK_QualificationConversionRValue -> SK_QualificationConversionPRValue
* JSON AST Dumper Expression nodes value category: "rvalue" -> "prvalue"

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith

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

3 years agoJSONNodeDumper.cpp - VisitIntegerLiteral - avoid APSInt::toString std::string wrapper...
Simon Pilgrim [Wed, 9 Jun 2021 10:09:19 +0000 (11:09 +0100)]
JSONNodeDumper.cpp - VisitIntegerLiteral - avoid APSInt::toString std::string wrapper. NFCI

Pulled out of D103888 - use the underlying SmallString version directly

3 years agoInterp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI
Simon Pilgrim [Wed, 9 Jun 2021 10:06:23 +0000 (11:06 +0100)]
Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI

Pulled out of D103888 - use the underlying SmallString version directly

3 years ago[SROA] Avoid splitting loads/stores with irregular type
LemonBoy [Wed, 9 Jun 2021 09:47:17 +0000 (11:47 +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[docs] Fix load instructions in chapter 7 of the tutorial
Jim Lin [Wed, 9 Jun 2021 09:36:17 +0000 (17:36 +0800)]
[docs] Fix load instructions in chapter 7 of the tutorial

Loads in the first half of the chapter are missing the type argument.

Patched By: klao (Mihaly Barasz)

Reviewed By: Jim

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

3 years ago[JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.
Lang Hames [Wed, 9 Jun 2021 08:56:30 +0000 (18:56 +1000)]
[JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.

The C-string section splitting support added in f9649d123db triggered an assert
("Duplicate canonical symbol at address") when multiple symbols were defined at
the the same offset within a C-string block (this triggered on arm64, where we
always add a block start symbol). The bug was caused by a failure to update the
record of the last canonical symbol address. The fix was to maintain this record
correctly, and move the auto-generation of the block-start symbol above the
handling for symbols defined in the object itself so that all symbols
(auto-generated and defined) are processed in address order.

3 years ago[LTO] Support new PM in ThinLTOCodeGenerator.
Florian Hahn [Wed, 9 Jun 2021 08:22:35 +0000 (09:22 +0100)]
[LTO] Support new PM in ThinLTOCodeGenerator.

This patch adds initial support for using the new pass manager when
doing ThinLTO via libLTO.

Reviewed By: steven_wu

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

3 years ago[mlir][ArmSVE] Add basic mask generation operations
Javier Setoain [Thu, 22 Apr 2021 08:29:02 +0000 (09:29 +0100)]
[mlir][ArmSVE] Add basic mask generation operations

These `arm_sve.cmp` functions are needed to generate scalable vector
masks as long as scalable vectors are not part of the standard types.
Once in standard, these can be removed and `std.cmp` can be used
instead.

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

3 years ago[RISCV] Fix failing RVV MC tests
Fraser Cormack [Wed, 9 Jun 2021 08:45:05 +0000 (09:45 +0100)]
[RISCV] Fix failing RVV MC tests

I believe these failures were introduced by D103790's changes to the
VType formatting found in vsetvli/vsetivli instructions.

3 years ago[compiler-rt] Mark symbolize_stack_fp test unsupported on Arm Thumb
David Spickett [Wed, 2 Jun 2021 11:06:15 +0000 (11:06 +0000)]
[compiler-rt] Mark symbolize_stack_fp test unsupported on Arm Thumb

The new test `symbolize_stack_fp.cpp` added in
https://reviews.llvm.org/D102046 assumes that
we can fall back to the fast unwinder.

This is not the case for Thumb and the test is currently
failing on our v7 thumb bot:
https://lab.llvm.org/buildbot/#/builders/26/builds/2096

Skip the test if we're building for a Thumb target.

Reviewed By: MaskRay

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

3 years ago[ValueTypes] Add missing enum names for MVTs
Fraser Cormack [Tue, 8 Jun 2021 10:21:31 +0000 (11:21 +0100)]
[ValueTypes] Add missing enum names for MVTs

These types are (presumably) never used in the generated TableGen files.
The `default` switch case silences any compiler warnings for these
missing types so it's easy to miss.

Reviewed By: craig.topper

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

3 years ago[LoopBoundSplit] Ignore phi node which is not scevable
Jingu Kang [Tue, 8 Jun 2021 17:24:38 +0000 (18:24 +0100)]
[LoopBoundSplit] Ignore phi node which is not scevable

There was a bug in LoopBoundSplit. The pass should ignore phi node which is not
scevable.

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

3 years agoRevert "[lldb] Set return status to failed when adding a command error"
David Spickett [Wed, 9 Jun 2021 08:41:59 +0000 (09:41 +0100)]
Revert "[lldb] Set return status to failed when adding a command error"

This reverts commit e05b03cf4f45ac5ee63c59a3464e7d484884645c.

While I investigate a register test failure:
http://green.lab.llvm.org/green/blue/organizations/jenkins/lldb-cmake/detail/lldb-cmake/32693/pipeline/

3 years agoRevert "[llvm] Sync DebugInfo.h with DebugInfoFlags.def"
Jan Kratochvil [Wed, 9 Jun 2021 08:39:42 +0000 (10:39 +0200)]
Revert "[llvm] Sync DebugInfo.h with DebugInfoFlags.def"

This reverts commit 093750dd0be6b0729f8e817766c3d5849545e10c.

It broke buildbots, goint to investigate it more.

3 years ago[flang] Define the API for CPU_TIME
Diana Picus [Mon, 7 Jun 2021 11:48:32 +0000 (11:48 +0000)]
[flang] Define the API for CPU_TIME

CPU_TIME takes a single real scalar INTENT(OUT) argument. We can
therefore return a double and let lowering handle casting that to the
precision used for the default real kind.

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

3 years ago[ScalarEvolution] Add test for preserving add overflow flags.
Florian Hahn [Wed, 9 Jun 2021 08:01:33 +0000 (09:01 +0100)]
[ScalarEvolution] Add test for preserving add overflow flags.

3 years ago[RISCV] Support CONCAT_VECTORS on scalable masks
Fraser Cormack [Tue, 8 Jun 2021 13:55:31 +0000 (14:55 +0100)]
[RISCV] Support CONCAT_VECTORS on scalable masks

This patch is a simple fix which registers CONCAT_VECTORS as
custom-lowered for scalable mask vectors. This follows the pattern of
all other scalable-vector types, as the default expansion of
CONCAT_VECTORS cannot handle scalable types, and even if it did it'd go
through the stack and generate worse code.

Reviewed By: craig.topper

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

3 years ago[llvm] Sync DebugInfo.h with DebugInfoFlags.def
Jan Kratochvil [Wed, 9 Jun 2021 08:11:23 +0000 (10:11 +0200)]
[llvm] Sync DebugInfo.h with DebugInfoFlags.def

Command to see the differences:
  diff -u <(sed -n 's#^HANDLE_DI_FLAG *([^,]*, *\([^()]*\)) *\(//.*\)\?$#\1#p' <llvm/include/llvm/IR/DebugInfoFlags.def | grep -vw Largest) <(sed -n 's#^ *LLVMDIFlag\([^ ]*\) *= (\?[0-9].*$#\1#p' <llvm/include/llvm-c/DebugInfo.h)

OCaml binding is more seriously out of sync but I have not tried to sync it.

Reviewed By: aprantl

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

3 years ago[MLIR] Make DictionaryAttr::getAs take name as && reference
Fabian Schuiki [Wed, 9 Jun 2021 08:03:18 +0000 (10:03 +0200)]
[MLIR] Make DictionaryAttr::getAs take name as && reference

As a follow-up to the discussion in https://reviews.llvm.org/D103822,
make the templated `DictionaryAttr::getAs` take the name by `&&`
reference and properly forward the argument to the underlying `get`.

3 years agoPrevent generation of dependency on _cxa_guard for static initialization
serge-sans-paille [Fri, 14 May 2021 09:45:10 +0000 (11:45 +0200)]
Prevent generation of dependency on _cxa_guard for static initialization

This fixes an issue introduced by https://reviews.llvm.org/D70662

Function-scope static initialization are guarded in C++, so we should probably
not use it because it introduces a dependency on __cxa_guard* symbols.
In the context of clang, libasan is linked statically, and it currently needs to
the odd situation where compiling C code with clang and asan requires -lstdc++

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

3 years ago Fix the 4203-Buildbot failure in LLVM Buildbot on llvm-clang-win-x-aarch64
Esme-Yi [Wed, 9 Jun 2021 07:23:51 +0000 (07:23 +0000)]
Fix the 4203-Buildbot failure in LLVM Buildbot on llvm-clang-win-x-aarch64

    Failure in llvm/test/tools/llvm-objdump/XCOFF/section-headers.test:

    SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
                 in position 24-25: truncated \xXX escape

3 years ago[NFC] Reformat MachineValueType
Guillaume Chatelet [Tue, 8 Jun 2021 12:50:34 +0000 (12:50 +0000)]
[NFC] Reformat MachineValueType

This is a follow up patch based on https://reviews.llvm.org/D103251#2804016.

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

3 years ago[Docs] Fix incorrect return type for example code
Jim Lin [Wed, 9 Jun 2021 07:19:43 +0000 (15:19 +0800)]
[Docs] Fix incorrect return type for example code

3 years ago[mlir][linalg] Prepare fusion on tensors for scalar operands.
Tobias Gysi [Wed, 9 Jun 2021 06:31:53 +0000 (06:31 +0000)]
[mlir][linalg] Prepare fusion on tensors for scalar operands.

Adapt fusion on tensors to support structured ops taking scalar operands.

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

3 years ago[CMake] Don't use libc++ by default on Windows yet
Petr Hosek [Wed, 9 Jun 2021 05:44:53 +0000 (22:44 -0700)]
[CMake] Don't use libc++ by default on Windows yet

libc++ has issues when used with -fno-exceptions and vcruntime,
don't use it on Windows by default until we address those issues.

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

3 years ago[PowerPC] Make sure the first probe is full size or is the last probe when stack...
Kai Luo [Wed, 9 Jun 2021 06:24:14 +0000 (06:24 +0000)]
[PowerPC] Make sure the first probe is full size or is the last probe when stack is realigned

When `-fstack-clash-protection` is enabled and stack has to be realigned, some parts of redzone is written prior the probe, so probe might overwrite content already written in redzone. To avoid it, we have to make sure the first probe is at full probe size or is the last probe so that we can skip redzone.

It also fixes violation of ABI under PPC where `r1` isn't updated atomically.

This fixes https://bugs.llvm.org/show_bug.cgi?id=49903.

Reviewed By: jsji

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

3 years ago[mlir] Fix body-less async.execute printing
Christian Sigg [Fri, 4 Jun 2021 11:52:34 +0000 (13:52 +0200)]
[mlir] Fix body-less async.execute printing

Reviewed By: ezhulenev

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

3 years agoRemove white space in llvm-objdump/XCOFF/section-headers.test
Esme-Yi [Wed, 9 Jun 2021 05:35:52 +0000 (05:35 +0000)]
Remove white space in llvm-objdump/XCOFF/section-headers.test