- Apr 14, 2021
-
-
Hans Wennborg authored
Consider the following set of files: a.cc: #include "a.h" a.h: #ifndef A_H #define A_H #include "b.h" #include "c.h" // This gets "skipped". #endif b.h: #ifndef B_H #define B_H #include "c.h" #endif c.h: #ifndef C_H #define C_H void c(); #endif And the output of the -H option: $ clang -c -H a.cc . ./a.h .. ./b.h ... ./c.h Note that the include of c.h in a.h is not shown in the output (GCC does the same). This is because of the include guard optimization: clang knows c.h is covered by an include guard which is already defined, so when it sees the include in a.h, it skips it. The same would have happened if #pragma once were used instead of include guards. However, a.h *does* include c.h, and it may be useful to show that in the -H output. This patch adds a flag for doing that. Differential revision: https://reviews.llvm.org/D100480
-
Simon Pilgrim authored
-
Benjamin Kramer authored
This transformation is fundamentally broken when it comes to dominance, it just happened to work when the source of the memcpy can be moved into the place of the alloca. The bug shows up a lot more often since 077bff39 allows the source to be a switch. It would be possible to check dominance of the source and all its operands, but that seems very heavy for instcombine.
-
hsmahesha authored
Rename the name of "LDS lowering" pass from `amdgpu-disable-lower-module-lds` to `amdgpu-enable-lower-module-lds` as later is consistent and reads better. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D100441
-
Simon Pilgrim authored
In the fold SHUFFLE(BINOP(X,Y),BINOP(Z,W)) -> BINOP(SHUFFLE(X,Z),SHUFFLE(Y,W)), check if both X/Z AND Y/W have at least one merge-able shuffle in which case the total number of shuffle should still fall. Helps with instruction count regressions we saw while fixing PR48823
-
Simon Pilgrim authored
Only attempt to propagateIRFlags if we have both SelectInst - afaict we shouldn't have matched a min/max reduction without both SelectInst, but static analyzer doesn't know that.
-
Pablo Barrio authored
The existing BTI placement pass avoids inserting "BTI c" when the function has local linkage and is only directly called. However, even in this case, there is a (small) chance that the linker later adds a hunk with an indirect call to the function, e.g. if the function is placed in a separate section and moved far away from its callers. Make sure to add BTI for these functions too. Differential Revision: https://reviews.llvm.org/D99417
-
Hanhan Wang authored
Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D100452
-
LLVM GN Syncbot authored
-
Sjoerd Meijer authored
This refactors SCCP and creates a SCCPSolver interface and class so that it can be used by other passes and transformations. We will use this in D93838, which adds a function specialisation pass. This is based on an early version by Vinay Madhusudan. Differential Revision: https://reviews.llvm.org/D93762
-
Nico Weber authored
This should've been removed in D83530. Differential Revision: https://reviews.llvm.org/D100434
-
Erich Keane authored
ICC permits this, and after some extensive testing it looks like we can support this with very little trouble. We intentionally don't choose to do this with attribute-target (despite it likely working as well!) because GCC does not support that, and introducing said incompatibility doesn't seem worth it.
-
Sanjay Patel authored
Stepping through callstacks in the example from D99759 reveals this potential compile-time improvement. The savings come from avoiding ValueTracking's computing known bits if we have already dealt with special-case patterns. Further improvements in this direction seem possible. This makes a degenerate test based on PR49785 about 40x faster (25 sec -> 0.6 sec), but it does not address the larger question of how to limit computeKnownBitsFromAssume(). Ie, the original test there is still infinite-time for all practical purposes. Differential Revision: https://reviews.llvm.org/D100408
-
Sanjay Patel authored
This is pulled out of D100408. This avoids a regression that would be exposed by making the calling code from InstSimplify more efficient.
-
Sven van Haastregt authored
Reviewed-By: Anastasia Stulova
-
Hansang Bae authored
Also fixed typo in the verbose message. Differential Revision: https://reviews.llvm.org/D100414
-
Sebastian Neubauer authored
Otherwise it reuses the same register for storing the stack slot offset if the stack slot offset is big. Differential Revision: https://reviews.llvm.org/D100461
-
Sanjay Patel authored
The start value can't be null for something to be a non-zero recurrence, so hoist that common check out of the switch. Subsequent checks may be incomplete or over-specified as noted in: D100408
-
Max Kazantsev authored
-
Zarko Todorovski authored
Pull some of the safe for 32bit pattern matching for Pwr8 and above. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D97909
-
Martin Storsjö authored
These were added in 37935405, but they fail on macOS (and on Windows with MSYS based tools, before relanding D98859). Remove the tests that exercise "not not echo", as the primary thing to test is the plain echo patterns above.
-
Sanjay Patel authored
We call various value tracking APIs from within -instsimplify, so I don't think this is visible in a larger test.
-
Martin Storsjö authored
Aggregate types over 16 bytes are passed by reference. Contrary to the x86_64 ABI, smaller structs with an odd (non power of two) are padded and passed in registers. Differential Revision: https://reviews.llvm.org/D100374
-
David Spickett authored
By checking for cpu and toolchain features ahead of time we don't need the custom return codes. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D97684
-
Tim Northover authored
This direction is particularly useful because i16 constants are much more likely to be legal than bf16.
-
Martin Storsjö authored
After d5c5cf5c, it should work fine for aarch64 on COFF too. (It was disabled when the patch was (re)applied in e96df3e5, pending that fix.)
-
Roman Lebedev authored
After 077bff39, isDereferenceableForAllocaSize() can recurse into selects, which is causing a problem for the new test case, reduced from https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20210412/904154.html because the replacement (the select) is defined after the first use of an alloca, so we'd end up with a verifier error. Now, this new check is too restrictive. We likely can handle *some* cases, by trying to sink all uses of an alloca to after the the def.
-
Simon Pilgrim authored
Relax the fold from rGbaadbe04 to compare any op, not just logic ops, now that the movmsk regressions have been handled.
-
Simon Pilgrim authored
Use X64 for 64-bit targets and X86 for 32-bit targets
-
Simon Pilgrim authored
[X86][SSE] combineSetCCMOVMSK - allow comparison with upper (known zero) bits in MOVMSK(SHUFFLE(X,u)) -> MOVMSK(X) fold Extension to rG74f98391, we can also include any of the upper (known zero) bits in the comparison in the shuffle removal fold, just as long as we demand all the elements of the movmsk source vector.
-
Nemanja Ivanovic authored
-
Martin Storsjö authored
This avoids breaking clang-tidy/infrastructure/validate-check-names.cpp if 'not' is evaluated as a lit internal tool (making TestRunner invoke 'grep' directly in that test, instead of invoking 'not', which then invokes 'grep'). The quoting of arguments is still brittle if the executable is an MSYS based tool though, as MSYS based tools incorrectly unescape backslashes in quoted arguments (contrary to regular win32 argument parsing rules), see D99406 and https://github.com/msys2/msys2-runtime/issues/36 for more examples of the issues. Differential Revision: https://reviews.llvm.org/D99938
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D99574
-
Martin Storsjö authored
This fixes breakage on Windows/ARM64 after D94355. Modelled after the corresponding code for X86; not entirely familiar with those aspects of that layer otherwise. Differential Revision: https://reviews.llvm.org/D99572
-
Martin Storsjö authored
Also remove a superfluous semicolon after the braces for a switch statement (that wasn't warned about). Differential Revision: https://reviews.llvm.org/D100447
-
Liu, Chen3 authored
According to i386 System V ABI: 1. when __m256 are required to be passed on the stack, the stack pointer must be aligned on a 0 mod 32 byte boundary at the time of the call. 2. when __m512 are required to be passed on the stack, the stack pointer must be aligned on a 0 mod 64 byte boundary at the time of the call. The current method of clang passing __m512 parameter are as follow: 1. when target supports avx512, passing it with 64 byte alignment; 2. when target supports avx, passing it with 32 byte alignment; 3. Otherwise, passing it with 16 byte alignment. Passing __m256 parameter are as follow: 1. when target supports avx or avx512, passing it with 32 byte alignment; 2. Otherwise, passing it with 16 byte alignment. This pach will passing __m128/__m256/__m512 following i386 System V ABI and apply it to Linux only since other System V OS (e.g Darwin, PS4 and FreeBSD) don't want to spend any effort dealing with the ramifications of ABI breaks at present. Differential Revision: https://reviews.llvm.org/D78564
-
Balázs Kéri authored
-
Bogdan Graur authored
Differential Revision: https://reviews.llvm.org/D100451
-
Tres Popp authored
Differential Revision: https://reviews.llvm.org/D100390
-
LLVM GN Syncbot authored
-