- Oct 27, 2020
-
-
Max Kazantsev authored
-
Sam McCall authored
Copy/move break invariants (move could be fixed). Node/Tree should have no public constructors, they're abstract. Destructor is private to enforce arena allocation. (Making the constructor of all subclasses private doesn't seem worthwhile) Differential Revision: https://reviews.llvm.org/D90163
-
Craig Topper authored
This uses PreprocessISelDAG to replace the constant before instruction selection instead of matching opcodes after. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D89178
-
Wei Wang authored
In small code model, program and its symbols are linked in the lower 2 GB of the address space. Try encoding global address even when the range is unknown in such case. Differential Revision: https://reviews.llvm.org/D89341
-
Christian Sigg authored
The TypeID instance was moved in D89153. It wasn't caught that it broke MLIR pretty printers because pre-merge checks don't run check-debuginfo. Avoid disabling all MLIR printers in case this happens again by catching the exception. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D90191
-
Max Kazantsev authored
-
Nathan Ridge authored
Differential Revision: https://reviews.llvm.org/D90134
-
Nathan Ridge authored
sccache is a compiler caching tool similar to ccache. Differential Revision: https://reviews.llvm.org/D88790
-
Serguei Katkov authored
GVN Load PRE can split the backedge causing breaking the loop structure where the latch contains the conditional branch with for example induction variable. Different optimizations expect this form of the loop, so it is better to preserve it for some time. This CL adds an option to control an ability to split backedge. Default value is true so technically it is NFC and current behavior is not changed. Reviewers: fedor.sergeev, mkazantsev, nikic, reames, fhahn Reviewed By: mkazasntsev Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D89854
-
Max Kazantsev authored
Even if the exact exit count is unknown, we can still prove that this exit will not be taken. If we can prove that the predicate is monotonic, fulfilled on first & last iteration, and no overflow happened in between, then the check can be removed. Differential Revision: https://reviews.llvm.org/D87832 Reviewed By: apilipenko
-
Shilei Tian authored
[Clang][OpenMP] Avoid unnecessary privatization of mapper array when there is no user defined mapper In current implementation, if it requires an outer task, the mapper array will be privatized no matter whether it has mapper. In fact, when there is no mapper, the mapper array only contains number of nullptr. In the libomptarget, the use of mapper array is `if (mappers_array && mappers_array[i])`, which means we can directly set mapper array to nullptr if there is no mapper. This can avoid unnecessary data copy. In this patch, the data privatization will not be emitted if the mapper array is nullptr. When it comes to the emit of task body, the nullptr will be used directly. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D90101
-
Jonas Devlieghere authored
On macOS, the read and pread syscalls return EINVAL when the number of bytes to read exceeds INT32_MAX: https://github.com/apple/darwin-xnu/blob/a449c6a3b8014d9406c2ddbdc81795da24aa7443/bsd/kern/sys_generic.c#L355 rdar://68751407 Differential revision: https://reviews.llvm.org/D90201
-
Arthur Eubanks authored
Test copied from noalias-calls.ll with small changes. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D89609
-
Arthur Eubanks authored
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32. To be more consistent everywhere and remove lots of casts from uint64_t to uint32_t, use i64 for branch_weights. Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D88609
-
Arthur Eubanks authored
This reverts commit 504fbec7. Test failure.
-
Bing1 Yu authored
[CostModel][X86] teach TTI calculate cost of chain of vector inserts/extracts more precisely and correctly:In each 128-lane, if there is at least one index is demanded and not all indices are demanded... In each 128-lane, if there is at least one index is demanded and not all indices are demanded and this 128-lane is not the first 128-lane of the legalized-vector, then this 128-lane needs a extracti128; If in each 128-lane, there is at least one index is demanded, this 128-lane needs a inserti128. The following cases will help you build a better understanding: Assume we insert several elements into a v8i32 vector in avx2, Case#1: inserting into 1th index needs vpinsrd + inserti128 Case#2: inserting into 5th index needs extracti128 + vpinsrd + inserti128 Case#3: inserting into 4,5,6,7 index needs 4*vpinsrd + inserti128. Reviewed By: pengfei, RKSimon Differential Revision: https://reviews.llvm.org/D89767
-
Arthur Eubanks authored
Test copied from noalias-calls.ll with small changes. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D89609
-
Arthur Eubanks authored
This pass isn't used in tree and can be ported to the NPM later on if desired. Differential Revision: https://reviews.llvm.org/D90189
-
Arthur Eubanks authored
Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D90182
-
Arthur Eubanks authored
Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D90181
-
River Riddle authored
Using an Identifier is much more efficient for attribute lookups because it uses pointer comparison as opposed to string comparison. Differential Revision: https://reviews.llvm.org/D89660
-
River Riddle authored
This revisions implements sharding in the storage of parametric instances to decrease lock contention by sharding out the allocator/mutex/etc. to use for a specific storage instance based on the hash key. This is a somewhat common approach to reducing lock contention on data structures, and is used by the concurrent hashmaps provided by folly/java/etc. For several compilations tested, this removed all/most lock contention from profiles and reduced compile time by several seconds. Differential Revision: https://reviews.llvm.org/D89659
-
Shilei Tian authored
The implementation of target nowait just wraps the target region into a task. The essential four parameters (base ptr, ptr, size, mapper) are taken as firstprivate such that they will be copied to the private location. When there is no user-defined mapper, the mapper variable will be nullptr. However, it will be still copied to the corresponding place. Therefore, a memcpy will be generated and the source pointer will be nullptr, causing a segmentation fault. The root cause is when calling `emitOffloadingArraysArgument`, the last argument `Options` has a field about whether it requires a task. It only takes depend clause into account. In this patch, the nowait clause is also included. There're two things that will be done in another patches: 1. target data nowait has not been supported yet. D90099 added the support. 2. When there is no mapper, the mapper array can be nullptr no matter whether it requires outer task or not. It can avoid an unnecessary data copy. This is an optimization that is covered in D90101. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D89844
-
Chen Zheng authored
-
Duncan P. N. Exon Smith authored
-
Duncan P. N. Exon Smith authored
Follow-up to b2b7cf39. Differential Revision: https://reviews.llvm.org/D90198
-
Craig Topper authored
-
Chandler Carruth authored
Teach `-fsanitize=fuzzer` to respect `-static` and `-static-libstdc++` when adding C++ standard libraries. Summary: Makes linking the sanitizers follow the same logic as the rest of the driver with respect to the static linking strategy for the C++ standard library. Subscribers: mcrosier, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80488
-
Carl Ritson authored
Exec mask manipulation inserted by SIWholeQuadMode barriers to instruction scheduling. Move the entire pass after the machine instruction scheduler and make changes so pass is correct for non-SSA operation. These changes should leave the pass still usable pre-scheduler, although tests have be updated to reflect post-scheduler results. Reviewed By: nhaehnle Differential Revision: https://reviews.llvm.org/D88081
-
TaWeiTu authored
`-separate-const-offset-from-gep` has not yet be ported, so some tests are not updated. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D90149
-
Duncan P. N. Exon Smith authored
IR: Add a comment at missing std::make_unique calls from b2b7cf39, NFC
-
River Riddle authored
This class represents a rewrite pattern list that has been frozen, and thus immutable. This replaces the uses of OwningRewritePatternList in pattern driver related API, such as dialect conversion. When PDL becomes more prevalent, this API will allow for optimizing a set of patterns once without the need to do this per run of a pass. Differential Revision: https://reviews.llvm.org/D89104
-
River Riddle authored
There are several pieces of pattern rewriting infra in IR/ that really shouldn't be there. This revision moves those pieces to a better location such that they are easier to evolve in the future(e.g. with PDL). More concretely this revision does the following: * Create a Transforms/GreedyPatternRewriteDriver.h and move the apply*andFold methods there. The definitions for these methods are already in Transforms/ so it doesn't make sense for the declarations to be in IR. * Create a new lib/Rewrite library and move PatternApplicator there. This new library will be focused on applying rewrites, and will also include compiling rewrites with PDL. Differential Revision: https://reviews.llvm.org/D89103
-
River Riddle authored
The Pattern class was originally intended to be used for solely matching operations, but that use never materialized. All of the pattern infrastructure uses RewritePattern, and the infrastructure for pure matching(Matchers.h) is implemented inline. This means that this class isn't a useful abstraction at the moment, so this revision refactors it to solely encapsulate the "metadata" of a pattern. The metadata includes the various state describing a pattern; benefit, root operation, etc. The API on PatternApplicator is updated to now operate on `Pattern`s as nothing special from `RewritePattern` is necessary. This refactoring is also necessary for the upcoming use of PDL patterns alongside C++ rewrite patterns. Differential Revision: https://reviews.llvm.org/D86258
-
River Riddle authored
The conversion between PDL and the interpreter is split into several different parts. ** The Matcher: The matching section of all incoming pdl.pattern operations is converted into a predicate tree and merged. Each pattern is first converted into an ordered list of predicates starting from the root operation. A predicate is composed of three distinct parts: * Position - A position refers to a specific location on the input DAG, i.e. an existing MLIR entity being matched. These can be attributes, operands, operations, results, and types. Each position also defines a relation to its parent. For example, the operand `[0] -> 1` has a parent operation position `[0]` (the root). * Question - A question refers to a query on a specific positional value. For example, an operation name question checks the name of an operation position. * Answer - An answer is the expected result of a question. For example, when matching an operation with the name "foo.op". The question would be an operation name question, with an expected answer of "foo.op". After the predicate lists have been created and ordered(based on occurrence of common predicates and other factors), they are formed into a tree of nodes that represent the branching flow of a pattern match. This structure allows for efficient construction and merging of the input patterns. There are currently only 4 simple nodes in the tree: * ExitNode: Represents the termination of a match * SuccessNode: Represents a successful match of a specific pattern * BoolNode/SwitchNode: Branch to a specific child node based on the expected answer to a predicate question. Once the matcher tree has been generated, this tree is walked to generate the corresponding interpreter operations. ** The Rewriter: The rewriter portion of a pattern is generated in a very straightforward manor, similarly to lowerings in other dialects. Each PDL operation that may exist within a rewrite has a mapping into the interpreter dialect. The code for the rewriter is generated within a FuncOp, that is invoked by the interpreter on a successful pattern match. Referenced values defined in the matcher become inputs the generated rewriter function. An example lowering is shown below: ```mlir // The following high level PDL pattern: pdl.pattern : benefit(1) { %resultType = pdl.type %inputOperand = pdl.input %root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType pdl.rewrite %root { pdl.replace %root with (%inputOperand) } } // is lowered to the following: module { // The matcher function takes the root operation as an input. func @matcher(%arg0: !pdl.operation) { pdl_interp.check_operation_name of %arg0 is "foo.op" -> ^bb2, ^bb1 ^bb1: pdl_interp.return ^bb2: pdl_interp.check_operand_count of %arg0 is 1 -> ^bb3, ^bb1 ^bb3: pdl_interp.check_result_count of %arg0 is 1 -> ^bb4, ^bb1 ^bb4: %0 = pdl_interp.get_operand 0 of %arg0 pdl_interp.is_not_null %0 : !pdl.value -> ^bb5, ^bb1 ^bb5: %1 = pdl_interp.get_result 0 of %arg0 pdl_interp.is_not_null %1 : !pdl.value -> ^bb6, ^bb1 ^bb6: // This operation corresponds to a successful pattern match. pdl_interp.record_match @rewriters::@rewriter(%0, %arg0 : !pdl.value, !pdl.operation) : benefit(1), loc([%arg0]), root("foo.op") -> ^bb1 } module @rewriters { // The inputs to the rewriter from the matcher are passed as arguments. func @rewriter(%arg0: !pdl.value, %arg1: !pdl.operation) { pdl_interp.replace %arg1 with(%arg0) pdl_interp.return } } } ``` Differential Revision: https://reviews.llvm.org/D84580 -
Duncan P. N. Exon Smith authored
Instead of putting a fake `SLocEntry` at `LoadedSLocEntryTable[Index]` when it fails to load in `SourceManager::loadSLocEntry`, allocate a fake one. Unless someone is sniffing the address of the returned `SLocEntry` (doubtful), this won't be a functionality change. Note that `SLocEntryLoaded[Index]` wasn't being set to `true` either before or after this change so no accessor is every going to look at `LoadedSLocEntryTable[Index]`. As a side effect, drop the `mutable` from `LoadedSLocEntryTable`. Differential Revision: https://reviews.llvm.org/D89748
-
Gaurav Jain authored
Differential Revision: https://reviews.llvm.org/D90008
-
Zequan Wu authored
-
Nathan James authored
Rearrange the fields to reduce the size of the classes Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D90127
-
Richard Smith authored
of a reference to be acceptable.
-