Commit Graph

371173 Commits

Author SHA1 Message Date
Sander de Smalen 73b6cb67dc [NFCI] Replace AArch64StackOffset by StackOffset.
This patch replaces the AArch64StackOffset class by the generic one
defined in TypeSize.h.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D88983
2020-11-04 08:49:00 +00:00
Clement Courbet 8383fddc4f Re-land "[llvm-exegesis] Save target state before running the benchmark."
The X86 exegesis target is never executed run on non-X86 hosts, disable
X86 instrinsic code on non-X86 targets.

This reverts commit 8cfc872129.
2020-11-04 09:46:55 +01:00
Alex Zinenko 8475fa6ed6 [mlir] Add a simpler lowering pattern for WhileOp representing a do-while loop
When the "after" region of a WhileOp is merely forwarding its arguments back to
the "before" region, i.e. WhileOp is a canonical do-while loop, a simpler CFG
subgraph that omits the "after" region with its extra branch operation can be
produced. Loop rotation from general "while" to "if { do-while }" is left for a
future canonicalization pattern when it becomes necessary.

Differential Revision: https://reviews.llvm.org/D90604
2020-11-04 09:43:13 +01:00
Alex Zinenko 4c0e255c98 [mlir] Add lowering to CFG for WhileOp
The lowering is a straightforward inlining of the "before" and "after" regions
connected by (conditional) branches. This plugs the WhileOp into the
progressive lowering scheme. Future commits may choose to target WhileOp
instead of CFG when lowering ForOp.

Differential Revision: https://reviews.llvm.org/D90603
2020-11-04 09:43:13 +01:00
Alex Zinenko 79716559b5 [mlir] Add a generic while/do-while loop to the SCF dialect
The new construct represents a generic loop with two regions: one executed
before the loop condition is verifier and another after that. This construct
can be used to express both a "while" loop and a "do-while" loop, depending on
where the main payload is located. It is intended as an intermediate
abstraction for lowering, which will be added later. This form is relatively
easy to target from higher-level abstractions and supports transformations such
as loop rotation and LICM.

Differential Revision: https://reviews.llvm.org/D90255
2020-11-04 09:43:13 +01:00
Nathan Ridge 3bec07f91f [clangd] Store the containing symbol for refs
This is needed to implement call hierarchy.

Differential Revision: https://reviews.llvm.org/D89670
2020-11-04 03:21:45 -05:00
Praveen G a4a4c50370 [Flang][OpenMP] Add semantic checks for OpenMP copyin clause.
Add the semantic checks for the OpenMP 4.5 - 2.15.4.1 copyin clause.

Resolve OpenMPThreadprivate directive since the list of items specified
in copyin clause should be threadprivate.

Test cases : omp-copyin01.f90, omp-copyin02.f90, omp-copyin03.f90,
             omp-copyin04.f90, omp-copyin05.f90

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D89385
2020-11-04 03:12:35 -05:00
Fangrui Song 0314dff051 [DebugInfo] Delete unused DwarfUnit::addConstantFPValue & addConstantValue overloads. NFC
This functions appear to be unused for many years.
2020-11-04 00:05:57 -08:00
Clement Courbet 8cfc872129 Revert "Re-land "[llvm-exegesis] Save target state before running the benchmark."
Still issues on some architectures.

This reverts commit fd13d7ce09.
2020-11-04 08:48:44 +01:00
Clement Courbet fd13d7ce09 Re-land "[llvm-exegesis] Save target state before running the benchmark.
Use `__builtin_ia32_fxsave64` under __GNUC__, (_fxsave64) does not exist in old versions of
gcc (pre-9.1).

This reverts commit e128f9cafc.
2020-11-04 08:34:33 +01:00
Stella Laurenzo 8260db752c [mlir][Python] Return and accept OpView for all functions.
* All functions that return an Operation now return an OpView.
* All functions that accept an Operation now accept an _OperationBase, which both Operation and OpView extend and can resolve to the backing Operation.
* Moves user-facing instance methods from Operation -> _OperationBase so that both can have the same API.
* Concretely, this means that if there are custom op classes defined (i.e. in Python), any iteration or creation will return the appropriate instance (i.e. if you get/create an std.addf, you will get an instance of the mlir.dialects.std.AddFOp class, getting full access to any custom API it exposes).
* Refactors all __eq__ methods after realizing the proper way to do this for _OperationBase.

Differential Revision: https://reviews.llvm.org/D90584
2020-11-03 22:48:34 -08:00
Stella Laurenzo ebe12df896 Fix linkage error on mlirLogicalResultIsFailure.
* For C, this needs to be inline static like the others.

Differential Revision: https://reviews.llvm.org/D90740
2020-11-03 22:47:07 -08:00
Martin Storsjö 36cf1e7d0e Revert "[AggressiveInstCombine] Generalize foldGuardedRotateToFunnelShift to generic funnel shifts"
This reverts commit 59b22e495c.

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.
2020-11-04 08:39:32 +02:00
Mehdi Amini 065047ab01 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
2020-11-04 06:36:32 +00:00
Mehdi Amini b4fa6d3e13 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
2020-11-04 06:36:32 +00:00
Mehdi Amini f61d1028fa 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
2020-11-04 06:36:31 +00:00
Arthur Eubanks 06926e0f01 Port print-must-be-executed-contexts and print-mustexecute to NPM
Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D90207
2020-11-03 21:06:46 -08:00
Craig Topper d34152324d [RISCV] Add fshl with immediate tests for Zbt extension. NFC
We should be able to map this to fsri with adjustment of the
immediate.
2020-11-03 20:58:51 -08:00
Xiang1 Zhang 7ba3293691 [StackColoring] Conservatively merge catch point of V for catch(V)
Reviewed By: thanm, clin1

Differential Revision: https://reviews.llvm.org/D86673
2020-11-04 10:49:56 +08:00
Michael Liao 4b11201592 [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
2020-11-03 20:44:40 -05:00
Nathan James cb9d0e8819
[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
2020-11-04 01:36:14 +00:00
Gaurav Jain 492b1d78d5 [NFC] Use [MC]Register in register allocation
Differential Revision: https://reviews.llvm.org/D90725
2020-11-03 17:34:26 -08:00
Amara Emerson 393b55380a [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
2020-11-03 17:25:14 -08:00
Rahul Joshi c298824f9c [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
2020-11-03 16:40:46 -08:00
peter klausler 7ba393efe5 [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
2020-11-03 16:31:15 -08:00
mikeurbach 2e36e0dad5 [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
2020-11-03 16:53:46 -07:00
Siva Chandra Reddy 50c2f2b6f0 [libc][NFC][Obvious] Use the new macro to declare special constants in tests. 2020-11-03 15:44:06 -08:00
Julien Jorge 0fca651711 [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
2020-11-03 14:56:25 -08:00
Thomas Raoux 29d1fba7b5 [mlir][vector] Make linalg FillOp vectorization use Transfer op
Differential Revision: https://reviews.llvm.org/D90474
2020-11-03 14:35:26 -08:00
Sanjay Patel c40126e740 [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
2020-11-03 17:23:46 -05:00
Mehdi Amini bd156fee05 Remove extra comma after macro, fix GCC warning (NFC) 2020-11-03 22:22:13 +00:00
Kiran Chandramohan ab8a4cec55 [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
2020-11-03 22:12:10 +00:00
Richard Smith 09b54e2799 When re-checking an already-substituted template argument, don't lose
the reference-ness of the parameter's type.
2020-11-03 14:09:54 -08:00
Matt Morehouse a6d15d4070 Undo Revert "Ignore template instantiations if not in AsIs mode"
MaskRay already fixed the ASan bug.
2020-11-03 13:59:01 -08:00
Matt Morehouse 72531ae6e6 Revert "Ignore template instantiations if not in AsIs mode"
This reverts commit 53df3beb62 due to
check-asan failure on the buildbot.
2020-11-03 13:57:31 -08:00
Fangrui Song d2c45f6620 [docs] Fix docs-llvm-html after recent TableGen changes D90617 2020-11-03 13:43:24 -08:00
zoecarver e2b6987204 [libc++][NFC] Mark LWG issue 2899 as not complete.
Commit 59e26308e6 accidentally
marked this LWG issue as complete but it has not yet been
implemented. D66262 fixes this issue.
2020-11-03 13:35:12 -08:00
Michael Jones 5080840d28 [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
2020-11-03 21:29:32 +00:00
Jordan Rupprecht 33945cdd62 [NFC] Fix call to lldb RegisterValue constructor 2020-11-03 13:24:06 -08:00
River Riddle 3e1390090f [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.
2020-11-03 13:10:26 -08:00
Baptiste Saleil daa127d77e [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
2020-11-03 15:08:46 -06:00
Jordan Rupprecht 980bf1d5d1 [NFC] Inline wasm assertion-only variable 2020-11-03 13:06:59 -08:00
Louis Dionne 8e5156f6b0 [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.
2020-11-03 16:03:20 -05:00
Michał Górny 98257c3006 [lldb] [test] Update XFAILs/skips for FreeBSD
Update expected failures and test skips based on common results
for the old and new FreeBSD plugins.
2020-11-03 22:01:59 +01:00
Michał Górny 051da2bede [lldb] [test/Shell] Pass -pthread to host toolchain on FreeBSD too 2020-11-03 22:01:59 +01:00
Michał Górny b7de7be098 [lldb] [test] Remove xfail from tests that pass on FreeBSD 2020-11-03 22:01:59 +01:00
Shilei Tian f5eebc25cc [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
2020-11-03 15:59:16 -05:00
Kadir Cetinkaya 05e0a8e519
[clangd] Fix missing override warnings in remote-index client 2020-11-03 21:46:44 +01:00
Kadir Cetinkaya 7f059a258a
[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
2020-11-03 21:45:35 +01:00
Louis Dionne 5369d8cca7 [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).
2020-11-03 15:40:24 -05:00