Commit Graph

423559 Commits

Author SHA1 Message Date
Lian Wang f14a1f26ad Revert "[RISCV][SelectionDAG] Support VECREDUCE_ADD mask operation"
This patch make CodeGen/test/AArch64/vecreduce-add-legalization.ll fail.

This reverts commit 17a8a1bb71.
2022-05-10 09:25:25 +00:00
Gabor Marton 21feafaeb8 [analyzer] Attempt to fix test infeasible-crash.c 2022-05-10 11:18:35 +02:00
Lian Wang 17a8a1bb71 [RISCV][SelectionDAG] Support VECREDUCE_ADD mask operation
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125206
2022-05-10 08:52:48 +00:00
Lian Wang 3b3ff24037 [RISCV] Add more tests for vector reduce mask operations
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D125216
2022-05-10 08:25:13 +00:00
Nikita Popov ddfc84e634 [fuzzer] Reduce size of large.test
This halves the size of LargeTest, dropping time to compile this
file locally from 14s to 5.5s. Hopefully this will also fix the
persistent timeouts in pre-merge checks.

Differential Revision: https://reviews.llvm.org/D124237
2022-05-10 10:19:04 +02:00
Nikita Popov 03ab30686d [MLIR] Split off MLIRExecutionEngineUtils to fix libMLIR.so build (PR54242)
Building libMLIR.so currently fails with:

> /usr/bin/ld: /tmp/ccNzulEA.ltrans39.ltrans.o: in function `(anonymous namespace)::SerializeToHsacoPass::optimizeLlvm(llvm::Module&, llvm::TargetMachine&)':
> /builddir/build/BUILD/llvm-project-15.0.0.src/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp:328: undefined reference to `mlir::makeOptimizingTransformer(unsigned int, unsigned int, llvm::TargetMachine*)'

This is because MLIRGPUTransforms depends on MLIRExecutionEngine in
61bb2e4ea8/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp (L328),
but MLIRExecutionEngine is marked as excluded from libMLIR.so.

However, this code doesn't require the full execution engine: It
only performs middle-end optimization, and does not need any of
the JIT/codegen infrastructure. As such, split off a separate
library MLIRExecutionEngineUtils, which only contains that part
and is not excluded from libMLIR.so.

Fixes https://github.com/llvm/llvm-project/issues/54242.

Differential Revision: https://reviews.llvm.org/D125214
2022-05-10 10:17:52 +02:00
Gabor Marton 34ac048aef [analyzer] Replace adjacent assumeInBound calls to assumeInBoundDual
This is to minimize superfluous assume calls.

Depends on D124758

Differential Revision: https://reviews.llvm.org/D124761
2022-05-10 10:16:55 +02:00
Gabor Marton 1c1c1e25f9 [analyzer] Implement assume in terms of assumeDual
Summary:
By evaluating both children states, now we are capable of discovering
infeasible parent states. In this patch, `assume` is implemented in the terms
of `assumeDuali`. This might be suboptimal (e.g. where there are adjacent
assume(true) and assume(false) calls, next patches addresses that). This patch
fixes a real CRASH.
Fixes https://github.com/llvm/llvm-project/issues/54272

Differential Revision:
https://reviews.llvm.org/D124758
2022-05-10 10:16:55 +02:00
Gabor Marton c4fa05f5f7 [analyzer] Indicate if a parent state is infeasible
In some cases a parent State is already infeasible, but we recognize
this only if an additonal constraint is added. This patch is the first
of a series to address this issue. In this patch `assumeDual` is changed
to clone the parent State but with an `Infeasible` flag set, and this
infeasible-parent is returned both for the true and false case. Then
when we add a new transition in the exploded graph and the destination
is marked as infeasible, the node will be a sink node.

Related bug:
https://github.com/llvm/llvm-project/issues/50883
Actually, this patch does not solve that bug in the solver, rather with
this patch we can handle the general parent-infeasible cases.

Next step would be to change the State API and require all checkers to
use the `assume*Dual` API and deprecate the simple `assume` calls.

Hopefully, the next patch will introduce `assumeInBoundDual` and will
solve the CRASH we have here:
https://github.com/llvm/llvm-project/issues/54272

Differential Revision: https://reviews.llvm.org/D124674
2022-05-10 10:16:55 +02:00
Nikita Popov 3d888b0491 [Docs] Clarify CLANG_ENABLE_OPAQUE_POINTERS behavior (NFC)
While it originally did, this option no longer affects the cc1
interface. For the cc1 interface, -no-opaque-pointers has to be
passed, there is no cmake option.
2022-05-10 10:02:01 +02:00
Martin Storsjö bf1b81d076 [libcxxabi] [cmake] Fix a mismatched variable name
The variable name checked didn't match the one set on the line above.

This error was introduced in b3df14b6c9.
2022-05-10 10:25:43 +03:00
Max Kazantsev fb148057c5 Return "[Test] One more test to prevent crash in SLP vectorizer"
Looks like this test exposes some non-determinism and fails with
auth-generated checks. Recommited with sole check it didn't crash.
Will investigate why it happens.
2022-05-10 13:29:21 +07:00
Max Kazantsev 00916f7008 Revert "[Test] One more test to prevent crash in SLP vectorizer"
This reverts commit 1daf35f47c.
2022-05-10 13:20:57 +07:00
Max Kazantsev 1daf35f47c [Test] One more test to prevent crash in SLP vectorizer
Make sure "[SLP]Further improvement of the cost model for scalars used in buildvectors."
does not come back until it's fixed.
2022-05-10 13:09:17 +07:00
Walter Erquinigo 285b39a31e Revert "[NFC][lldb][trace] Use uint64_t when decoding and enconding json"
This reverts commit 9d2dd6d762.

Reverting because this exposes an issue in the uint64_t json parser.
2022-05-09 22:47:05 -07:00
Chuanqi Xu beeed0994e [Coroutines] Use PassManager instead of Legacy PassManager internally
This is a following cleanup for the previous work D123918. I missed
serveral places which still use legacy pass managers. This patch tries
to remove them.
2022-05-10 13:15:11 +08:00
Shraiysh Vaishay 04cb01cf10 [flang][OpenMP] Lowering for task construct
This patch adds lowering for task construct from Fortran to
`omp.task` operation in OpenMPDialect Dialect (mlir). Also added tests
for the same.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D124138
2022-05-10 10:42:08 +05:30
Walter Erquinigo 9d2dd6d762 [NFC][lldb][trace] Use uint64_t when decoding and enconding json
llvm's json parser supports uint64_t, so let's better use it for the
packets being sent between lldb and lldb-server instead of using int64_t
as an intermediate type, which might be error-prone.
2022-05-09 21:55:43 -07:00
Craig Topper 39e63bd2d8 [IR][CostModel] A scalable vector shuffle can't be an identity or reverse shuffle.
Even if the minimum number of elements is 1 and the length doesn't change,
we don't know what vscale is so we can't classify it as identity mask. Instead it
is a zero element splat.

For reverse, we shouldn't classify it as a reverse unless there are at least 2 elements
in the mask. This applies to both fixed and scalable vectors. For fixed vectors, a single
element would be an identity shuffle. For scalable vector it's a zero elt splat.

Reviewed By: sdesmalen, liaolucy

Differential Revision: https://reviews.llvm.org/D124655
2022-05-09 21:37:25 -07:00
Walter Erquinigo b6bb9e7d61 [lldb] Fix 7b73de9ec2
It turns out that the issue in
    https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a
    size_t is attempted to be used interchangeably with uint64_t.
2022-05-09 21:29:00 -07:00
Greg McGary ebc2529206 [ELF] Move InputSectionBase::rawData member [NFC] 2022-05-09 21:20:14 -07:00
Walter Erquinigo c4172c751a [lldb] Fix 7b73de9ec2
It turns out that the issue in
https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a
size_t is attempted to be used interchangeably with uint64_t.
2022-05-09 21:12:11 -07:00
Walter Erquinigo 909a2e3c88 [lldb] Fix 7b73de9ec2
This commit causes
https://lab.llvm.org/buildbot/#/builders/17/builds/21743 to fail
seemingly because of bad handling of the PERF_ATTR_SIZE_VER5 symbol.

This patch tries to handle better the absence of this symbol.
2022-05-09 21:02:40 -07:00
Andrew Litteken 96345f773c [IRSim] Remove early check from similarity matching such that commutative instructions are checked correctly when using the same value.
When the first commutative instruction in a region using the same value in both positions was compared to a corresponding instruction with two different values, there was an early check that determined that since the values were new, it was true that these values acted in the same way structurally. If this was not contradicted later in the program, the regions were marked as similar. This removes that check, so that it is clear that the same value cannot be mapped to two different values.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D124775
2022-05-09 22:59:09 -05:00
Stella Stamenova 784a5bccfd [mlir] Fix python bindings build on Windows in Debug
Currently, building mlir with the python bindings enabled on Windows in Debug is broken because pybind11, python and cmake don't like to play together. This change normalizes how the three interact, so that the builds can now run and succeed.

The main issue is that python and cmake both make assumptions about which libraries are needed in a Windows build based on the flavor.
- cmake assumes that a debug (or a debug-like) flavor of the build will always require pythonX_d.lib and provides no option/hint to tell it to use a different library. cmake does find both the debug and release versions, but then uses the debug library.
- python (specifically pyconfig.h and by extension python.h) hardcodes the dependency on pythonX_d.lib or pythonX.lib depending on whether `_DEBUG` is defined. This is NOT transparent - it does not show up anywhere in the build logs until the link step fails with `pythonX_d.lib is missing` (or `pythonX.lib is missing`)
- pybind11 tries to "fix" this by implementing a workaround - unless Py_DEBUG is defined, `_DEBUG` is explicitly undefined right before including python headers. This also requires some windows headers to be included differently, so while clever, this is a non-trivial workaround.

mlir itself includes the pybind11 headers (which contain the workaround) AS WELL AS python.h, essentially always requiring both pythonX.lib and pythonX_d.lib for linking. cmake explicitly only adds one or the other, so the build fails.

This change does a couple of things:
- In the cmake files, explicitly add the release version of the python library on Windows builds regardless of flavor. Since Py_DEBUG is not defined, pybind11 will always require release and it will be satisfied
- To satisfy python as well, this change removes any explicit inclusions of Python.h on Windows instead relying on the fact that pybind11 headers will bring in what is needed

There are a few additional things that we could do but I rejected as unnecessary at this time:
- define Py_DEBUG based on the CMAKE_BUILD_TYPE - this will *mostly* work, we'd have to think through multiconfig generators like VS, but it's possible. There doesn't seem to be a need to link against debug python at the moment, so I chose not to overcomplicate the build and always default to release
- similar to above, but define Py_DEBUG based on the CMAKE_BUILD_TYPE *as well as* the presence of the debug python library (`Python3_LIBRARY_DEBUG`). Similar to above, this seems unnecessary right now. I think it's slightly better than above because most people don't actually have the debug version of python installed, so this would prevent breaks in that case.
- similar to the two above, but add a cmake variable to control the logic
- implement the pybind11 workaround directly in mlir (specifically in Interop.h) so that Python.h can still be included directly. This seems prone to error and a pain to maintain in lock step with pybind11
- reorganize how the pybind11 headers are included and place at least one of them in Interop.h directly, so that the header has all of its dependencies included as was the original intention. I decided against this because it really doesn't need pybind11 logic and it's always included after pybind11 is, so we don't necessarily need the python includes

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D125284
2022-05-09 19:46:47 -07:00
Sheng 1284ce917b [NFC] Modify the comment to reflect the changes in decoder 2022-05-10 10:31:45 +08:00
Ben Shi 88c336d8ef [clang][Driver] Add more tests for riscv
Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D125157
2022-05-10 02:27:56 +00:00
Ben Shi eccf5efecc [RISCV][NFC] Add 'rv32izvfh' invalid arch test
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125210
2022-05-10 02:27:56 +00:00
Peter Klausler 8c407f4a11 [flang] Allow ENTRY function result symbol usage before the ENTRY
In a function, ENTRY E without an explicit RESULT() creates a
function result entity also named E that is storage associated with
the enclosing function's result.  f18 was emitting an incorrect error
message if that function result E was referenced without any
declaration prior to its ENTRY statement when it should have been
implicitly declared instead.

Differential Revision: https://reviews.llvm.org/D125144
2022-05-09 19:12:23 -07:00
Chuanqi Xu debd9bf3f0 [NFC] follow up code cleanup after D123837
Reviewed By: iains

Differential Revision: https://reviews.llvm.org/D124149
2022-05-10 10:01:06 +08:00
Peter Klausler 8594b051fb [flang] Accept POINTER followed by INTERFACE
As is already supported for dummy procedures, we need to also accept
declarations of procedure pointers that consist of a POINTER attribute
statement followed by an INTERFACE block.  (The case of an INTERFACE
block followed by a POINTER statement already works.)

While cleaning this case up, adjust the utility predicate IsProcedurePointer()
to recognize it (namely a SubprogramDetails symbol with Attr::POINTER)
and delete IsProcName().  Extend tests, and add better comments to
symbol.h to document the two ways in which procedure pointers are
represented.

Differential Revision: https://reviews.llvm.org/D125139
2022-05-09 18:37:09 -07:00
LLVM GN Syncbot f6d4769894 [gn build] Port 059e03476c 2022-05-10 01:06:44 +00:00
Douglas Yung 62f7dc7c03 Add x86 to REQUIRES line in test as suggested in https://reviews.llvm.org/D124105. 2022-05-09 18:01:50 -07:00
Mircea Trofin c35ad9ee4f [mlgo] Support exposing more features than those supported by models
This allows the compiler to support more features than those supported by a
model. The only requirement (development mode only) is that the new
features must be appended at the end of the list of features requested
from the model. The support is transparent to compiler code: for
unsupported features, we provide a valid buffer to copy their values;
it's just that this buffer is disconnected from the model, so insofar
as the model is concerned (AOT or development mode), these features don't
exist. The buffers are allocated at setup - meaning, at steady state,
there is no extra allocation (maintaining the current invariant). These
buffers has 2 roles: one, keep the compiler code simple. Second, allow
logging their values in development mode. The latter allows retraining
a model supporting the larger feature set starting from traces produced
with the old model.

For release mode (AOT-ed models), this decouples compiler evolution from
model evolution, which we want in scenarios where the toolchain is
frequently rebuilt and redeployed: we can first deploy the new features,
and continue working with the older model, until a new model is made
available, which can then be picked up the next time the compiler is built.

Differential Revision: https://reviews.llvm.org/D124565
2022-05-09 18:01:21 -07:00
Peter Klausler eef76f9821 [flang] Reverse a reversed type compatibility check
The semantic test for an intrinsic assignment to a polymorphic
derived type entity from a type that is an extension of its base
type was reversed, so it would allow assignments that it shouldn't
and disallowed some that it should; and the test case for it
incorectly assumed that the invalid semantics were correct.
Fix the code and the test, and add a new test for the invalid
case (LHS type is an extension of the RHS type).

Differential Revision: https://reviews.llvm.org/D125135
2022-05-09 17:55:10 -07:00
Peter Klausler 5d5d2a0b19 [flang] Refine error checking in specification expressions
The rules in the Fortran standard for specification expressions
are full of special cases and exceptions, and semantics didn't get
them exactly right.  It is valid to refer to an INTENT(OUT) dummy
argument in a specification expression in the context of a
specification inquiry function like SIZE(); it is not valid to
reference an OPTIONAL dummy argument outside of the context of
PRESENT.  This patch makes the specification expression checker
a little context-sensitive about whether it's examining an actual
argument of a specification inquiry intrinsic function or not.

Differential Revision: https://reviews.llvm.org/D125131
2022-05-09 17:50:12 -07:00
Peter Klausler 3382edf9b9 [flang] Allow implicit declaration of DATA objects in inner procedures
DATA statements in inner procedures were not treating undeclared objects
as implicitly declared variables if the DATA statement appeared in a
specification part; they were treated as host-associated symbols instead.
This was incorrect.  Fix DATA statement name resolution to always treat
DATA as if it had appeared in the executable part.

Differential Revision: https://reviews.llvm.org/D125129
2022-05-09 17:49:47 -07:00
Carl Ritson 78ab7adbd3 [AMDGPU] Pre-commit test for D124981. NFC. 2022-05-10 09:48:25 +09:00
Carl Ritson dcd69d82ba [AMDGPU] Generate checks in llvm.amdgcn.softwqm.ll 2022-05-10 09:48:25 +09:00
Peter Klausler 78a166b47b [flang] Allow NULL() actual argument for optional dummy procedure
A disassociated procedure pointer is allowed to be passed as an absent
actual argument that corresponds to an optional dummy procedure,
but not NULL(); accept that case as well.

Differential Revision: https://reviews.llvm.org/D125127
2022-05-09 17:41:39 -07:00
Peter Klausler 45ac2c730b [flang] Allow PDTs with LEN parameters in REDUCE()
The type compatibility checks for the ARRAY= argument and the dummy
arguments and result of the OPERATION= argument to the REDUCE intrinsic
function need to allow for parameterized data types with LEN parameters.
(Their values are required to be identical but this is not a numbered
constraint requiring a compilation time check).

Differential Revision: https://reviews.llvm.org/D125124
2022-05-09 17:40:50 -07:00
Amaury Séchet 59fea9380d [AArch64] Remove ADDC, ADDE, SUBC, SUBE support, use the CARRY ops instead
This cleans up tech debt. Similar to D33390 .

Reviewed By: Kmeakin

Differential Revision: https://reviews.llvm.org/D125150
2022-05-10 00:23:15 +00:00
Peter Klausler 948d0b340b [flang] Correct actual/dummy procedure compatibility for ALLOCATABLE/POINTER functions
Functions returning ALLOCATABLE or POINTER arrays have descriptor inquiries in
their results' shape expressions that won't compare equal.  These functions
need only be checked for compatible ranks (& of course other characteristics).

Differential Revision: https://reviews.llvm.org/D125123
2022-05-09 16:40:21 -07:00
Peter Klausler 6f14dbedd9 [flang] Fix to UnwrapConvertedExpr()
The utility UnwrapConvertedExpr() was failing to unwrap a
converted TypeParamInquiry operation when called from runtime
derived type description table construction, leading to an
abort in semantics.

Differential Revision: https://reviews.llvm.org/D125119
2022-05-09 16:39:15 -07:00
Michael Kruse b554c643c5 [polly] Fix type in function name. NFC. 2022-05-09 18:19:38 -05:00
Peter Klausler a054c88205 [flang] Ensure that structure constructors fold parameter references
Structure contructors for instances of parameterized derived types
must have their components' values folded in the context of the values
of the type parameters.

Differential Revision: https://reviews.llvm.org/D125116
2022-05-09 16:09:49 -07:00
Greg Clayton 879a47a55f Add the ability to debug through an exec into ld
A previous commit enabled LLDB to be able to debug a program launched via ld: https://reviews.llvm.org/D108061.

This commit adds the ability to debug a program launched via ld when it happens during an exec into the dynamic loader. There was an issue where after the exec we would locate the rendezvous structure right away but it didn't contain any valid values and we would try to set the dyanamic loader breakpoint at address zero. This patch fixes that and adds a test.

Differential Revision: https://reviews.llvm.org/D125253
2022-05-09 16:07:40 -07:00
LLVM GN Syncbot ee0e00b198 [gn build] Port 7b73de9ec2 2022-05-09 23:05:57 +00:00
Walter Erquinigo 7b73de9ec2 [trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace
I'm refactoring IntelPTThreadTrace into IntelPTSingleBufferTrace so that it can
both single threads or single cores. In this diff I'm basically renaming the
class, moving it to its own file, and removing all the pieces that are not used
along with some basic cleanup.

Differential Revision: https://reviews.llvm.org/D124648
2022-05-09 16:05:26 -07:00
Walter Erquinigo b8d1776fc5 [trace][intelpt] Support system-wide tracing [2] - Add a dummy --per-core-tracing option
This updates the documentation of the gdb-remote protocol, as well as the help messages, to include the new --per-core-tracing option.

Differential Revision: https://reviews.llvm.org/D124640
2022-05-09 16:05:26 -07:00