- Nov 26, 2021
-
-
Jan Svoboda authored
This commits extracts a couple of nested conditions into a separate function with early returns, making the control flow easier to understand.
-
Stanislav Funiak authored
This is a small diff that splits out the debug output for PDL bytecode. When running bytecode with debug output on, it is useful to know the line numbers where the PDLIntepr operations are performed. Usually, these are in a single MLIR file, so it's sufficient to print out the line number rather than the entire location (which tends to be quite verbose). This debug output is gated by `LLVM_DEBUG` rather than `#ifndef NDEBUG` to make it easier to test. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D114061
-
Stanislav Funiak authored
This is commit 4 of 4 for the multi-root matching in PDL, discussed in https://llvm.discourse.group/t/rfc-multi-root-pdl-patterns-for-kernel-matching/4148 (topic flagged for review). This PR integrates the various components (root ordering algorithm, nondeterministic execution of PDL bytecode) to implement multi-root PDL matching. The main idea is for the pattern to specify mulitple candidate roots. The PDL-to-PDLInterp lowering selects one of these roots and "hangs" the pattern from this root, traversing the edges downwards (from operation to its operands) when possible and upwards (from values to its uses) when needed. The root is selected by invoking the optimal matching multiple times, once for each candidate root, and the connectors are determined form the optimal matching. The costs in the directed graph are equal to the number of upward edges that need to be traversed when connecting the given two candidate roots. It can be shown that, for this choice of the cost function, "hanging" the pattern an inner node is no better than from the optimal root. The following three main additions were implemented as a part of this PR: 1. OperationPos predicate has been extended to allow tracing the operation accepting a value (the opposite of operation defining a value). 2. Predicate checking if two values are not equal - this is useful to ensure that we do not traverse the edge back downwards after we traversed it upwards. 3. Function for for building the cost graph among the candidate roots. 4. Updated buildPredicateList, building the predicates optimal branching has been determined. Testing: unit tests (an integration test to follow once the stack of commits has landed) Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D108550
-
Stanislav Funiak authored
This is commit 3 of 4 for the multi-root matching in PDL, discussed in https://llvm.discourse.group/t/rfc-multi-root-pdl-patterns-for-kernel-matching/4148 (topic flagged for review). We form a graph over the specified roots, provided in `pdl.rewrite`, where two roots are connected by a directed edge if the target root can be connected (via a chain of operations) in the underlying pattern to the source root. We place a restriction that the path connecting the two candidate roots must only contain the nodes in the subgraphs underneath these two roots. The cost of an edge is the smallest number of upward traversals (edges) required to go from the source to the target root, and the connector is a `Value` in the intersection of the two subtrees rooted at the source and target root that results in that smallest number of such upward traversals. Optimal root ordering is then formulated as the problem of finding a spanning arborescence (i.e., a directed spanning tree) of minimal weight. In order to determine the spanning arborescence (directed spanning tree) of minimum weight, we use the [Edmonds' algorithm](https://en.wikipedia.org/wiki/Edmonds%27_algorithm). The worst-case computational complexity of this algorithm is O(_N_^3) for a single root, where _N_ is the number of specified roots. The `pdl`-to-`pdl_interp` lowering calls this algorithm as a subroutine _N_ times (once for each candidate root), so the overall complexity of root ordering is O(_N_^4). If needed, this complexity could be reduced to O(_N_^3) with a more efficient algorithm. However, note that the underlying implementation is very efficient, and _N_ in our instances tends to be very small (<10). Therefore, we believe that the proposed (asymptotically suboptimal) implementation will suffice for now. Testing: a unit test of the algorithm Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D108549
-
Stanislav Funiak authored
This is commit 2 of 4 for the multi-root matching in PDL, discussed in https://llvm.discourse.group/t/rfc-multi-root-pdl-patterns-for-kernel-matching/4148 (topic flagged for review). This commit implements the features needed for the execution of the new operations pdl_interp.get_accepting_ops, pdl_interp.choose_op: 1. The implementation of the generation and execution of the two ops. 2. The addition of Stack of bytecode positions within the ByteCodeExecutor. This is needed because in pdl_interp.choose_op, we iterate over the values returned by pdl_interp.get_accepting_ops until we reach finalize. When we reach finalize, we need to return back to the position marked in the stack. 3. The functionality to extend the lifetime of values that cross the nondeterministic choice. The existing bytecode generator allocates the values to memory positions by representing the liveness of values as a collection of disjoint intervals over the matcher positions. This is akin to register allocation, and substantially reduces the footprint of the bytecode executor. However, because with iterative operation pdl_interp.choose_op, execution "returns" back, so any values whose original liveness cross the nondeterminstic choice must have their lifetime executed until finalize. Testing: pdl-bytecode.mlir test Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D108547
-
Igor Kirillov authored
We can not swap multiplicand and multiplier because the sve intrinsics are predicated. Imagine lanes in vectors having the following values: pg = 0 multiplicand = 1 (from dup) multiplier = 2 The resulting value should be 1, but if we swap multiplicand and multiplier it will become 2, which is incorrect. Differential Revision: https://reviews.llvm.org/D114577 -
Bhumitram Kumar authored
https://reviews.llvm.org/D93458 removed the /Zd flag as MSVC doesn't support that syntax. Instead users should be using -gline-tables-only. The /Zd flag is still mentioned at https://clang.llvm.org/docs/UsersManual.html#clang-cl : /Zd Emit debug line number tables only. Fix PR52571 Reviewed By: xgupta Differential Revision: https://reviews.llvm.org/D114632
-
Stanislav Funiak authored
This is commit 1 of 4 for the multi-root matching in PDL, discussed in https://llvm.discourse.group/t/rfc-multi-root-pdl-patterns-for-kernel-matching/4148 (topic flagged for review). These operations are: * pdl.get_accepting_ops: Returns a list of operations accepting the given value or a range of values at the specified position. Thus if there are two operations `%op1 = "foo"(%val)` and `%op2 = "bar"(%val)` accepting a value at position 0, `%ops = pdl_interp.get_accepting_ops of %val : !pdl.value at 0` will return both of them. This allows us to traverse upwards from a value to operations accepting the value. * pdl.choose_op: Iteratively chooses one operation from a range of operations. Therefore, writing `%op = pdl_interp.choose_op from %ops` in the example above will select either `%op1`or `%op2`. Testing: Added the corresponding test cases to mlir/test/Dialect/PDLInterp/ops.mlir. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D108543
-
Daniel Kiss authored
When unwind step reaches the end of the stack that means the force unwind should notify the stop function. This is not an error, it could mean just the thread is cleaned up completely. Reviewed By: #libunwind, mstorsjo Differential Revision: https://reviews.llvm.org/D109856
-
Carl Ritson authored
Attempt to further document the intended cache policies requested by different combinations of GLC, SLC and DLC bits. GFX10 non-temporal stores are updated to set GLC. Reviewed By: t-tye Differential Revision: https://reviews.llvm.org/D114351
-
Abinav Puthan Purayil authored
This change folds a basic funnel shift idiom: - (or (shl x, amt), (lshr y, sub(bw, amt))) -> fshl(x, y, amt) - (or (shl x, sub(bw, amt)), (lshr y, amt)) -> fshr(x, y, amt) This also helps in folding to rotate shift if x and y are equal since we already have a funnel shift to rotate combine. Differential Revision: https://reviews.llvm.org/D114499
-
David Sherwood authored
In VPRecipeBuilder::handleReplication if we believe the instruction is predicated we then proceed to create new VP region blocks even when the load is uniform and only predicated due to tail-folding. I have updated isPredicatedInst to avoid treating a uniform load as predicated when tail-folding, which means we can do a single scalar load and a vector splat of the value. Tests added here: Transforms/LoopVectorize/AArch64/tail-fold-uniform-memops.ll Differential Revision: https://reviews.llvm.org/D112552
-
Jan Svoboda authored
The filesystem used during dependency scanning does two things: it caches file entries and minimizes source file contents. We use the term "ignored file" in a couple of places, but it's not clear what exactly that means. This commit clears up the semantics, explicitly spelling out this relates to minimization.
-
Jan Svoboda authored
-
Bradley Smith authored
Differential Revision: https://reviews.llvm.org/D113281
-
David Green authored
This converts a vector SETCC([0,1,2,..], splat(n), ult) to vctp n, which can be fewer instructions and prevent the need for constant pool loads. Differential Revision: https://reviews.llvm.org/D114177
-
Simon Pilgrim authored
If the ADD node is the only user of the repeated operand, then treat this as single use - allows us to peek through shl(x,1) patterns.
-
Venkata Ramanaiah Nalamothu authored
Currently the 'memory write' command allows specifying the values when writing the file contents to memory but the values are actually ignored. This patch fixes that by erroring out when values are specified in such cases. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D114544
-
Mikhail Maltsev authored
This patch implements operator<=> for std::reverse_iterator and also adds a test that checks that three-way comparison of different instantiations of std::reverse_iterator works as expected (related to D113417). Reviewed By: ldionne, Quuxplusone, #libc Differential Revision: https://reviews.llvm.org/D113695
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D114609
-
David Green authored
-
Kirill Bobyrev authored
Currently, BeforeExecute is called before BeginSourceFile which does not allow using PP in the callbacks. Change the ordering to ensure it is possible. This is a prerequisite for D114370. Originated from a discussion with @kadircet. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D114525
-
David Sherwood authored
Currently the generic lowering of llvm.get.active.lane.mask is done in SelectionDAGBuilder::visitIntrinsicCall and currently assumes only fixed-width vectors are used. This patch changes the code to be more generic and support scalable vectors too. I have added tests for SVE here: CodeGen/AArch64/active_lane_mask.ll although the code quality leaves a lot to be desired. The code will be improved significantly in a later patch that makes use of the SVE whilelo instruction. Differential Revision: https://reviews.llvm.org/D114541
-
Tobias Gysi authored
Use primarily matvec instead of matmul to test hoist padding. Test the hoisting only starting from already padded IR. Use one-dimensional tiling only except for the tile_and_fuse test that exercises hoisting on a larger loop nest with fill and pad tensor operations in the backward slice. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D114608
-
Balázs Kéri authored
The AST structural equivalence check did not differentiate between a struct and a struct with same name in different namespace. When type of a member is checked it is possible to encounter such a case and wrongly decide that the types are similar. This problem is fixed by check for the namespaces of a record declaration. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D113118
-
Michal Terepeta authored
Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D113854
-
Dmitry Vyukov authored
Sometimes stacks for at_exit callbacks don't include any of the user functions/files. For example, a race with a global std container destructor will only contain the container type name and our at_exit_wrapper function. No signs what global variable this is. Remember and include in reports the function that installed the at_exit callback. This should give glues as to what variable is being destroyed. Depends on D114606. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D114607
-
Dmitry Vyukov authored
Depends on D114605. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D114606
-
Dmitry Vyukov authored
Add a test for a common C++ bug when a global object is destroyed while background threads still use it. Depends on D114604. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D114605
-
Dmitry Vyukov authored
Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D114604
-
Kazu Hirata authored
-
Christudasan Devadasan authored
The combined vector register classes with both VGPRs and AGPRs are currently unallocatable. This patch turns them into allocatable as a prerequisite to enable copy between VGPR and AGPR registers during regalloc. Also, added the missing AV register classes from 192b to 1024b. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D109300
-
Fangrui Song authored
BaseCommand was picked when PHDRS/INSERT/etc were not implemented. Rename it to SectionCommand to match `sectionCommands` and make it clear that the commands are used in SECTIONS (except a special case for SymbolAssignment). Also, improve naming of some BaseCommand variables (base -> cmd).
-
Jessica Clarke authored
-
Matthias Springer authored
Pass BufferizationStep instead of BufferizationAliasInfo. Note: BufferizationState contains BufferizationAliasInfo. Differential Revision: https://reviews.llvm.org/D114512
-
Matthias Springer authored
Use composition instead of inheritance for storing dialect-specific bufferization state. This is in preparation of adding "tensor dialect"-specific bufferization state. Differential Revision: https://reviews.llvm.org/D114508
-
Matthias Springer authored
If `allowReturnMemref` is set to true, arbitrary memrefs may be returned from FuncOps. Also remove allocation hoisting code, which is only partly implemented at the moment. The purpose of this commit is to untangle `bufferize` from `aliasInfo`. (Even with this change, they are not fully untangled yet.) Differential Revision: https://reviews.llvm.org/D114507
-
Matthias Springer authored
Bufferization of function boundaries is extracted from ComprehensiveBufferize into a separate file. This will become its own build target in the future. Differential Revision: https://reviews.llvm.org/D114226
-
Fangrui Song authored
-
Fangrui Song authored
This partially reverts r315409: the description applies to LinkerScript, but not to OutputSection. The name "sectionCommands" is used in both LinkerScript::sectionCommands and OutputSection::sectionCommands, which may lead to confusion. "commands" in OutputSection has no ambiguity because there are no other types of commands.
-