- Feb 17, 2023
-
-
LLVM GN Syncbot authored
-
Thomas Raoux authored
Allow user to apply multi-buffering transformation for cases where proving that there is no loop carried dependency is not trivial. In this case user needs to ensure that the data are written and read in the same iteration otherwise the result is incorrect. Differential Revision: https://reviews.llvm.org/D144227
-
Sanjay Patel authored
This is a cleanup/modernization patch requested in D144045 to make loop analysis a proper optional parameter to the pass rather than a semi-arbitrary value inherited via the pass pipeline. It's a bit more complicated than the recent patch I started copying from (D143980) because InstCombine already has an option for MaxIterations (added with D71145). I debated just deleting that option, but it was used by a pair of existing tests, so I put it into a struct (code largely copied from SimplifyCFG's implementation) to make the code more flexible for future options enhancements. I didn't alter the pass manager invocations of InstCombine in this patch because the patch was already getting big, but that will be a small follow-up as noted with the TODO comment. Differential Revision: https://reviews.llvm.org/D144199
-
Alexey Bataev authored
Metric: size..text size..text results results0 diff SingleSource/Regression/C/gcc-c-torture/execute/GCC-C-execute-980605-1.test 445.00 461.00 3.6% SingleSource/Benchmarks/Adobe-C++/loop_unroll.test 428477.00 428445.00 -0.0% External/SPEC/CFP2006/447.dealII/447.dealII.test 618849.00 618785.00 -0.0% For all tests some extra code was optimized, GCC-C-execute has some more inlining after Differential Revision: https://reviews.llvm.org/D132261 -
Teresa Johnson authored
New set operations split out of D140908 as suggested, and I have added unit testing for all set operations. This adds a set_intersection, which returns the intersection instead of updating the first set like set_intersect (using a different name analogous to set_difference vs set_subtract). Also adds a variant of set_subtract that updates two additional set arguments to note which members of the subtrahend were removed from the minuend and which were not. Differential Revision: https://reviews.llvm.org/D144220
-
Paul Robinson authored
Differential Revision: https://reviews.llvm.org/D144188
-
Christian Ulmann authored
This commit moves the access group translation into the LoopAnnotationTranslation class as these two metadata kinds only appear together. Drops the access group cleanup from `ModuleTranslation::forgetMapping` as this is only used on function regions. Access groups only appear in the region of a global metadata operation and will thus not be cleaned here. Analogous to https://reviews.llvm.org/D143577 Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D144253
-
Paul Walker authored
[SVE] Add intrinsics for floating-point operations that explicitly undefine the result for inactive lanes. This patch is the floating-point equivalent of D141937. Depends on D143764. Differential Revision: https://reviews.llvm.org/D143765
-
Marius Brehler authored
This extends the standalone example to illustrate how to structure the files needed to create own types. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D143715
-
Vladislav Dzhidzhoev authored
RecordLayoutBuilder assumes the size of a potentially-overlapping class/struct field with non-zero size as the size of the base subobject type corresponding to the field type. Make CGRecordLayoutBuilder to acknowledge that in order to avoid incorrect padding insertion. Differential Revision: https://reviews.llvm.org/D139741
-
Erich Keane authored
As reported in GH60642, we asserted when there was a lambda defined in a template arguments inside of a concept, which caused us to not properly set up the list of instantiation args. This patch ensures that the 'lambda context decl' correctly falls-through the template argument instantiation, so that it is available when instantiating the lambda, and thus, when setting up the lambda instantiation args list.
-
Nikita Popov authored
-
Nikita Popov authored
-
Aaron Ballman authored
This addresses issues found in: https://lab.llvm.org/buildbot/#/builders/92/builds/40269
-
Dmitry Bushev authored
Some immediate types in RISCV target description lack operand type field. This leads them being listed as OPERAND_UNKNOWN in MCOperandInfo. This patch adds this fields. This is NFC because it does not affect flow of any current tools implementation. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D144105
-
Christian Ulmann authored
This commit introduces the DINamespaceAttr to model LLVM's DINamespace metadata. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D144243
-
Christian Ulmann authored
This commit makes DIDerivedTypeAttr's baseType parameter optional to ensure imported IR doesn't break the printer. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D144247
-
LLVM GN Syncbot authored
-
Nikolas Klauser authored
Reviewed By: Mordante, #libc Spies: arichardson, libcxx-commits, krytarowski Differential Revision: https://reviews.llvm.org/D142972
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D144250
-
Nikita Popov authored
-
Balazs Benics authored
One might think that by merging the equivalence classes (eqclasses) of `Sym1` and `Sym2` symbols we would end up with a `State` in which the eqclass of `Sym1` and `Sym2` should now be the same. Surprisingly, it's not //always// true. Such an example triggered the assertion enforcing this _unjustified_ invariant in https://github.com/llvm/llvm-project/issues/58677. ```lang=C++ unsigned a, b; #define assert(cond) if (!(cond)) return void f(unsigned c) { /*(1)*/ assert(c == b); /*(2)*/ assert((c | a) != a); /*(3)*/ assert(a); // a = 0 => c | 0 != 0 => c != 0 => b != 0 } ``` I believe, that this assertion hold for reasonable cases - where both `MemberSym` and `SimplifiedMemberSym` refer to live symbols. It can only fail if `SimplifiedMemberSym` refers to an already dead symbol. See the reasoning at the very end. In this context, I don't know any way of determining if a symbol is alive/dead, so I cannot refine the assertion in that way. So, I'm proposing to drop this unjustified assertion. --- Let me elaborate on why I think the assertion is wrong in its current shape. Here is a quick reminder about equivalence classes in CSA. We have 4 mappings: 1) `ClassMap`: map, associating `Symbols` with an `EquivalenceClass`. 2) `ClassMembers`: map, associating `EquivalenceClasses` with its members - basically an enumeration of the `Symbols` which are known to be equal. 3) `ConstraintRange`: map, associating `EquivalenceClasses` with the range constraint which should hold for all the members of the eqclass. 4) `DisequalityMap`: I'm omitting this, as it's irrelevant for our purposes now. Whenever we encounter/assume that two `SymbolRefs` are equal, we update the `ClassMap` so that now both `SymbolRefs` are referring to the same eqclass. This operation is known as `merge` or `union`. Each eqclass is uniquely identified by the `representative` symbol, but it could have been just a unique number or anything else - the point is that an eqclass is identified by something unique. Initially, all Symbols form - by itself - a trivial eqclass, as there are no other Symbols to which it is assumed to be equal. A trivial eqclass has //notionally// exactly one member, the representative symbol. I'm emphasizing that //notionally// because for such cases we don't store an entry in the `ClassMap` nor in the `ClassMembers` map, because it could be deduced. By `merging` two eqclasses, we essentially do what you would think it does. An important thing to highlight is that the representative symbol of the resulting eqclass will be the same as one of the two eqclasses. This operation should be commutative, so that `merge(eq1,eq2)` and `merge(eq2,eq1)` should result in the same eqclass - except for the representative symbol, which is just a unique identifier of the class, a name if you will. Using the representative symbol of `eq1` or `eq2` should have no visible effect on the analysis overall. When merging `eq1` into `eq2`, we take each of the `ClassMembers` of `eq1` and add them to the `ClassMembers` of `eq2` while we also redirect all the `Symbol` members of `eq1` to map to the `eq2` eqclass in the `ClassMap`. This way all members of `eq1` will refer to the correct eqclass. After these, `eq1` key is unreachable in the `ClassMembers`, hence we can drop it. --- Let's get back to the example. Note that when I refer to symbols `a`, `b`, `c`, I'm referring to the `SymbolRegionValue{VarRegion{.}}` - the value of that variable. After `(1)`, we will have a constraint `c == b : [1,1]` and an eqclass `c,b` with the `c` representative symbol. After `(2)`, we will have an additional constraint `c|b != a : [1,1]` with the same eqclass. We will also have disequality info about that `c|a` is disequal to `a` - and the other way around. However, after the full-expression, `c` will become dead. This kicks in the garbage collection, which transforms the state into this: - We no longer have any constraints, because only `a` is alive, for which we don't have any constraints. - We have a single (non-trivial) eqclass with a single element `b` and representative symbol `c`. (Dead symbols can be representative symbols.) - We have the same disequality info as before. At `(3)` within the false branch, `a` get perfectly constrained to zero. This kicks in the simplification, so we try to substitute (simplify) the variable in each SymExpr-tree. In our case, it means that the `c|a != a : [1,1]` constraint gets re-evaluated as `c|0 != 0 : [1,1]`, which is `c != 0 : [1,1]`. Under the hood, it means that we will call `merge(c|a, c)`. where `c` is the result of `simplifyToSVal(State, MemberSym).getAsSymbol()` inside `EquivalenceClass::simplify()`. Note that the result of `simplifyToSVal()` was a dead symbol. We shouldn't have acquired an already dead symbol. AFAIK, this is the only way we can get one at this point. Since `c` is dead, we no longer have a mapping in `ClassMap` for it; hence when we try to `find()` the eqclass of `c`, it will report that it's a trivial eqclass with the representative symbol `c`. After `merge(c|a, c)`, we will have a single (non-trivial) eqclass of `b, c|a` with the representative symbol `c|a` - because we merged the eqclass of `c` into the eqclass of `c|a`. This means that `find(c|a)` will result in the eqclass with the representative symbol `c|a`. So, we ended up having different eqclasses for `find(c|a)` and `find(c)` after `merge(c|a, c)`, firing the assertion. I believe, that this assertion hold for reasonable cases - where both `MemberSym` and `SimplifiedMemberSym` refer to live symbols. `MemberSym` should be live in all cases here, because it is from `ClassMembers` which is pruned in `removeDeadBindings()` so these must be alive. In this context, I don't know any way of determining if a symbol is alive/dead, so I cannot refine the assertion in that way. So, I'm proposing to drop this unjustified assertion. I'd like to thank @martong for helping me to conclude the investigation. It was really difficult to track down. PS: I mentioned that `merge(eq1, eq2)` should be commutative. We actually exploit this for merging the smaller eqclass into the bigger one within `EquivalenceClass::merge()`. Yea, for some reason, if you swap the operands, 3 tests break (only failures, no crashes) aside from the test which checks the state dumps. But I believe, that is a different bug and orthogonal to this one. I just wanted to mention that. - `Analysis/solver-sym-simplification-adjustment.c` - `Analysis/symbol-simplification-fixpoint-iteration-unreachable-code.cpp` - `Analysis/symbol-simplification-reassume.cpp` Fixes #58677 Reviewed By: vabridgers Differential Revision: https://reviews.llvm.org/D138037
-
Nikolas Klauser authored
Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D141228
-
Anton Sidorenko authored
For in-order cores MachineCombiner makes better decisions when the critical path is calculated only for the current basic block and does not take into account other blocks from the trace. This patch adds a virtual method to TargetInstrInfo to allow each target decide which strategy to use. Depends on D140541 Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D140542
-
Nikita Popov authored
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D144245
-
Martin Storsjö authored
This reverts commit 389bfbd6. This commit broke the compiler-rt/test/profile/Windows/coverage-weak-lld.cpp testcase. This testcase builds and links in an MSVC environment, but explicitly passes -lldmingw to the linker, to opt in to certain mingw-style behaviours regarding weak symbols, since effb87df. This patch broke that test, which now errored out with these errors: lld-link: error: could not open 'libuuid.a': no such file or directory lld-link: error: could not open 'libLIBCMT.a': no such file or directory lld-link: error: could not open 'libOLDNAMES.a': no such file or directory
-
Christian Ulmann authored
This commit ensures that the importing of LLVM modules first verifies that the module is even valid. As many tests did not work with valid LLVM IR, they were fixed as part of this commit. Some error messages were only reachable with invalid input IR, thus they were replaced with a failures. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D144186
-
Benjamin Kramer authored
This is wasteful, but only affects the legacy pass manager. Otherwise a1b78fb9 would crash JT when running with that PM. There are still a few users of the legacy PM out there that are reluctant to migrate, numba in this case. No test as we don't test legacy PM anymore.
-
Vassil Vassilev authored
This patch teaches our incremental compilation infrastructure to push and pop a fake function scope making the Parser happy when parsing compound statements as part of a top-leve statement declaration. Differential revision: https://reviews.llvm.org/D139798
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D144242
-
Antonio Frighetto authored
Introduce ConstantRange support for ctlz intrinsic, including exhaustive testing. Among other things, LVI may now be able to propagate information about cltz constant ranges lattice values. Differential Revision: https://reviews.llvm.org/D142234
-
R. Voggenauer authored
The sys::fs::equivalent(file_status, file_status) function is meant to judge whether two file_status structs denote the same individual file. On Unix, this is implemented by only comparing the st_dev and st_ino numbers (from stat), ignoring all other fields. On Windows, lacking reliable fields corresponding to st_dev and st_ino, equivalent(file_status, file_status) compares essentially all fields. However, since 1e39ef33 (https://reviews.llvm.org/D18456), file_status also contains the file access time. Including the file access time in equivalent(file_status, file_status) makes it possible to spuriously break. In particular, when invoking equivalent(Twine, Twine), with two paths, there's a race condition - the function calls status() on both input paths. Even if the two paths are the same, the comparison can fail, if the file was accessed between the two status() calls. Thus, it seems like the inclusion of the access time in equivalent(file_status, file_status) was a mistake. This race condition can cause spurious failures when linking with LLD/ELF, where LLD uses equivalent() to check whether a file exists within a specific sysroot, and that sysroot is accessed by other processes concurrently. This fixes downstream issue https://github.com/msys2/MINGW-packages/issues/15695. Differential Revision: https://reviews.llvm.org/D144172
-
Martin Storsjö authored
In mingw mode, all linker paths are passed explicitly to the linker by the compiler driver. Don't try to implicitly add linker paths from the LIB environment variable or by detecting an MSVC installation directory. If the /winsysroot command line parameter is explicitly passed to lld-link while /lldmingw is specified, it could be considered reasonable to actually include those paths. However, modifying the code to handle only the /winsysroot case but not the other ones, when the mingw mode has been enabled, seems like much more code complexity for a mostly hypothetical case. Add a test for this when case when using LIB. (The code paths for trying to detect an MSVC installation aren't really regression tested.) Also fix an issue in the existing test for "Check that when /winsysroot is specified, %LIB% is ignored.", where the LIB variable pointed to a nonexistent directory, so the test would pass even if /winsysroot wouldn't be specified. Differential Revision: https://reviews.llvm.org/D144084
-
Nikita Popov authored
-
Tobias Gysi authored
This revision adds atomic support to the LoadOp. It chooses to print the atomic keywords together with the syncscope and ordering arguments, which simplifies parsing and printing compared to the LLVM IR printer that puts the atomic keyword at the beginning. It uses the ordering attribute to check if the load is atomic. The revision also implements verifiers to ensure the constraints that apply to atomic load operations are checked. Reviewed By: Dinistro Differential Revision: https://reviews.llvm.org/D144112
-
Nikita Popov authored
-
Diana Picus authored
Add a few tests to make sure we get the expected instruction for the WMMA builtins (and generally that our builtins and intrinsics are on the same page and won't blow up). Differential Revision: https://reviews.llvm.org/D144176
-
Johannes de Fine Licht authored
This loosens the requirement of no passthrough function attribute being present to checking for specific attributes that prevent inlining. Since these attributes are no longer strictly passthrough, they should eventually be upgraded to some form of addressable attributes. Drops the expensive StringSwitches over call and function attributes in favor of selectively disallowing attributes that prevent inlining (similiar to the LLVM inliner), thereby moving to a less conservative approach. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D144104
-
Nikita Popov authored
-