- Aug 16, 2021
-
-
Fangrui Song authored
-
Sanjay Patel authored
This would assert/crash as shown in: https://llvm.org/PR50850 The matching for bcmp/bcopy should probably also be updated, but that's another patch.
-
David Blaikie authored
-
Craig Topper authored
We should only accept as vcmpeqsh. Same for all the other 31 comparison values.
-
Craig Topper authored
This allows commuting any immediate value. The previous code only commuted equality immediates. This was inherited from an earlier version of VCMPSSZrm/VCMPSDZrm.
-
David Blaikie authored
This ensures that debug_types references aren't looked for in debug_info section. Behavior is still going to be questionable in an unlinked object file - since cross-cu references could refer to symbols in another .debug_info (or, in theory, .debug_types) chunk - but if a producer only uses ref_addr to refer to things within the same .debug_info chunk in an object file (eg: whole program optimization/LTO - producing two CUs into a single .debug_info section in an object file - the ref_addrs there could be resolved relative to that .debug_info chunk, not needing to consider comdat (DWARFv5 type units or other creatures) chunks of .debug_info, etc)
-
Craig Topper authored
They were already added to findCommuteOpIndices, but they also need to be in X86InstrInfo::commuteInstructionImpl in order to adjust the immediate control.
-
Craig Topper authored
-
Sanjay Patel authored
memcmp is defined as taking a size_t length arg, so that differs depending on pointer size of the target. We casually matched non-compliant function signatures as memcmp, but that can cause crashing as seen with PR50850. If we fix that bug, these tests would no longer be testing the expected behavior for a 32-bit target, so I have duplicated all tests and adjusted them to match the stricter definition of memcmp/bcmp by changing the length arg to i32 on a 32-bit target.
-
Paul Walker authored
visitEXTRACT_SUBVECTOR can sometimes create illegal BITCASTs when removing "redundant" INSERT_SUBVECTOR operations. This patch adds an extra check to ensure such combines only occur after operation legalisation if any resulting BITBAST is itself legal. Differential Revision: https://reviews.llvm.org/D108086
-
Nico Weber authored
-
Kazu Hirata authored
The last use was removed on Apr 18, 2020 in commit aad3d578.
-
David Green authored
This adds a call to matchSAddSubSat from smin/smax instrinsics, allowing the same patterns to match if the canonical form of a min/max is an intrinsics, not a icmp/select. Differential Revision: https://reviews.llvm.org/D108077
-
Roman Lebedev authored
Reland [SimplifyCFG] performBranchToCommonDestFolding(): form block-closed SSA form before cloning instructions (PR51125) ... with test change this time. LLVM IR SSA form is "implicit" in `@pr51125`. While is a valid LLVM IR, and does not require any PHI nodes, that completely breaks the further logic in `CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses()` that updates the live-out uses of the bonus instructions. What i believe we need to do, is to first make the SSA form explicit, by inserting tautological PHI nodes, and rewriting the offending uses. ``` $ /builddirs/llvm-project/build-Clang12/bin/opt -load /repositories/alive2/build-Clang-release/tv/tv.so -load-pass-plugin /repositories/alive2/build-Clang-release/tv/tv.so -tv -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -bonus-inst-threshold=10 -tv -o /dev/null /tmp/test.ll ---------------------------------------- @global_pr51125 = global 4 bytes, align 4 define i32 @pr51125() { %entry: br label %L %L: %ld = load i32, * @global_pr51125, align 4 %iszero = icmp eq i32 %ld, 0 br i1 %iszero, label %exit, label %L2 %L2: store i32 4294967295, * @global_pr51125, align 4 %cmp = icmp eq i32 %ld, 4294967295 br i1 %cmp, label %L, label %exit %exit: %r = phi i32 [ %ld, %L2 ], [ %ld, %L ] ret i32 %r } => @global_pr51125 = global 4 bytes, align 4 define i32 @pr51125() { %entry: %ld.old = load i32, * @global_pr51125, align 4 %iszero.old = icmp eq i32 %ld.old, 0 br i1 %iszero.old, label %exit, label %L2 %L2: %ld2 = phi i32 [ %ld.old, %entry ], [ %ld, %L2 ] store i32 4294967295, * @global_pr51125, align 4 %cmp = icmp ne i32 %ld2, 4294967295 %ld = load i32, * @global_pr51125, align 4 %iszero = icmp eq i32 %ld, 0 %or.cond = select i1 %cmp, i1 1, i1 %iszero br i1 %or.cond, label %exit, label %L2 %exit: %ld1 = phi i32 [ poison, %L2 ], [ %ld.old, %entry ] %r = phi i32 [ %ld2, %L2 ], [ %ld.old, %entry ] ret i32 %r } Transformation seems to be correct! ``` Fixes https://bugs.llvm.org/show_bug.cgi?id=51125 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D106317 -
Roman Lebedev authored
Revert "[SimplifyCFG] performBranchToCommonDestFolding(): form block-closed SSA form before cloning instructions (PR51125)" Forgot to stage the test change. This reverts commit 78af5cb2.
-
Roman Lebedev authored
[SimplifyCFG] performBranchToCommonDestFolding(): form block-closed SSA form before cloning instructions (PR51125) LLVM IR SSA form is "implicit" in `@pr51125`. While is a valid LLVM IR, and does not require any PHI nodes, that completely breaks the further logic in `CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses()` that updates the live-out uses of the bonus instructions. What i believe we need to do, is to first make the SSA form explicit, by inserting tautological PHI nodes, and rewriting the offending uses. ``` $ /builddirs/llvm-project/build-Clang12/bin/opt -load /repositories/alive2/build-Clang-release/tv/tv.so -load-pass-plugin /repositories/alive2/build-Clang-release/tv/tv.so -tv -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -bonus-inst-threshold=10 -tv -o /dev/null /tmp/test.ll ---------------------------------------- @global_pr51125 = global 4 bytes, align 4 define i32 @pr51125() { %entry: br label %L %L: %ld = load i32, * @global_pr51125, align 4 %iszero = icmp eq i32 %ld, 0 br i1 %iszero, label %exit, label %L2 %L2: store i32 4294967295, * @global_pr51125, align 4 %cmp = icmp eq i32 %ld, 4294967295 br i1 %cmp, label %L, label %exit %exit: %r = phi i32 [ %ld, %L2 ], [ %ld, %L ] ret i32 %r } => @global_pr51125 = global 4 bytes, align 4 define i32 @pr51125() { %entry: %ld.old = load i32, * @global_pr51125, align 4 %iszero.old = icmp eq i32 %ld.old, 0 br i1 %iszero.old, label %exit, label %L2 %L2: %ld2 = phi i32 [ %ld.old, %entry ], [ %ld, %L2 ] store i32 4294967295, * @global_pr51125, align 4 %cmp = icmp ne i32 %ld2, 4294967295 %ld = load i32, * @global_pr51125, align 4 %iszero = icmp eq i32 %ld, 0 %or.cond = select i1 %cmp, i1 1, i1 %iszero br i1 %or.cond, label %exit, label %L2 %exit: %ld1 = phi i32 [ poison, %L2 ], [ %ld.old, %entry ] %r = phi i32 [ %ld2, %L2 ], [ %ld.old, %entry ] ret i32 %r } Transformation seems to be correct! ``` Fixes https://bugs.llvm.org/show_bug.cgi?id=51125 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D106317 -
Roman Lebedev authored
-
- Aug 15, 2021
-
-
Roman Lebedev authored
Currently/previously, while SCEV guaranteed that it produces the same value, the way it was produced may be illegal IR, so we have an ugly check that the replacement is valid. But now that the SCEV strictness wrt the pointer/integer types has been improved, i believe this invariant is already upheld by the SCEV itself, natively. I think we should add an assertion, wait for a week, and then, if all is good, rip out all this checking. Or we could just do the latter directly i guess. This reverts commit rL127839. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D108043
-
Nikita Popov authored
After recent changes, exit counts and BE taken counts are always integers, so convert these to assertions. While here, also convert the loop invariance checks to asserts. Exit counts are always loop invariant.
-
Qiu Chaofan authored
X86 overrided LowerOperationWrapper was moved to common implementation in a7eae62a.
-
Nikita Popov authored
std::errc::operation_not_supported is not universally supported. Make use of LLVM's errc interoperability header, which lists known-good errc values.
-
Harald van Dijk authored
libgcc and libunwind have different flavours of __register_frame. Both flavours are already correctly handled, except that the code to handle the libunwind flavour is guarded by __APPLE__. This change uses the presence of __unw_add_dynamic_fde in libunwind instead to detect whether libunwind is used, rather than hardcoding it as Apple vs. non-Apple. Fixes PR44074. Thanks to Albert Jin <albert.jin@gmail.com> and Chris Schafmeister <chris.schaf@verizon.net> for identifying the problem. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D106129
-
Dávid Bolvanský authored
-Wbool-operation was moved to -Wall and test file needs to be adjusted.
-
Dávid Bolvanský authored
To keep compatibility with GCC.
-
Paul Walker authored
[LoopVectorize] Don't emit remarks about lack of scalable vectors unless they're specifically requested. Previously we emitted a "does not support scalable vectors" remark for all targets whenever vectorisation is attempted. This pollutes the output for architectures that don't support scalable vectors and is likely confusing to the user. Instead this patch introduces a debug message that reports when scalable vectorisation is allowed by the target and only issues the previous remark when scalable vectorisation is specifically requested, for example: #pragma clang loop vectorize_width(2, scalable) Differential Revision: https://reviews.llvm.org/D108028
-
Nikita Popov authored
This is a non-intrusive fix for https://bugs.llvm.org/show_bug.cgi?id=51476 intended for backport to the 13.x release branch. It expands on the current hack by distinguishing between CmpValue of 0, 1 and 2, where 0 and 1 have the obvious meaning and 2 means "anything else". The new optimization from D98564 should only be performed for CmpValue of 0 or 1. For main, I think we should switch the analyzeCompare() and optimizeCompare() APIs to use int64_t instead of int, which is in line with MachineOperand's notion of an immediate, and avoids this problem altogether. Differential Revision: https://reviews.llvm.org/D108076
-
Dávid Bolvanský authored
This reverts commit 43578521. Still same compile time issues for -O0 -g, eg. +1.3% for sqlite3.
-
Andrzej Warzynski authored
`CompilerInstance` is a more appropriate place for a key component of the frontend like `Semantics`. This change opens a path for us to introduce new frontend actions that will also run semantics, but for which inheriting from `PrescanAndSemaAction` wouldn't make much sense. For example, for code-gen actions we plan to introduce a dedicate hierarchy of action classes. I've also added a doxyment for `CompilerInstance` to add a bit of context for this change (and also make future refactoring more informed). As `CompilerInstance` in Flang has been inspired by its counterpart in Clang, this comment is roughly a verbatim copy of the comment in Clang (with some adjustments from me). Credits to Daniel Dunbar for the great design and the original comment. Differential Revision: https://reviews.llvm.org/D108035
-
Rainer Orth authored
`Posix/unpoison-alternate-stack.cpp` currently `XPASS`es on Solaris. The `XFAIL` had already been removed in D97933 <https://reviews.llvm.org/D97933>, but reintroduced by commit f03d2960 <https://reviews.llvm.org/rGf03d29601e0951da2c88f07d4234128e14e87870> which was never posted or justified. Given the `XPASS`, this obviously wasn't NFC, so I suggest to remove it again. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`. Differential Revision: https://reviews.llvm.org/D108030
-
Anshil Gandhi authored
Implements ORE in AtomicExpand pass to report atomics generating a compare and swap loop. Differential Revision: https://reviews.llvm.org/D106891
-
Itay Bookstein authored
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107988
-
Vitaly Buka authored
-
Vitaly Buka authored
-
Craig Topper authored
Fixes PR51324.
-
Dmitry Vyukov authored
Currently we only support %z and %ll width modifiers, but surprisingly not %l. This makes it impossible to print longs (sizeof(long) not necessary equal to sizeof(size_t)). We had some printf's that printed longs with %zu, but that's wrong and now with __attribute__((format)) in place they are flagged by compiler. So we either have a choice of doing static_cast<uptr>(long) everywhere or add %l. Adding %l looks better, that's a standard modifier. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D108066
-
Wang, Pengfei authored
Enable FP16 binary operator instructions. Ref.: https://software.intel.com/content/www/us/en/develop/download/intel-avx512-fp16-architecture-specification.html Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D105264
-
Vitaly Buka authored
This makes it consistent with uintptr_t.
-
Vitaly Buka authored
-
Craig Topper authored
Previously we just used {}, but that doesn't work in situations like this. if (1) _MM_EXTRACT_FLOAT(d, x, n); else ... The semicolon would terminate the if. -
Craig Topper authored
-