Martin Storsjö [Wed, 4 Nov 2020 06:27:22 +0000 (08:27 +0200)]
Revert "[AggressiveInstCombine] Generalize foldGuardedRotateToFunnelShift to generic funnel shifts"
This reverts commit
59b22e495c15d2830f41381a327f5d6bf49ff416.
That commit broke building for ARM and AArch64, reproducible like this:
$ cat apedec-reduced.c
a;
b(e) {
int c;
unsigned d = f();
c = d >> 32 - e;
return c;
}
g() {
int h = i();
if (a)
h = h << a | b(a);
return h;
}
$ clang -target aarch64-linux-gnu -w -c -O3 apedec-reduced.c
clang: ../lib/Transforms/InstCombine/InstructionCombining.cpp:3656: bool llvm::InstCombinerImpl::run(): Assertion `DT.dominates(BB, UserParent) && "Dominance relation broken?"' failed.
Same thing for e.g. an armv7-linux-gnueabihf target.
Mehdi Amini [Wed, 4 Nov 2020 00:06:28 +0000 (00:06 +0000)]
Enable -Werror-implicit-function-declaration by default (NFC)
This is useful in C source files where it is easy for a typo to be
silently assumed by the compiler to be an implicit declaration.
Differential Revision: https://reviews.llvm.org/D90727
Mehdi Amini [Tue, 3 Nov 2020 23:46:42 +0000 (23:46 +0000)]
Switch the CallbackOstream wrapper in the MLIR C API to an Unbuffered stream
This delegate the control of the buffering to the user of the API. This
seems like a safer option as messages are immediately propagated to the
user, which may lead to less surprising behavior during debugging for
instance.
In terms of performance, a user can add a buffered stream on the other
side of the callback.
Differential Revision: https://reviews.llvm.org/D90726
Mehdi Amini [Tue, 3 Nov 2020 21:38:34 +0000 (21:38 +0000)]
Add a basic C API for the MLIR PassManager as well as a basic TableGen backend for creating passes
This is exposing the basic functionalities (create, nest, addPass, run) of
the PassManager through the C API in the new header: `include/mlir-c/Pass.h`.
In order to exercise it in the unit-test, a basic TableGen backend is
also provided to generate a simple C wrapper around the pass
constructor. It is used to expose the libTransforms passes to the C API.
Reviewed By: stellaraccident, ftynse
Differential Revision: https://reviews.llvm.org/D90667
Arthur Eubanks [Tue, 27 Oct 2020 02:57:39 +0000 (19:57 -0700)]
Port print-must-be-executed-contexts and print-mustexecute to NPM
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D90207
Craig Topper [Wed, 4 Nov 2020 04:57:53 +0000 (20:57 -0800)]
[RISCV] Add fshl with immediate tests for Zbt extension. NFC
We should be able to map this to fsri with adjustment of the
immediate.
Xiang1 Zhang [Tue, 3 Nov 2020 01:12:35 +0000 (09:12 +0800)]
[StackColoring] Conservatively merge catch point of V for catch(V)
Reviewed By: thanm, clin1
Differential Revision: https://reviews.llvm.org/D86673
Michael Liao [Mon, 12 Oct 2020 14:01:40 +0000 (10:01 -0400)]
[MachineInstr] Add support for instructions with multiple memory operands.
- Basically iterate each pair of memory operands from both instructions
and return true if any of them may alias.
- The exception are memory instructions without any memory operand. They
may touch everything and could alias to any memory instruction.
Differential Revision: https://reviews.llvm.org/D89447
Nathan James [Wed, 4 Nov 2020 01:36:13 +0000 (01:36 +0000)]
[clangd][NFC] Make Located::operator->() use pointer sematics
This enables using the arrow operator to access members of the contained item.
```lang=c++
Located<std::string> X;
const char* CStr = X->c_str();
```
This is inline with how classes like `Optional` handle the arrow operator.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D90682
Gaurav Jain [Tue, 3 Nov 2020 04:07:58 +0000 (20:07 -0800)]
[NFC] Use [MC]Register in register allocation
Differential Revision: https://reviews.llvm.org/D90725
Amara Emerson [Tue, 3 Nov 2020 19:17:31 +0000 (11:17 -0800)]
[AArch64][GlobalISel] Add combine for G_EXTRACT_VECTOR_ELT to allow selection of pairwise FADD.
For the <2 x float> case, instead of adding another combine or legalization to
get it into a <4 x float> form, I'm just adding a GISel specific selection
pattern to cover it.
Differential Revision: https://reviews.llvm.org/D90699
Rahul Joshi [Tue, 3 Nov 2020 22:31:23 +0000 (14:31 -0800)]
[MLIR] Check for duplicate entries in attribute dictionary during custom parsing
- Verify that attributes parsed using a custom parser do not have duplicates.
- If there are duplicated in the attribute dictionary in the input, they get caught during the
dictionary parsing.
- This check verifies that there is no duplication between the parsed dictionary and any
attributes that might be added by the custom parser (or when the custom parsing code
adds duplicate attributes).
- Fixes https://bugs.llvm.org/show_bug.cgi?id=48025
Differential Revision: https://reviews.llvm.org/D90502
peter klausler [Tue, 3 Nov 2020 18:45:01 +0000 (10:45 -0800)]
[flang] Dodge gcc 8.2.0 build problem (NFC)
Add explicit member initializers to the declarations of
some constexpr values added in a recent patch to avoid an
apparent problem with gcc 8.2.0 with default initializers.
Differential revision: https://reviews.llvm.org/D90696
mikeurbach [Thu, 22 Oct 2020 17:39:39 +0000 (11:39 -0600)]
[MLIR] Move eraseArguments and eraseResults to FunctionLike
Previously, they were only defined for `FuncOp`.
To support this, `FunctionLike` needs a way to get an updated type
from the concrete operation. This adds a new hook for that purpose,
called `getTypeWithoutArgsAndResults`.
For now, `FunctionLike` continues to assume the type is
`FunctionType`, and concrete operations that use another type can hide
the `getType`, `setType`, and `getTypeWithoutArgsAndResults` methods.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D90363
Siva Chandra Reddy [Sun, 1 Nov 2020 05:28:44 +0000 (22:28 -0700)]
[libc][NFC][Obvious] Use the new macro to declare special constants in tests.
Julien Jorge [Mon, 2 Nov 2020 01:29:26 +0000 (17:29 -0800)]
[WebAssembly] Don't fold frame offset for global addresses
When machine instructions are in the form of
```
%0 = CONST_I32 @str
%1 = ADD_I32 %stack.0, %0
%2 = LOAD 0, 0, %1
```
In the `ADD_I32` instruction, it is possible to fold it if `%0` is a
`CONST_I32` from an immediate number. But in this case it is a global
address, so we shouldn't do that. But we haven't checked if the operand
of `ADD` is an immediate so far. This fixes the problem. (The case
applies the same for `ADD_I64` and `CONST_I64` instructions.)
Fixes https://bugs.llvm.org/show_bug.cgi?id=47944.
Patch by Julien Jorge (jjorge@quarkslab.com)
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D90577
Thomas Raoux [Tue, 3 Nov 2020 22:35:26 +0000 (14:35 -0800)]
[mlir][vector] Make linalg FillOp vectorization use Transfer op
Differential Revision: https://reviews.llvm.org/D90474
Sanjay Patel [Tue, 3 Nov 2020 22:06:21 +0000 (17:06 -0500)]
[ARM] remove cost-kind predicate for most math op costs
This is based on the same idea that I am using for the basic model implementation
and what I have partly already done for x86: throughput cost is number of
instructions/uops, so size/blended costs are identical except in special cases
(for example, fdiv or other known-expensive machine instructions or things like
MVE that may require cracking into >1 uop)).
Differential Revision: https://reviews.llvm.org/D90692
Mehdi Amini [Tue, 3 Nov 2020 22:21:39 +0000 (22:21 +0000)]
Remove extra comma after macro, fix GCC warning (NFC)
Kiran Chandramohan [Tue, 3 Nov 2020 17:42:05 +0000 (17:42 +0000)]
[MLIR] NFC : Move OpenMP dialect include to translation
The OpenMP dialect include is only needed for translation
and is not required in LLVM dialect.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D90510
Richard Smith [Tue, 3 Nov 2020 22:02:56 +0000 (14:02 -0800)]
When re-checking an already-substituted template argument, don't lose
the reference-ness of the parameter's type.
Matt Morehouse [Tue, 3 Nov 2020 21:59:01 +0000 (13:59 -0800)]
Undo Revert "Ignore template instantiations if not in AsIs mode"
MaskRay already fixed the ASan bug.
Matt Morehouse [Tue, 3 Nov 2020 19:48:07 +0000 (11:48 -0800)]
Revert "Ignore template instantiations if not in AsIs mode"
This reverts commit
53df3beb624989ed32d87697d0c17601d7871465 due to
check-asan failure on the buildbot.
Fangrui Song [Tue, 3 Nov 2020 21:43:24 +0000 (13:43 -0800)]
[docs] Fix docs-llvm-html after recent TableGen changes D90617
zoecarver [Tue, 3 Nov 2020 21:35:12 +0000 (13:35 -0800)]
[libc++][NFC] Mark LWG issue 2899 as not complete.
Commit
59e26308e60a08a5a4534ba827744564c71d7aff accidentally
marked this LWG issue as complete but it has not yet been
implemented. D66262 fixes this issue.
Michael Jones [Mon, 2 Nov 2020 23:16:00 +0000 (23:16 +0000)]
[LIBC][NFC] Rename errno and assert files to match other files with functions
Rename the files containing the `__errno_location` function
to `__errno_location.h/cpp` to match the other files and move
the `llvmlibc_errno` macro to its own file.
Split assert.h into `__assert_fail.h` (contains the function prototype)
and assert.h (contains the assert macro).
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D90653
Jordan Rupprecht [Tue, 3 Nov 2020 21:24:06 +0000 (13:24 -0800)]
[NFC] Fix call to lldb RegisterValue constructor
River Riddle [Tue, 3 Nov 2020 20:31:24 +0000 (12:31 -0800)]
[mlir][Parser] Small optimization to parsing
* Use function_ref instead of std::function in several methods
* Use ::get instead of ::getChecked for IntegerType.
- It is already fully verified and constructing a mlir::Location can be extremely costly during parsing.
Baptiste Saleil [Tue, 3 Nov 2020 21:08:00 +0000 (15:08 -0600)]
[PowerPC] Add MMA builtin decoding and definitions
Add MMA builtin decoding. These builtins use the new PowerPC-specific types __vector_pair and __vector_quad.
So to avoid pervasive changes, we use custom type descriptors and custom decoding for these builtins.
We also use custom code generation to expand builtin calls with pointers to simpler intrinsic calls with non-pointer types.
Differential Revision: https://reviews.llvm.org/D81748
Jordan Rupprecht [Tue, 3 Nov 2020 21:06:52 +0000 (13:06 -0800)]
[NFC] Inline wasm assertion-only variable
Louis Dionne [Tue, 3 Nov 2020 19:44:47 +0000 (14:44 -0500)]
[libc++] Harden tests against executors not running tests in a shell
Some executors do not run the tests in a shell, and so assuming that
they can understand shell builtins is wrong. Instead, call Bash
directly to do what we need to do.
This still requires the executor to be able to run Bash, but at least
it does not require it to interpret command lines in the Bash language.
Michał Górny [Tue, 3 Nov 2020 18:25:48 +0000 (19:25 +0100)]
[lldb] [test] Update XFAILs/skips for FreeBSD
Update expected failures and test skips based on common results
for the old and new FreeBSD plugins.
Michał Górny [Tue, 3 Nov 2020 18:25:16 +0000 (19:25 +0100)]
[lldb] [test/Shell] Pass -pthread to host toolchain on FreeBSD too
Michał Górny [Tue, 3 Nov 2020 17:46:10 +0000 (18:46 +0100)]
[lldb] [test] Remove xfail from tests that pass on FreeBSD
Shilei Tian [Tue, 3 Nov 2020 20:59:05 +0000 (15:59 -0500)]
[OpenMP] Fixed an issue in the test case parallel_offloading_map
There is a non-conforming use of variable-sized array in the test case `parallel_offloading_map.c`. This patch fixed it.
Reviewed By: protze.joachim
Differential Revision: https://reviews.llvm.org/D90642
Kadir Cetinkaya [Tue, 3 Nov 2020 20:46:44 +0000 (21:46 +0100)]
[clangd] Fix missing override warnings in remote-index client
Kadir Cetinkaya [Tue, 27 Oct 2020 22:03:41 +0000 (23:03 +0100)]
[clangd] Handle absolute/relative path specifications in Config
This introduces a mechanism for providers to interpret paths specified
in a fragment either as absolute or relative to fragment location.
This information should be used during compile stage to handle blocks correctly.
Differential Revision: https://reviews.llvm.org/D90270
Louis Dionne [Tue, 3 Nov 2020 20:24:00 +0000 (15:24 -0500)]
[libc++] Remove support for .run.fail.cpp tests
Unfortunately, executing these tests correctly on platforms that do not
support a shell is very challenging. Since the executor can't just negate
the result of the command, we'd have to ship a portable program capable
of running the actual test executable, and negating its result.
Doing this portably is challenging. Since we do not currently have strong
use cases for tests that fail at runtime (we effectively have no tests
using that capability right now), it is difficult to justify making them
work portably. Instead, it makes more sense to remove this feature until
we can implement it properly (i.e. without requiring shell support).
Fangrui Song [Tue, 3 Nov 2020 20:34:45 +0000 (12:34 -0800)]
[unittest][TrasnformerTest] Fix asan stack-use-after-return
Louis Dionne [Tue, 3 Nov 2020 19:37:42 +0000 (14:37 -0500)]
[libc++] NFC: Simplify how we run config tests
We can use the convenience substitutions provided by the format instead
of bootstrapping our own.
Jonas Devlieghere [Tue, 3 Nov 2020 19:49:59 +0000 (11:49 -0800)]
[crashlog] Print the actual exception in the CommandReturnObject
Before:
error: python exception <class 'AttributeError'>
After:
error: python exception: 'DarwinImage' object has no attribute 'debugger'
Xun Li [Tue, 3 Nov 2020 19:39:27 +0000 (11:39 -0800)]
[musttail] Unify musttail call preceding return checking
There is already an API in BasicBlock that checks and returns the musttail call if it precedes the return instruction.
Use it instead of manually checking in each place.
Differential Revision: https://reviews.llvm.org/D90693
Petr Hosek [Tue, 3 Nov 2020 18:41:17 +0000 (10:41 -0800)]
[compiler-rt] Use empty SuspendedThreadsList for Fuchsia
d48f2d7 made destructor of SuspendedThreadsList protected, so we need
an empty subclass to pass to the callback now.
Differential Revision: https://reviews.llvm.org/D90695
Vitaly Buka [Tue, 3 Nov 2020 19:27:04 +0000 (11:27 -0800)]
[memprof] Don't protect destructor in final
Roman Lebedev [Tue, 3 Nov 2020 19:01:22 +0000 (22:01 +0300)]
[Reassociate] Convert `add`-like `or`'s into an `add`'s to allow reassociation
InstCombine is quite aggressive in doing the opposite transform,
folding `add` of operands with no common bits set into an `or`,
and that not many things support that new pattern..
In this case, teaching Reassociate about it is easy,
there's preexisting art for `sub`/`shl`:
just convert such an `or` into an `add`:
https://rise4fun.com/Alive/Xlyv
Roman Lebedev [Tue, 3 Nov 2020 18:24:13 +0000 (21:24 +0300)]
[NFC][Reassociate] Add tests with `add`-like `or` (w/ no common bits set)
Thomas Raoux [Tue, 3 Nov 2020 18:56:22 +0000 (10:56 -0800)]
[mlir][vector] Add canonicalization patterns for ExtractStride/ShapeCast + Splat constant
Differential Revision: https://reviews.llvm.org/D90567
Sanne Wouda [Tue, 3 Nov 2020 19:29:14 +0000 (19:29 +0000)]
Revert "Precommit LTO pipeline test"
This reverts commit
5a72a1623e4afd9365a13473079db1ec66af1f0e.
Sanne Wouda [Tue, 3 Nov 2020 19:29:00 +0000 (19:29 +0000)]
Revert "Add loop distribution to the LTO pipeline"
This reverts commit
6e80318eecde2639faa1e72be045c78b8b8aedad.
Jay Foad [Tue, 3 Nov 2020 19:17:27 +0000 (19:17 +0000)]
[AMDGPU] Add some missing tests for GFX10.3 subtargets
Ben Dunbobbin [Tue, 3 Nov 2020 18:54:57 +0000 (18:54 +0000)]
Fix - [Clang] Add the ability to map DLL storage class to visibility
415f7ee883 had a silly typo introduced when I inlined some
code into a loop from its own function.
Original commit message:
For PlayStation we offer source code compatibility with
Microsoft's dllimport/export annotations; however, our file
format is based on ELF.
To support this we translate from DLL storage class to ELF
visibility at the end of codegen in Clang.
Other toolchains have used similar strategies (e.g. see the
documentation for this ARM toolchain:
https://developer.arm.com/documentation/dui0530/i/migrating-from-rvct-v3-1-to-rvct-v4-0/changes-to-symbol-visibility-between-rvct-v3-1-and-rvct-v4-0)
This patch adds the ability to perform this translation. Options
are provided to support customizing the mapping behaviour.
Differential Revision: https://reviews.llvm.org/D89970
Sanne Wouda [Wed, 21 Oct 2020 11:01:59 +0000 (11:01 +0000)]
Add loop distribution to the LTO pipeline
The LoopDistribute pass is missing from the LTO pipeline, so
-enable-loop-distribute has no effect during post-link. The pre-link
loop distribution doesn't seem to survive the LTO pipeline either.
With this patch (and -flto -mllvm -enable-loop-distribute) we see a 43%
uplift on SPEC 2006 hmmer for AArch64. The rest of SPECINT 2006 is
unaffected.
Differential Revision: https://reviews.llvm.org/D89896
Sanne Wouda [Wed, 21 Oct 2020 19:27:47 +0000 (19:27 +0000)]
Precommit LTO pipeline test
Andy Yankovsky [Tue, 3 Nov 2020 18:32:42 +0000 (10:32 -0800)]
Return actual type from SBType::GetArrayElementType
SBType::GetArrayElementType should return the actual type, not the
canonical type (e.g. int32_t, not the underlying int).
Added a test case to validate the new behavior. I also ran all other
tests on Linux (ninja check-lldb), they all pass.
Differential revision: https://reviews.llvm.org/D90318
Andy Wingo [Tue, 3 Nov 2020 18:46:23 +0000 (10:46 -0800)]
[WebAssembly] Implement ref.null
This patch adds a new "heap type" operand kind to the WebAssembly MC
layer, used by ref.null. Currently the possible values are "extern" and
"func"; when typed function references come, though, this operand may be
a type index.
Note that the "heap type" production is still known as "refedtype" in
the draft proposal; changing its name in the spec is
ongoing (https://github.com/WebAssembly/reference-types/issues/123).
The register form of ref.null is still untested.
Differential Revision: https://reviews.llvm.org/D90608
Aaron En Ye Shi [Wed, 28 Oct 2020 17:51:55 +0000 (17:51 +0000)]
[HIP] Math Headers to use type promotion
Similar to libcxx implementation of cmath function
overloads, use type promotion templates to determine
return types of multi-argument math functions.
Fixes: SWDEV-256825
Reviewed By: tra, yaxunl
Differential Revision: https://reviews.llvm.org/D90409
Artem Belevich [Thu, 29 Oct 2020 22:19:06 +0000 (15:19 -0700)]
[HIP] Use argv[0] as the default choice for the Executable name.
The path produced by getMainExecutable() may not be the right one when the files are installed in
a symlinked tree and when the real location of llvm-objdump is in a different directory.
Given that clang-offload-bundler is invoked by clang, the driver already does the job figuring out
the right path (e.g. it pays attention to -no-canonical-prefixes).
Offload bundler should use it, instead of trying to figure out the path on its
own.
Differential Revision: https://reviews.llvm.org/D90436
Artem Belevich [Fri, 25 Sep 2020 23:25:27 +0000 (16:25 -0700)]
[CUDA] Allow local static variables with target attributes.
While CUDA documentation claims that such variables are not allowed[1], NVCC has
been accepting them since CUDA-10.0[2] and some headers in CUDA-11 rely on this
working.
1. https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#static-variables-function
2. https://godbolt.org/z/zsodzc
Differential Revision: https://reviews.llvm.org/D88345
Jameson Nash [Tue, 3 Nov 2020 18:17:52 +0000 (13:17 -0500)]
[GVN] small improvements to comments
Jonas Devlieghere [Tue, 3 Nov 2020 18:21:00 +0000 (10:21 -0800)]
[crashlog] Modularize parser
Instead of parsing the crashlog in one big loop, use methods that
correspond to the different parsing modes.
Differential revision: https://reviews.llvm.org/D90665
Simon Pilgrim [Tue, 3 Nov 2020 18:13:21 +0000 (18:13 +0000)]
Cleanup namespace comment to fix clang-tidy warning. NFCI.
Simon Pilgrim [Tue, 3 Nov 2020 18:09:15 +0000 (18:09 +0000)]
[DAG] computeKnownBits - Move ISD::SRA handling into KnownBits::ashr
As discussed on D90527, we should be trying to move shift handling functionality into KnownBits to avoid code duplication in SelectionDAG/GlobalISel/ValueTracking.
Craig Topper [Tue, 3 Nov 2020 17:33:06 +0000 (09:33 -0800)]
[RISCV] Add missing patterns for rotr with immediate for Zbb/Zbp extensions.
DAGCombine doesn't canonicalize rotl/rotr with immediate so we
need patterns for both.
Remove the custom matcher for rotl to RORI and just use a SDNodeXForm
to convert the immediate instead. Doing this gives priority to the
rev32/rev16 versions of grevi over rori since an explicit immediate
is more precise than any immediate. I also added rotr patterns for
rev32/rev16. And removed the (or (shl), (shr)) patterns that should be
combined to rotl by DAG combine.
There is at least one other grev pattern that probably needs a
another rotr pattern, but we need more test coverage first.
Differential Revision: https://reviews.llvm.org/D90575
Simon Pilgrim [Tue, 3 Nov 2020 17:30:17 +0000 (17:30 +0000)]
[DAG] computeKnownBits - Move (most) ISD::SRL handling into KnownBits::lshr
As discussed on D90527, we should be be trying to move shift handling functionality into KnownBits to avoid code duplication in SelectionDAG/GlobalISel/ValueTracking.
The refactor to use the KnownBits fixed/min/max constant helpers allows us to hit a couple of cases that we were missing before.
We still need the getValidMinimumShiftAmountConstant case as KnownBits doesn't handle per-element vector cases.
Simon Pilgrim [Tue, 3 Nov 2020 16:50:18 +0000 (16:50 +0000)]
[AMDGPU] Regenerate load i16 tests to use update_llc_test_checks.py script. NFCI.
Necessary for upcoming KnownBits::lshr support.
Louis Dionne [Tue, 3 Nov 2020 17:05:55 +0000 (12:05 -0500)]
[libc++] Move <memory> helpers outside of std::allocator_traits
They don't really belong as members of allocator_traits.
Jonas Devlieghere [Tue, 3 Nov 2020 04:29:32 +0000 (20:29 -0800)]
[crashlog] Move crash log parsing into its own class
Move crash log parsing out of the CrashLog class and into its own class
and add more tests.
Differential revision: https://reviews.llvm.org/D90664
Nico Weber [Tue, 3 Nov 2020 16:55:22 +0000 (11:55 -0500)]
Make test/tools/llvm-dlltool/tool-name.test pass, and make it run
The test hasn't run since it was added in D71302.
Tony [Tue, 3 Nov 2020 02:14:45 +0000 (02:14 +0000)]
[NFC][AMDGPU] Minor editorial improvements to AMDGPUUsage.rst
Differential Revision: https://reviews.llvm.org/D90661
etiotto [Tue, 3 Nov 2020 16:44:18 +0000 (11:44 -0500)]
[compiler-rt][profile][AIX]: Enable compiler-rt profile build on AIX
This patch adds support for building the compiler-rt profile library on AIX.
Reviewed by: phosek
Differential Revision: https://reviews.llvm.org/D90619
Esme-Yi [Tue, 3 Nov 2020 16:34:02 +0000 (16:34 +0000)]
Revert "[PowerPC] Extend folding RLWINM + RLWINM to post-RA."
This reverts commit
119ab2181e6ed823849c93d55af8e989c28c9f3c.
Tim Renouf [Fri, 30 Oct 2020 08:21:12 +0000 (08:21 +0000)]
[AMDGPU] Add gfx1033 target
Differential Revision: https://reviews.llvm.org/D90447
Change-Id: If2650fc7f31bbdd49c76e74a9ca8e3734d769761
Tim Renouf [Tue, 6 Oct 2020 17:23:59 +0000 (18:23 +0100)]
[AMDGPU] Add gfx90c target
This differentiates the Ryzen 4000/4300/4500/4700 series APUs that were
previously included in gfx909.
Differential Revision: https://reviews.llvm.org/D90419
Change-Id: Ia901a7157eb2f73ccd9f25dbacec38427312377d
Michał Górny [Tue, 3 Nov 2020 14:00:58 +0000 (15:00 +0100)]
[lldb] [Process/FreeBSDRemote] Fix "Fix attaching via lldb-server"
One of the changes seems to have been lost in rebase. Reapply.
Valentin Clement [Tue, 3 Nov 2020 16:12:14 +0000 (11:12 -0500)]
[openmp][openacc][NFC] Simplify access and validation of DirectiveBase information
This patch adds some helper in the DirectiveLanguage wrapper to initialize it from
the RecordKeeper and validate the records. This simplify arguments in lots of function
since only the DirectiveLanguge is passed.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D90358
Sanjay Patel [Tue, 3 Nov 2020 15:41:52 +0000 (10:41 -0500)]
[CostModel] fix cost calc bug for sadd/ssub with overflow
As noted in D90554, there's an opcode typo in using an easily
misused cost model API: getCmpSelInstrCost(). Beyond that, the
assumed sequence of ops is questionable, but that would be
another patch.
My guess is that the x86 test diffs show that we are probably
wrong both before and after this change, so there will be no
practical difference.
As an example, I tried this test which shows a cost of '7'
either way:
define <4 x i32> @sadd(<4 x i32> %va, <4 x i32> %vb) {
%V4I32 = call {<4 x i32>, <4 x i1>} @llvm.sadd.with.overflow.v4i32(<4 x i32> %va, <4 x i32> %vb)
%ov = extractvalue {<4 x i32>, <4 x i1>} %V4I32, 1
%r = extractvalue {<4 x i32>, <4 x i1>} %V4I32, 0
%z = select <4 x i1> %ov, <4 x i32> <i32 42, i32 42, i32 42, i32 42>, <4 x i32> %r
ret <4 x i32> %z
}
$ llc -o - sadd.ll -mattr=avx
vpaddd %xmm1, %xmm0, %xmm2
vpcmpgtd %xmm2, %xmm0, %xmm0
vpxor %xmm0, %xmm1, %xmm0
vblendvps %xmm0, LCPI0_0(%rip), %xmm2, %xmm0a
Differential Revision: https://reviews.llvm.org/D90681
Hans Wennborg [Tue, 3 Nov 2020 15:55:12 +0000 (16:55 +0100)]
Fix GCC error: specialization of 'template<class LeafTy> struct llvm::LinearPolyBaseTypeTraits' in different namespace
Joachim Protze [Tue, 3 Nov 2020 15:31:50 +0000 (16:31 +0100)]
[OpenMP][Tools] clang-format Archer (NFC)
Joe Ellis [Tue, 3 Nov 2020 15:24:41 +0000 (15:24 +0000)]
[SVE][InstCombine] Improve specificity of InstCombine TypeSize test
The test was using -O2, where -instcombine will suffice.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D90684
Jay Foad [Mon, 2 Nov 2020 13:05:15 +0000 (13:05 +0000)]
[AMDGPU] Fix ds_read2/write2 with unaligned offsets
These instructions use a scaled offset. We were wrongly selecting them
even when the required offset was not a multiple of the scale factor.
Differential Revision: https://reviews.llvm.org/D90607
Martin Storsjö [Mon, 28 Oct 2019 21:46:34 +0000 (23:46 +0200)]
[libcxx] Error out if __libcpp_mbsrtowcs_l fails in __time_get_storage
If __libcpp_mbsrtowcs_l outputs zero wchar_t's for week days or
month names (due to errors in the locale function setup), these are
matched all the time in __time_get_storage::__analyze, ending up in
an infinite loop, allocating more memory until killed.
Differential Revision: https://reviews.llvm.org/D69553
Martin Storsjö [Fri, 23 Oct 2020 07:54:02 +0000 (10:54 +0300)]
[libcxx] [libcxxabi] Set flags for visibility when statically linking libcxxabi into libcxx for windows
Previously, these had to be set manually when building each of the
projects standalone, in order to get proper symbol visibility when
combining the two libraries.
Differential Revision: https://reviews.llvm.org/D90021
Pavel Labath [Mon, 7 Sep 2020 07:33:58 +0000 (09:33 +0200)]
[lldb/Utility] Add unit tests for RegisterValue::GetScalarValue
Buggy cases are commented out.
Also sneak in a modernization of a RegisterValue constructor.
Mircea Trofin [Tue, 3 Nov 2020 15:08:51 +0000 (07:08 -0800)]
[Docs][FileCheck] Small fix.
Jameson Nash [Tue, 3 Nov 2020 13:54:51 +0000 (08:54 -0500)]
make the AsmPrinterHandler array public
This lets external consumers customize the output, similar to how
AssemblyAnnotationWriter lets the caller define callbacks when printing
IR. The array of handlers already existed, this just cleans up the code
so that it can be exposed publically.
Replaces https://reviews.llvm.org/D74158
Differential Revision: https://reviews.llvm.org/D89613
Nathan James [Tue, 3 Nov 2020 14:57:08 +0000 (14:57 +0000)]
[ADT] Add SmallVector::pop_back_n
Adds a method called pop_back_n to SmallVector.
This is more readable and less error prone than the alternatives of using
```lang=c++
Vector.resize(Vector.size() - N);
Vector.erase(Vector.end() - N, Vector.end());
for (unsigned I = 0;I<N;++I) Vector.pop_back();
```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D90576
Anton Afanasyev [Tue, 3 Nov 2020 14:40:41 +0000 (17:40 +0300)]
[SLP][X86][Test] Extend test coverage for PR47629
Add two cases for `<i32 x 8>`. Precommit for PR47629 and D90445. NFC
Jay Foad [Tue, 3 Nov 2020 14:24:44 +0000 (14:24 +0000)]
[AMDGPU] Precommit globalisel tests for ds_read2_b64 with large offset
Nathan James [Tue, 3 Nov 2020 14:36:50 +0000 (14:36 +0000)]
[ASTMatchers] Made isExpandedFromMacro Polymorphic
Made the isExpandedFromMacro matcher work on Stmt's, TypeLocs and Decls in line with the other macro expansion matchers.
Also tweaked it to take a `std::string` instead of a `StringRef`.
This prevents potential use-after-free bugs if the matcher is created with a string thats destroyed before the matcher finishes matching.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D90303
Simon Pilgrim [Tue, 3 Nov 2020 13:49:00 +0000 (13:49 +0000)]
[DAG] computeKnownBits - Move (most) ISD::SHL handling into KnownBits::shl
As discussed on D90527, we should be be trying to move shift handling functionality into KnownBits to avoid code duplication in SelectionDAG/GlobalISel/ValueTracking.
The refactor to use the KnownBits fixed/min/max constant helpers allows us to hit a couple of cases that we were missing before.
We still need the getValidMinimumShiftAmountConstant case as KnownBits doesn't handle per-element vector cases.
LLVM GN Syncbot [Tue, 3 Nov 2020 13:58:51 +0000 (13:58 +0000)]
[gn build] Port
1667d23e585
Nico Weber [Tue, 3 Nov 2020 13:58:23 +0000 (08:58 -0500)]
[gn build] (manually) port
1af3cb5424d
Jay Foad [Tue, 3 Nov 2020 13:31:59 +0000 (13:31 +0000)]
[AMDGPU] Specify a triple to avoid codegen changes depending on host OS
Lei Zhang [Tue, 3 Nov 2020 13:10:56 +0000 (08:10 -0500)]
[mlir][spirv] Support for a few more decorations in (de)serialization
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D90655
Sanjay Patel [Tue, 3 Nov 2020 12:55:55 +0000 (07:55 -0500)]
[x86] update cost table comments for maxnum; NFC
Follow-up suggested in D90613.
Yaxun (Sam) Liu [Wed, 28 Oct 2020 14:44:21 +0000 (10:44 -0400)]
[CUDA][HIP] Fix linkage for -fgpu-rdc
Currently for explicit template function instantiation in CUDA/HIP device
compilation clang emits instantiated kernel with external linkage
and instantiated device function with internal linkage.
This is fine for -fno-gpu-rdc since there is only one TU.
However this causes duplicate symbols for kernels for -fgpu-rdc if
the same instantiation happen in multiple TU. Or missing symbols
if a device function calls an explicitly instantiated template function
in a different TU.
To make explicit template function instantiation work for
-fgpu-rdc we need to follow the C++ linkage paradigm, i.e.
use weak_odr linkage.
Differential Revision: https://reviews.llvm.org/D90311
Roman Lebedev [Tue, 3 Nov 2020 12:32:31 +0000 (15:32 +0300)]
[InstCombine] Perform C-(X+C2) --> (C-C2)-X transform before using Negator
In particular, it makes it fire for C=0, because negator doesn't want
to perform that fold since in general it's not beneficial.
Roman Lebedev [Tue, 3 Nov 2020 10:34:38 +0000 (13:34 +0300)]
[InstCombine] Negator: - (C - %x) --> %x - C (PR47997)
This relaxes one-use restriction on that `sub` fold,
since apparently the addition of Negator broke
preexisting `C-(C2-X) --> X+(C-C2)` (with C=0) fold.
Roman Lebedev [Tue, 3 Nov 2020 11:06:42 +0000 (14:06 +0300)]
[NFC][InstCombine] Negator: add test coverage for `(?? - (%y + C))` pattern (PR47997)
Roman Lebedev [Tue, 3 Nov 2020 11:04:36 +0000 (14:04 +0300)]
[NFC][InstCombine] Negator: add test coverage for `(?? - (C - %y))` pattern (PR47997)