- Jun 14, 2021
-
-
Jan Svoboda authored
The `clang-scan-deps` tool has some logic that parses and modifies the original Clang command-line. The goal is to setup `DependencyOutputOptions` by injecting `-M -MT <target>` and prevent the creation of output files. This patch moves the logic into the `DependencyScanning` library, and uses the parsed `CompilerInvocation` instead of the raw command-line. The code simpler and can be used from the C++ API as well. The `-o /dev/null` arguments are not necessary, since the `DependencyScanning` library only runs a preprocessing action, so there's no way it'll produce an actual object file. Related: The `-M` argument implies `-w`, which would appear on the command-line of modular dependencies even though it was not on the original TU command line (see D104036). Some related tests were updated. Reviewed By: arphaman Differential Revision: https://reviews.llvm.org/D104030
-
Jan Svoboda authored
[clang][deps] Move stripping of diagnostic serialization from `clang-scan-deps` to `DependencyScanning` library To prevent the creation of diagnostics file, `clang-scan-deps` strips the corresponding command-line argument. This behavior is useful even when using the C++ `DependencyScanner` library. This patch transforms stripping of command-line in `clang-scan-deps` into stripping of `CompilerInvocation` in `DependencyScanning`. AFAIK, the `clang-cl` driver doesn't even accept `--serialize-diagnostics`, so I've removed the test. (It would fail with an unknown command-line argument otherwise.) Note: Since we're generating command-lines for modular dependencies from `CompilerInvocation`, the `--serialize-diagnostics` will be dropped. This was already happening in `clang-scan-deps` before this patch, but it will now happen also when using `DependencyScanning` library directly. This is resolved in D104036. Reviewed By: dexonsmith, arphaman Differential Revision: https://reviews.llvm.org/D104012
-
Gabor Marton authored
Update `setConstraint` to simplify existing equivalence classes when a new constraint is added. In this patch we iterate over all existing equivalence classes and constraints and try to simplfy them with simplifySVal. This solves problematic cases where we have two symbols in the tree, e.g.: ``` int test_rhs_further_constrained(int x, int y) { if (x + y != 0) return 0; if (y != 0) return 0; clang_analyzer_eval(x + y == 0); // expected-warning{{TRUE}} clang_analyzer_eval(y == 0); // expected-warning{{TRUE}} return 0; } ``` Differential Revision: https://reviews.llvm.org/D103314 -
Jan Svoboda authored
When a translation unit uses a PCH and imports the same modules as the PCH, we'd prefer to resolve to those modules instead of inventing new modules and reporting them as modular dependencies. Since the PCH modules have already been built nudge the compiler to reuse them when deciding whether to build a new module and don't report them as regular modular dependencies. Depends on D103524 & D103802. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D103526
-
Haojian Wu authored
-
Diana Picus authored
Add an implementation for CPU_TIME using the POSIX function clock_gettime. I think on most POSIX systems this will be included for free via <ctime>, which corresponds to "time.h" (YMMV, we can fix the code if the need arises). Detecting that clock_gettime is available is tricky. For instance, commit 827407a8 used the following incantation in f18-parse-demo.cpp: #if _POSIX_C_SOURCE >= 199309L && _POSIX_TIMERS > 0 && _POSIX_CPUTIME && \ defined CLOCK_PROCESS_CPUTIME_ID This doesn't work on my AArch64 Ubuntu system, which provides clock_gettime but doesn't define _POSIX_TIMERS. Since finding the right combination of macros requires infinite time, patience and access to sundry POSIX systems, we should probably try a different approach. This patch attempts to use SFINAE instead of the preprocessor to choose an implementation for CPU_TIME. We define a helper function template which helps us check if clock_gettime is available (and has the interface we expect). I hope the comments explain it well enough. This approach has the advantage that it keeps the detection of clock_gettime close to the code that uses it. An alternative would be to use CMake to check for the symbol (I personally haven't used this before so I don't know if there are any quirks). Differential Revision: https://reviews.llvm.org/D104020
-
David Spickett authored
-
Guillaume Chatelet authored
This reverts commit e63f27a3.
-
Jan Svoboda authored
The `PreprocessOnlyAction` doesn't support loading the AST file of a precompiled header. This is problematic for dependency scanning, since the `#include` manufactured for the PCH is treated as textual. This means the PCH contents get scanned with each TU, which is redundant. Moreover, dependencies of the PCH end up being considered dependency of the TU. To handle AST file of PCH properly, this patch creates new `FrontendAction` that behaves the same way `PreprocessorOnlyAction` does, but treats the manufactured PCH `#include` as a normal compilation would (by not claiming it only uses a preprocessor and creating the default AST consumer). The AST file is now reported as a file dependency of the TU. Depends on D103519. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D103524
-
David Spickett authored
Completely forgot to actually update the change before relanding it. This adds the Darwin AVX changes.
-
David Spickett authored
This reverts commit db93e4e7. This modifies TestRegsters.py to account for Darwin showing AVX registers as part of "Floating Point Registers" instead of in a separate "Advanced Vector Extensions" category.
-
Jan Svoboda authored
It's useful to be able to load explicitly-built PCH files into an implicit build (e.g. during dependency scanning). That's currently impossible, since the explicitly-built PCH has an empty modules cache path, while the current compilation has (and needs to have) a valid path, triggering an error in the `PCHValidator`. This patch adds a preprocessor option and command-line flag that can be used to omit this check. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D103802
-
Guillaume Chatelet authored
Each of these elementary operations can be assembled to support higher order constructs (Overlapping access, Loop, Aligned Loop). The patch does not compile yet as it depends on other ones (D100571, D100631) but it allows to get the conversation started. Differential Revision: https://reviews.llvm.org/D100646
-
Jan Svoboda authored
This patch stops adjusting the frontend action when `clang-scan-deps` is configured to use the full output format. In a future patch, the dependency scanner needs to check whether the original compiler invocation builds a PCH. That's impossible when `-Eonly` et al. override `-emit-pch`. The `-Eonly` flag is not needed - the dependency scanner explicitly sets up its own frontend action anyways. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D103461
-
Guillaume Chatelet authored
There's no need for `toSmallVector()` as `SmallVector.h` already provides a `to_vector` free function that takes a range. Reviewed By: Quuxplusone Differential Revision: https://reviews.llvm.org/D104024
-
Diana Picus authored
Add an implementation for CPU_TIME based on std::clock(), which should be available on all the platforms that we support. Also add a test that's basically just a sanity check to make sure we return positive values and that the value returned at the start of some amount of work is larger than the one returned after the end. Differential Revision: https://reviews.llvm.org/D104019
-
Simon Moll authored
This patch implements vector-predicated intrinsics on IR level for fadd, fsub, fmul, fdiv and frem. There operate in the default floating-point environment. We will use constrained fp operand bundles for constrained vector-predicated fp math (D93455). Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D93470
-
Adrian Kuegel authored
Actually, no vector types are supported so far. We should add the traits once the vector types are supported (e.g. ElementwiseMappable.traits). Instead add Elementwise trait to each op. Differential Revision: https://reviews.llvm.org/D104103
-
Tobias Gysi authored
Up to now all structured op operands are assumed to be shaped. The patch relaxes this assumption and allows scalar input operands. In contrast to shaped operands scalar operands are not indexed and directly forwarded to the body of the operation. As all other operands, scalar operands are associated to an indexing map that in case of a scalar or a 0D-operand has an empty range. We will use scalar operands as a replacement for the capture mechanism. In contrast to captures, the approach ensures we can generate the function signature from the operand list and it prevents outdated capture values in case a transformation updates only the capture operand but not the hidden body of a named operation. Removing captures and updating existing operations such as linalg.fill is left for a later patch. The patch depends on https://reviews.llvm.org/D103891 and https://reviews.llvm.org/D103890. Differential Revision: https://reviews.llvm.org/D104109
-
Matthias Springer authored
The padding of such ops is not generated in a vectorized way. Instead, emit a tensor::GenerateOp. We may vectorize GenerateOps in the future. Differential Revision: https://reviews.llvm.org/D103879
-
Adrian Kuegel authored
Also add a conversion pattern from Complex to Standard/Math dialect. Differential Revision: https://reviews.llvm.org/D104108
-
Stephan Bergmann authored
At least LibreOffice has, for mainly historic reasons that would be hard to change now, a class Any with an overloaded operator >>= that semantically does not assign to the LHS but rather extracts into the (by-reference) RHS. Which thus caused false positive -Wunused-but-set-parameter and -Wunused-but-set-variable after those have been introduced recently. This change is more conservative about the assumed semantics of overloaded operators, excluding compound assignment operators but keeping plain operator = ones. At least for LibreOffice, that strikes a good balance of not producing false positives but still finding lots of true ones. (The change to the BinaryOperator case in MaybeDecrementCount is necessary because e.g. the template f4 test code in warn-unused-but-set-variables-cpp.cpp turns the += into a BinaryOperator.) Differential Revision: https://reviews.llvm.org/D103949
-
Mindong Chen authored
-
Matthias Springer authored
Vectorize linalg.pad_op source copying if source or result shape are static. Differential Revision: https://reviews.llvm.org/D103791
-
Matthias Springer authored
If the source operand of a linalg.pad_op operation has static shape, vectorize the copying of the source. Differential Revision: https://reviews.llvm.org/D103747
-
Matthias Springer authored
Currently limited to constant pad values. Any combination of dynamic/static tensor sizes and padding sizes is supported. Differential Revision: https://reviews.llvm.org/D103679
-
serge-sans-paille authored
So don't define __tune__k8__ for these micro architecture. SSE, SSE2 and SSE3 appear in https://www.amd.com/system/files/TechDocs/25112.PDF but not SSE4.x. Differential Revision: https://reviews.llvm.org/D104116
-
Xuanda Yang authored
The comment mentions deplibs should be removed in 4.0. Removing it in this patch. Reviewed By: compnerd, dexonsmith, lattner Differential Revision: https://reviews.llvm.org/D102763
-
Chris Lattner authored
These are testing for various verification failures, but have missing returns at the end of their function. Add the returns to focus the tests better.
-
Jez Ng authored
I *think* this is the fix, with the regression being introduced by D104199. Not 100% sure since MSAN isn't supported on my Mac machine, and it'll take some time to spin up a Linux box... will look at the buildbots for answers
-
RamNalamothu authored
Add support in MC/MIR for writing/parsing, and DebugInfo. This is part of the Extensions for Heterogeneous Debugging defined at https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html Specifically the CFI instructions implemented here are defined at https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html#cfa-definition-instructions Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D76877
-
Aditya Kumar authored
Differential Revision: https://reviews.llvm.org/D104202
-
Lang Hames authored
-
Matthias Springer authored
The generic vectorization pattern handles only those cases, where low and high padding is zero. This is already handled by a canonicalization pattern. Also add a new canonicalization test case to ensure that tensor cast ops are properly inserted. A more general vectorization pattern will be added in a subsequent commit. Differential Revision: https://reviews.llvm.org/D103590
-
Chris Lattner authored
This allows it to be default constructible, which makes sense given it ignores the operand.
-
Matthias Springer authored
Vectorize linalg.pad_tensor without generating a linalg.init_tensor when consumed by a transfer_write. Differential Revision: https://reviews.llvm.org/D103137
-
Matthias Springer authored
Vectorize linalg.pad_tensor without generating a linalg.init_tensor when consumed by a subtensor_insert. Differential Revision: https://reviews.llvm.org/D103780
-
Matthias Springer authored
Vectorize linalg.pad_tensor without generating a linalg.init_tensor when consumed by a transfer_read. Differential Revision: https://reviews.llvm.org/D103735
-
Matthias Springer authored
* Add a helper function that returns the constant padding value (if applicable). * Remove existing getConstantYieldValueFromBlock function, which does almost the same. * Adapted from D103243. Differential Revision: https://reviews.llvm.org/D104004
-
Juneyoung Lee authored
This patch adds missing keyword highlights for freeze and poison Reviewed By: MaskRay, porglezomp Differential Revision: https://reviews.llvm.org/D104017
-