- Mar 31, 2021
-
-
Sanjay Patel authored
The structure of this fold is suspect vs. most of instcombine because it creates instructions and tries to delete them immediately after. If we don't have the operand types for the icmps, then we are not behaving as assumed. And as shown in PR49475, we can inf-loop. (cherry picked from commit 4224a369)
-
Sanjay Patel authored
PR49475 shows an infinite loop outcome, but this tries to show the root cause with a minimal test. (cherry picked from commit 579b8fc2)
-
Nikita Popov authored
If the successor block has a phi node, then additional moves may be inserted into predecessors, which may clobber eflags. Don't try to fold the with.overflow result into the branch in that case. This is done by explicitly checking for any phis in successor blocks, not sure if there's some more principled way to address this. Other fused compare and branch patterns avoid the issue by emitting the comparison when handling the branch, so that no instructions may be inserted in between. In this case, the with.overflow call is emitted separately (and I don't think this is avoidable, as it will generally have at least two users). Fixes https://bugs.llvm.org/show_bug.cgi?id=49587. Differential Revision: https://reviews.llvm.org/D98600 (cherry picked from commit 7669455d)
-
Nikita Popov authored
Shows a miscompile with FastISel. (cherry picked from commit 0d814ca0)
-
- Mar 30, 2021
-
-
Nikita Popov authored
All extractvalues of the same value at the same index will map to the same register, so even if one specific extractvalue only has one use, we should not mark it as a trivial kill, as there may be more extractvalues later. Fixes https://bugs.llvm.org/show_bug.cgi?id=49467. Differential Revision: https://reviews.llvm.org/D98145 (cherry picked from commit 55ae279b)
-
Joseph Huber authored
Summary: The changes introduced in D87946 changed the API for libomptarget functions. `__kmpc_push_target_tripcount` was a function in Clang 11.x but was not given a backward-compatible interface. This change will require people using Clang 13.x or 12.x to recompile their offloading programs. Reviewed By: jdoerfert cchen Differential Revision: https://reviews.llvm.org/D98358 (cherry picked from commit 807466ef)
-
Nikita Popov authored
If we encounter a degenerate select node where both operands are the same, then we can continue negating the condition while swapping operands, resulting in an infinite loop. Avoid this by bailing out if both operands are the same. Fixes https://bugs.llvm.org/show_bug.cgi?id=49509. Differential Revision: https://reviews.llvm.org/D98340 (cherry picked from commit 2489cbaa)
-
Shilei Tian authored
It is reported that after enabling hidden helper thread, the program can hit the assertion `new_gtid < __kmp_threads_capacity` sometimes. The root cause is explained as follows. Let's say the default `__kmp_threads_capacity` is `N`. If hidden helper thread is enabled, `__kmp_threads_capacity` will be offset to `N+8` by default. If the number of threads we need exceeds `N+8`, e.g. via `num_threads` clause, we need to expand `__kmp_threads`. In `__kmp_expand_threads`, the expansion starts from `__kmp_threads_capacity`, and repeatedly doubling it until the new capacity meets the requirement. Let's assume the new requirement is `Y`. If `Y` happens to meet the constraint `(N+8)*2^X=Y` where `X` is the number of iterations, the new capacity is not enough because we have 8 slots for hidden helper threads. Here is an example. ``` #include <vector> int main(int argc, char *argv[]) { constexpr const size_t N = 1344; std::vector<int> data(N); #pragma omp parallel for for (unsigned i = 0; i < N; ++i) { data[i] = i; } #pragma omp parallel for num_threads(N) for (unsigned i = 0; i < N; ++i) { data[i] += i; } return 0; } ``` My CPU is 20C40T, then `__kmp_threads_capacity` is 160. After offset, `__kmp_threads_capacity` becomes 168. `1344 = (160+8)*2^3`, then the assertions hit. Reviewed By: protze.joachim Differential Revision: https://reviews.llvm.org/D98838 (cherry picked from commit 2df65f87) -
Sanjay Patel authored
The test is reduced from a C source example in: https://llvm.org/PR49541 It's possible that the test could be reduced further or the predicate generalized further, but it seems to require a few ingredients (including the "late" SimplifyCFG options on the RUN line) to fall into the infinite-loop trap. (cherry picked from commit bd197ed0)
-
Alexandre Ganea authored
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: https://github.com/rust-lang/rust/issues/81051 since 79657e23, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive. (cherry picked from commit 64ab2b68)
-
- Mar 20, 2021
-
-
Maxim Kuvyrkov authored
At the moment "link.exe" is hard-coded as default linker in MSVC.cpp, so there's no way to use LLD as default linker for MSVC driver. This patch adds checking of CLANG_DEFAULT_LINKER to MSVC.cpp and updates unit-tests that expect link.exe linker to explicitly select it via -fuse-ld=link, so that buildbots and other builds that set -DCLANG_DEFAULT_LINKER=foobar don't fail these tests. This is a squash of - https://reviews.llvm.org/D98493 (MSVC.cpp change) and - https://reviews.llvm.org/D98862 (unit-tests change) Fixes https://bugs.llvm.org/show_bug.cgi?id=49624 Reviewed By: maxim-kuvyrkov Differential Revision: https://reviews.llvm.org/D98935 (cherry-picked from commit 2049fe58)
-
- Mar 19, 2021
-
-
Maxim Kuvyrkov authored
Reviewed By: peterwaller-arm Differential Revision: https://reviews.llvm.org/D98415
-
- Mar 16, 2021
-
-
Anastasia Stulova authored
Differential Revision: https://reviews.llvm.org/D98076
-
- Mar 13, 2021
-
-
Amilendra Kodithuwakku authored
Add new-line before sub-list for proper rendering. Differential Revision: https://reviews.llvm.org/D98277
-
Amilendra Kodithuwakku authored
Reviewed By: kristof.beyls Differential Revision: https://reviews.llvm.org/D98277
-
- Mar 09, 2021
-
-
Raul Tambre authored
As reported in D93278 post-review symlinking requires privilege escalation on Windows. Copying is functionally same, so fallback to it for systems that aren't Unix-like. This is similar to the solution in AddLLVM.cmake. Reviewed By: ikudrin Differential Revision: https://reviews.llvm.org/D98111 (cherry picked from commit ba860963)
-
Craig Topper authored
[TargetLowering] Use HandleSDNodes to prevent nodes from being deleted by recursive calls in getNegatedExpression. For binary or ternary ops we call getNegatedExpression multiple times and then compare costs. While we're doing this we need to hold a node from the first call across the second call, but its not yet attached to the DAG. Its possible the second call creates an identical node and then decides it didn't need it so will try to delete it if it has no uses. This can cause a reference to the node we're holding further up the call stack to become invalidated. To prevent this, we can use a HandleSDNode to artifically give the node a use without connecting it to the DAG. I've used a std::list of HandleSDNodes so we can create handles only when we have a node to hold. HandleSDNode does not have default constructor and cannot be copied or moved. Fixes PR49393. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D97914 (cherry picked from commit 74e6030b)
-
Juneyoung Lee authored
This patch fixes pr48832 by correctly generating the mask when a poison value is involved. Consider this CFG (which is a part of the input): ``` for.body: ; preds = %for.cond br i1 true, label %cond.false, label %land.rhs land.rhs: ; preds = %for.body br i1 poison, label %cond.end, label %cond.false cond.false: ; preds = %for.body, %land.rhs br label %cond.end cond.end: ; preds = %land.rhs, %cond.false %cond = phi i32 [ 0, %cond.false ], [ 1, %land.rhs ] ``` The path for.body -> land.rhs -> cond.end should be taken when 'select i1 false, i1 poison, i1 false' holds (which means it's never taken); but VPRecipeBuilder::createEdgeMask was emitting 'and i1 false, poison' instead. The former one successfully blocks poison propagation whereas the latter one doesn't, making the condition poison and thus causing the miscompilation. SimplifyCFG has a similar bug (which didn't expose a real-world bug yet), and a patch for this is also ongoing (see https://reviews.llvm.org/D95026). Reviewed By: bjope Differential Revision: https://reviews.llvm.org/D95217 (cherry picked from commit ed253ef7)
-
Nathan James authored
... For removal in next release cycle. The clang warning that does the same thing is enabled by default and typically emits better diagnostics making this check surplus to requirements. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97491 (cherry picked from commit 19aefd2d)
-
LemonBoy authored
Expand the horizontal reduction during the instruction selection phase, but only if the target doesn't support the full fp16 instruction set. Fixes https://bugs.llvm.org/show_bug.cgi?id=49401 Reviewed By: aemerson Differential Revision: https://reviews.llvm.org/D97840 (cherry picked from commit 8725b24c)
-
- Mar 06, 2021
-
-
Shilei Tian authored
PR#49334 reports a crash when offloading to x86_64 with `target nowait`, which is caused by referencing a nullptr. The root cause of the issue is, when pushing a hidden helper task in `__kmp_push_task`, it also maps the gtid to its shadow gtid, which is wrong. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D97329 (cherry picked from commit e5da63d5)
-
Nikita Popov authored
The current narrowing code for G_PHI can only handle the case where the size is a multiple of the narrow size. If this is not the case, fall back to SDAG instead of asserting. Original patch by shepmaster. Differential Revision: https://reviews.llvm.org/D92446 (cherry picked from commit c35761db)
-
Peyton, Jonathan L authored
Fix for https://bugs.llvm.org/show_bug.cgi?id=49339 The CMake check for the RTM intrinsics needs the -mrtm flag to be set during the test. This way clang-cl correctly detects it has the _xbegin() intrinsic. Otherwise, the CMake check fails. Differential Revision: https://reviews.llvm.org/D97413 (cherry picked from commit e83380fc)
-
- Mar 04, 2021
-
-
Kirstóf Umann authored
Differential Revision: https://reviews.llvm.org/D96163
-
- Mar 03, 2021
-
-
Craig Topper authored
[DAGCombiner][X86] Don't peek through ANDs on the shift amount in matchRotateSub when called from MatchFunnelPosNeg. Peeking through AND is only valid if the input to both shifts is the same. If the inputs are different, then the original pattern ORs the two values when the masked shift amount is 0. This is ok if the values are the same since the OR would be a NOP which is why its ok for rotate. Fixes PR49365 and reverts PR34641 Differential Revision: https://reviews.llvm.org/D97637 (cherry picked from commit 5de09ef0)
-
Richard Smith authored
Some of the parts of this work were reverted; stop defining the feature test macro for now. This reverts commit b4c63ef6. (cherry picked from commit 564f5b07)
-
Sanjay Patel authored
In the example based on: https://llvm.org/PR49218 ...we are crashing because poison is a subclass of undef, so we merge blocks and create: PHI node has multiple entries for the same basic block with different incoming values! %k3 = phi i64 [ poison, %entry ], [ %k3, %g ], [ undef, %entry ] If both poison and undef values are incoming, we soften the poison values to undef. Differential Revision: https://reviews.llvm.org/D97495 (cherry picked from commit 356cdabd)
-
Sanjay Patel authored
https://llvm.org/PR49205 (cherry picked from commit 9502061b)
-
Shilei Tian authored
[OpenMP][NVPTX] Fixed a compilation error in deviceRTLs caused by unsupported feature in release verion of LLVM `ptx71` is not supported in release version of LLVM yet. As a result, the support of CUDA 11.2 and CUDA 11.1 caused a compilation error as mentioned in D97004. Since the support in D97004 is just a WA for releease, and we'll not use it in the near future, using `ptx70` for CUDA 11 is feasible. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D97195 (cherry picked from commit f6c2984a)
-
- Mar 02, 2021
-
-
Pavel Iliin authored
Description for AArch64 -moutline-atomics, -mno-outline-atomics options added to release notes. Differential Revision: https://reviews.llvm.org/D97510
-
- Feb 25, 2021
-
-
Fangrui Song authored
Differential Revision: https://reviews.llvm.org/D97113
-
- Feb 24, 2021
-
-
Louis Dionne authored
(cherry picked from commit bf5941af)
-
Louis Dionne authored
See https://reviews.llvm.org/D94718#2521489 for details. (cherry picked from commit 90407b16)
-
Nikita Popov authored
-
Andy Kaylor authored
The llvm.ptr.annotation and llvm.var.annotation intrinsics were changed since the 11.0 release to add an additional parameter. This patch auto-upgrades IR containing the four-parameter versions of these intrinsics, adding a null pointer as the fifth argument. Differential Revision: https://reviews.llvm.org/D95993 (cherry picked from commit 9a827906)
-
Tom Stellard authored
See bug https://bugs.llvm.org/show_bug.cgi?id=49227. The cherry-pick 0d4f8a3f364f introduced a test failure, as the test included use of a feature that was only recently added to lit and isn't in the release branch. This patch fixes up the test to manage without this lit change. Reviewed By: tstellar, MaskRay Differential Revision: https://reviews.llvm.org/D97272
-
- Feb 23, 2021
-
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D96950
-
Kadir Cetinkaya authored
Fixes https://github.com/clangd/clangd/issues/676. Differential Revision: https://reviews.llvm.org/D95935
-
Tom Stellard authored
This reverts commit e3df9471. This commit caused regressions in coverage generation for both Rust and Swift. We're reverting this in the release/12.x branch until we have a proper fix in trunk. http://llvm.org/PR49297
-
Nikita Popov authored
When cloning instructions during jump threading, also clone and adapt any declared scopes. This is primarily important when threading loop exits, because we'll end up with two dominating scope declarations in that case (at least after additional loop rotation). This addresses a loose thread from https://reviews.llvm.org/rG2556b413a7b8#975012. Differential Revision: https://reviews.llvm.org/D97154 (cherry picked from commit 5e7e499b)
-