- Sep 23, 2020
-
-
antonio-cortes-perez authored
The rendered html was (no hyperlink was generated): (see Getting Started <GettingStarted.html#git-pre-push-hook>) Now, it is (with proper hyperlink): (see Git pre-push hook) Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D88116
-
Lang Hames authored
-
Walter Erquinigo authored
Easy fix based on the feedback by maskray on https://reviews.llvm.org/D85705.
-
Hubert Tong authored
-
Hubert Tong authored
A conversion from `pow` to `sqrt` shall not call an `errno`-setting `sqrt` with -//infinity//: the `sqrt` will set `EDOM` where the `pow` call need not. This patch avoids the erroneous (pun not intended) transformation by applying the restrictions discussed in the thread for https://lists.llvm.org/pipermail/llvm-dev/2020-September/145051.html. The existing tests are updated (depending on emphasis in the checks for library calls, avoidance of overlap, and overall coverage): - to add `ninf`, retaining the intended library call, - to use the intrinsic, retaining the use of `select`, or - to expect the replacement to not occur. The following is tested: - The pow intrinsic folds to a `select` instruction to handle -//infinity//. - The pow library call folds, with `ninf`, to `sqrt` without the `select` instruction associated with handling -//infinity//. - The pow library call does not fold to `sqrt` without `ninf`. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D87877
-
Alexey Bataev authored
-
Louis Dionne authored
Each feature-test macro is now a clear block indentation-wise.
-
Louis Dionne authored
-
Philip Reames authored
The motivation here is that MachineBlockPlacement relies on analyzeBranch to remove branches to fallthrough blocks when the branch is not fully analyzeable. With the introduction of the FAULTING_OP psuedo for implicit null checking (see D87861), this case becomes important. Note that it's hard to otherwise exercise this path as BranchFolding handle's any fully analyzeable branch sequence without using this interface. p.s. For anyone who saw my comment in the original review, what I thought was an issue in BranchFolding originally turned out to simply be a bug in my patch. (Now fixed.) Differential Revision: https://reviews.llvm.org/D88035
-
Michael Liao authored
-
Louis Dionne authored
Libc++ had an issue where nonsensical code like decltype(std::stringstream{} << std::vector<int>{}); would compile, as long as you kept the expression inside decltype in an unevaluated operand. This turned out to be that we didn't implement LWG1203, which clarifies what we should do in that case. rdar://58769296 -
Fangrui Song authored
-
Stefanos Baziotis authored
-
Reid Kleckner authored
This reverts commit 91aed9bf, it is causing link errors.
-
Stefanos Baziotis authored
Differential Revision: https://reviews.llvm.org/D82895
-
Congzhe Cao authored
When pairing ldr instructions to an ldp instruction, we cannot pair two ldr destination registers where one is a sub or super register of the other. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D86906
-
Mircea Trofin authored
This completes the circle, complementing -lto-embed-bitcode (specifically, post-merge-pre-opt). Using -thinlto-assume-merged skips function importing. The index file is still needed for the other data it contains. Differential Revision: https://reviews.llvm.org/D87949
-
David Tenty authored
This patch enables support for building compiler-rt builtins for 32-bit Power arch on AIX. For now, we leave out the specialized ppc builtin implementations for 128-bit long double and friends since those will need some special handling for AIX. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D87383
-
Fangrui Song authored
-
Paul C. Anagnostopoulos authored
One to fix a C++ compiler warning. One to allow Sphinx to find a new document.
-
Sriraman Tallam authored
Revert "The wrong placement of add pass with optimizations led to -funique-internal-linkage-names being disabled." This reverts commit 6950db36.
-
Michael Kruse authored
The Microsoft compiler seems to have difficulties to decide between a const/non-const method of a captured object context in a closure. The error message is: ``` symbol.cpp(261): error C2668: 'Fortran::semantics::Symbol::detailsIf': ambiguous call to overloaded function symbol.h(535): note: could be 'const D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void) const' symbol.h(534): note: or 'D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void)' symbol.cpp(261): note: while trying to match the argument list '()' ``` Explicitly using the this-pointer resolves this problem. This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>. Reviewed By: DavidTruby Differential Revision: https://reviews.llvm.org/D88052
-
Michael Kruse authored
Like in D87961, msvc has difficulties deducing the template argument. The error message is: ``` expr-parsers.cpp(383): error C2672: 'applyLambda': no matching overloaded function found ``` Explicitly pass the first template argument to help it. This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>. Reviewed By: DavidTruby Differential Revision: https://reviews.llvm.org/D88001
-
Michael Kruse authored
Msvc has difficulties deducing the template argument here. The error message is: ``` basic-parsers.h(790,12): error C2672: 'applyFunction': no matching overloaded function found ``` Explicitly pass the first template argument to help it. This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>. Reviewed By: DavidTruby Differential Revision: https://reviews.llvm.org/D87961
-
Raphael Isemann authored
This reverts commit 7518006d. This test apparently works on the Swift CI ubuntu bot, so it shouldn't be XFAIL'd on Linux.
-
Mehdi Amini authored
Instead of performing a transformation, such pass yields a new pass pipeline to run on the currently visited operation. This feature can be used for example to implement a sub-pipeline that would run only on an operation with specific attributes. Another example would be to compute a cost model and dynamic schedule a pipeline based on the result of this analysis. Discussion: https://llvm.discourse.group/t/rfc-dynamic-pass-pipeline/1637 Recommit after fixing an ASAN issue: the callback lambda needs to be allocated to a temporary to have its lifetime extended to the end of the current block instead of just the current call expression. Reviewed By: silvas Differential Revision: https://reviews.llvm.org/D86392
-
Roman Lebedev authored
This is practically identical to what we already do for UDiv/URem: https://rise4fun.com/Alive/04K Name: narrow udiv Pre: C0 u<= 255 && C1 u<= 255 %r = udiv i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = udiv i8 %t0, %t1 %r = zext i8 %t2 to i16 Name: narrow exact udiv Pre: C0 u<= 255 && C1 u<= 255 %r = udiv exact i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = udiv exact i8 %t0, %t1 %r = zext i8 %t2 to i16 Name: narrow urem Pre: C0 u<= 255 && C1 u<= 255 %r = urem i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = urem i8 %t0, %t1 %r = zext i8 %t2 to i16 ... only here we need to look for 'min signed bits', not 'active bits', and there's an UB to be aware of: https://rise4fun.com/Alive/KG86 https://rise4fun.com/Alive/LwR Name: narrow sdiv Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 %r = sdiv i16 C0, C1 => %t0 = trunc i16 C0 to i9 %t1 = trunc i16 C1 to i9 %t2 = sdiv i9 %t0, %t1 %r = sext i9 %t2 to i16 Name: narrow exact sdiv Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 %r = sdiv exact i16 C0, C1 => %t0 = trunc i16 C0 to i9 %t1 = trunc i16 C1 to i9 %t2 = sdiv exact i9 %t0, %t1 %r = sext i9 %t2 to i16 Name: narrow srem Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 %r = srem i16 C0, C1 => %t0 = trunc i16 C0 to i9 %t1 = trunc i16 C1 to i9 %t2 = srem i9 %t0, %t1 %r = sext i9 %t2 to i16 Name: narrow sdiv Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1) %r = sdiv i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = sdiv i8 %t0, %t1 %r = sext i8 %t2 to i16 Name: narrow exact sdiv Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1) %r = sdiv exact i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = sdiv exact i8 %t0, %t1 %r = sext i8 %t2 to i16 Name: narrow srem Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1) %r = srem i16 C0, C1 => %t0 = trunc i16 C0 to i8 %t1 = trunc i16 C1 to i8 %t2 = srem i8 %t0, %t1 %r = sext i8 %t2 to i16 The ConstantRangeTest.losslessSignedTruncationSignext test sanity-checks the logic, that we can losslessly truncate ConstantRange to `getMinSignedBits()` and signext it back, and it will be identical to the original CR. On vanilla llvm test-suite + RawSpeed, this fires 1262 times, while the same fold for UDiv/URem only fires 384 times. Sic! Additionally, this causes +606.18% (+1079) extra cases of aggressive-instcombine.NumDAGsReduced, and +473.14% (+1145) of aggressive-instcombine.NumInstrsReduced folds.
-
Roman Lebedev authored
-
Roman Lebedev authored
-
Roman Lebedev authored
Similar to the ConstantRange::getActiveBits(), and to similarly-named methods in APInt, returns the bitwidth needed to represent the given signed constant range
-
Roman Lebedev authored
This is fully identical to the old implementation, just easier to read.
-
Roman Lebedev authored
As an exhaustive test shows, this logic is fully identical to the old implementation, with exception of the case where both of the operands had empty ranges: ``` TEST_F(ConstantRangeTest, CVP_UDiv) { unsigned Bits = 4; EnumerateConstantRanges(Bits, [&](const ConstantRange &CR0) { if(CR0.isEmptySet()) return; EnumerateConstantRanges(Bits, [&](const ConstantRange &CR1) { if(CR0.isEmptySet()) return; unsigned MaxActiveBits = 0; for (const ConstantRange &CR : {CR0, CR1}) MaxActiveBits = std::max(MaxActiveBits, CR.getActiveBits()); ConstantRange OperandRange(Bits, /*isFullSet=*/false); for (const ConstantRange &CR : {CR0, CR1}) OperandRange = OperandRange.unionWith(CR); unsigned NewWidth = OperandRange.getUnsignedMax().getActiveBits(); EXPECT_EQ(MaxActiveBits, NewWidth) << CR0 << " " << CR1; }); }); } ``` -
Roman Lebedev authored
Much like APInt::getActiveBits(), computes how many bits are needed to be able to represent every value in this constant range, treating the values as unsigned.
-
Roman Lebedev authored
Use the fact that `~X` is equivalent to `-1 - X`, which gives us fully-precise answer, and we only need to special-handle the wrapped case. This fires ~16k times for vanilla llvm test-suite + RawSpeed.
-
Roman Lebedev authored
This is a continuation of 8d487668, the logic is pretty much identical for SRem: Name: pos pos Pre: C0 >= 0 && C1 >= 0 %r = srem i8 C0, C1 => %r = urem i8 C0, C1 Name: pos neg Pre: C0 >= 0 && C1 <= 0 %r = srem i8 C0, C1 => %r = urem i8 C0, -C1 Name: neg pos Pre: C0 <= 0 && C1 >= 0 %r = srem i8 C0, C1 => %t0 = urem i8 -C0, C1 %r = sub i8 0, %t0 Name: neg neg Pre: C0 <= 0 && C1 <= 0 %r = srem i8 C0, C1 => %t0 = urem i8 -C0, -C1 %r = sub i8 0, %t0 https://rise4fun.com/Alive/Vd6 Now, this new logic does not result in any new catches as of vanilla llvm test-suite + RawSpeed. but it should be virtually compile-time free, and it may be important to be consistent in their handling, because if we had a pair of sdiv-srem, and only converted one of them, -divrempairs will no longer see them as a pair, and thus not "merge" them.
-
Roman Lebedev authored
-
Arthur Eubanks authored
It tests CallGraph infra around the legacy PM which isn't relevant in NPM.
-
Arthur Eubanks authored
-
Jonas Devlieghere authored
The modules not getting orphaned is wreaking havoc when the UUIDs match between tests.
-
Jonas Devlieghere authored
This test launches a subprocess which will have a different PID during capture and replay.
-