- Jan 17, 2024
-
-
Craig Hesling authored
This enables the libclang python binding test to check the oldest version of Python supported in addition to the normal python version. It is important to check this for issue #76664, since many new mainstream python type annotation features and best practices are not compatible with older versions of python. Additionally, frustration around ever increasing platform dependencies and versions has been raised. This will help ensure that python maintains reasonable backwards compatibility. Adding this additional build step will increase the run time, but this should always be minimal, since the additional libclang compilation should see 100% cache hit rate. Issue #76664. Fixes #76601.
-
Craig Hesling authored
Remove Python 2 support and clean up code that conditions based on version. Issue #76664.
-
Nikita Popov authored
We currently require that all referenced globals have an explicit declaration or definition in the IR. For intrinsics, this requirement is redundant, because they cannot be called indirectly (including "direct" calls with mismatched function type). The function type used in the call directly determines the function type of the intrinsic declaration. Relax this requirement, and implicitly declare any intrinsics that do not have an explicit declaration. This will remove a common annoyance when writing tests and alive2 proofs. (I also plan to introduce a mode where declarations for all missing symbols will be automatically added, to make working with incomplete IR easier -- but that will be behind a default-disabled flag.)
-
Nikita Popov authored
Add a debug counter that allows forcing an sdag fallback after a certain number of functions. The intended use-case is to bisect which function gets miscompiled by global isel using `-debug-counter=globalisel-count=N` (in cases where sdag doesn't also miscompile it, of course). The "falling back" debug line is printed unconditionally, because using `-debug-only` is usually too spammy for the intended purpose.
-
Nikita Popov authored
Add a debug counter for DAGCombine. This can help with bisecting which DAG combine introduced a miscompile.
-
Nikita Popov authored
BasicAA currently says that any Constant cannot alias an identified local object. This is not correct if the local object escaped, as it's possible to create a pointer to the escaped object using an inttoptr constant expression base. To compensate for this, make sure that inttoptr constant expressions are treated as escape sources, just like inttoptr instructions. This ensures that the optimization can still be applied if the local object is non-escaping. This is sufficient to still optimize the original motivating case from c53e2ecf. Fixes https://github.com/llvm/llvm-project/issues/76789.
-
Dávid Ferenc Szabó authored
…tructions into account Hint instructions like G_ASSERT_ZEXT cann be viewed as a copy. Including this fact into the combiner allows the match more patterns involving such instructions.
-
Alex Bradbury authored
The fmv can be removed through appropriate logic in RISCVInstrInfo::foldMemoryOperandImpl.
-
Jason Molenda authored
In https://reviews.llvm.org/D151292 I added the ability to track address masks separately for high and low memory addresses, a capability of AArch64. I did my testing with manual address mask settings (via target.process.highmem-virtual-addressable-bits) but didn't have a real corefile that included this metadata and required it. My intention is that when the high address mask isn't specified, by the user (via the setting) or the Process plugin, we fall back to using the low address mask. The low and high address mask is the same for almost all environments. But the patch I wrote never uses the Process plugin high address mask if it was set, e.g. from corefile metadata. This patch corrects that. I also have an old patch in Phabractor that was approved to add FixAddress methods to SBProcess; I need to pick that patch up and finish it (I wanted to add an enum to specify which mask is being requested iirc), so I can do address masks tests in API tests. rdar://120926000
-
Luke Lau authored
This illustrates #78352. There are other tests for gathers/scatters and masked load/stores which likely have the same issue, but I've left them out for now since they don't seem to be affected by fixing RISCVTTIImpl::getMemoryOpCost.
-
Fangrui Song authored
Printing the raw symbol is useful in inline asm (e.g. getting the C++ mangled name, referencing a symbol in a custom way while ensuring it is not optimized out even if internal). Similar constraints are available in other targets (e.g. "S" for aarch64/riscv, "Cs" for m68k). ``` namespace ns { extern int var, a[4]; } void foo() { asm(".pushsection .xxx,\"aw\"; .dc.a %p0; .popsection" :: "Ws"(&ns::var)); asm(".reloc ., BFD_RELOC_NONE, %p0" :: "Ws"(&ns::a[3])); } ``` Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105576 -
Tacet authored
This commit simplifies ASan helper functions in `std::vector` by removing arguments which can be calculated later. Short term it improves readability of helper functions in `std::vector`. Long term it aims to help with a bigger refactor of container annotations.
-
Mark de Wever authored
As suggested in #71438 we should use export import std; in the std.compat module. Using this exports some named declarations from functions and records, adding them to the global namespace. Clang correctly does not export these and it's an issue in the declaration filtering. Declarations in function or record context are not considered a global named declaration.
-
Mark de Wever authored
Clang-tidy 18 no longer has false positives with the spaceship operator. Note that I'm quite sure there are more occurrences in our headers that are not caught.
-
Mark de Wever authored
As suggested in #71438 we should use export import std; in the std.compat module. Testing this locally failed when building with the clang-tidy-17 plugin. The std module was considered corrupt in the test libcxx/test/libcxx/module_std_compat.gen.py however the test libcxx/test/libcxx/module_std.gen.py passed. Both test generated identical std.pcm files. Using the clang-tidy-18 plugin solves the issue.
-
Mark de Wever authored
This adds a new module test infrastructure. This requires tagging tests using modules. The test runner uses this information to determine the compiler flags needed to build and use the module. Currently modules are build per test, which allows testing them for tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use modules. Therefore the performance penalty is not measurable. If in the future more tests use modules it would be good to measure the overhead and determine whether it's acceptable.
-
Mark de Wever authored
This removes the entire modules testing infrastructure. The current infrastructure uses CMake to generate the std and std.compat module. This requires quite a bit of plumbing and uses CMake. Since CMake introduced module support in CMake 3.26, modules have a higher CMake requirement than the rest of the LLVM project. (The LLVM project requires 3.20.) The main motivation for this approach was how libc++ generated its modules. Every header had its own module partition. This was changed to improve performance and now only two modules remain. The code to build these can be manually crafted. A followup patch will reenable testing modules, using a different approach.
-
Aviad Cohen authored
-
Robin Caloudis authored
## Why The documentation is written relatively to `clang-llvm`, not the root repository directory. However, some steps in the documentation are relative to the repository root, which is not correct. ## What Documentation steps have been modified to make them correct and outdated ones were updated. Some details: * Correct paths in documentation * Change `bootstrap.py` -> `configure.py` since bootstraping Ninja has [slightly changed](https://github.com/ninja-build/ninja/tree/master?tab=readme-ov-file#python)
-
Luke Lau authored
This patch reworks RISCVTargetInfo::initFeatureMap to fix the issue described in https://github.com/llvm/llvm-project/pull/74889#pullrequestreview-1773445559 (and is an alternative to #75804) When a full arch string is specified, a "full" list of extensions is now passed after the __RISCV_TargetAttrNeedOverride marker feature, which includes any negative features that disable ISA extensions. In initFeatureMap, there are now two code paths: 1. If the arch string was overriden, use the "full" list of override features, only adding back any non-isa features that were specified. Using the full list of positive and negative features will mean that the target-cpu will have no effect on the final arch, e.g. __attribute__((target("arch=rv64i"))) with -mcpu=sifive-x280 will have the features for rv64i, not a mix of both. 2. Otherwise, parse and *append* the list of implied features. By appending, we turn back on any features that might have been disabled by a negative extension, i.e. this handles the case fixed in #74889.
-
Craig Topper authored
Since we're creating target specific instructions, I think we should be creating registers with the GPR register class.
-
Danila Malyutin authored
Return true iff all of vector elements are constant AND not zero Fixes #77805 Previously, it'd return `true` (as in - the value is known to be never zero) for any build_vector/splat_vector with non-constant elements.
-
Fangrui Song authored
Similar to 806761a7. For IR files without a target triple, -mtriple= specifies the full target triple while -march= merely sets the architecture part of the default target triple, leaving a target triple which may not make sense, e.g. amdgpu-apple-darwin. Therefore, -march= is error-prone and not recommended for tests without a target triple. The issue has been benign as we recognize $unknown-apple-darwin as ELF instead of rejecting it outrightly. This patch changes AMDGPU tests to not rely on the default OS/environment components. Tests that need fixes are not changed: ``` LLVM :: CodeGen/AMDGPU/fabs.f64.ll LLVM :: CodeGen/AMDGPU/fabs.ll LLVM :: CodeGen/AMDGPU/floor.ll LLVM :: CodeGen/AMDGPU/fneg-fabs.f64.ll LLVM :: CodeGen/AMDGPU/fneg-fabs.ll LLVM :: CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll LLVM :: CodeGen/AMDGPU/schedule-if-2.ll ```
-
Jonas Devlieghere authored
I have my editor configured to remove trailing whitespace and every time I touch this file I end up with a bunch of clang-format changes to lines that were modified because of it. Nobody likes trailing whitespace so this cleans up the file.
-
Jonas Devlieghere authored
Store a SupportFile, rather than a FileSpec, in CompileUnit. This commit works towards having the SourceManager operate on SupportFiles so that it can (1) validate the Checksum and (2) materialize the content of inline source information.
-
cor3ntin authored
A union is considered a literal type unless it has no non-literal member. This resolves CWG2096 (which makes unions with literal members literal) and CWG2598 (empty unions are literal types). Fixes #77924
-
Jonas Devlieghere authored
Store a SupportFile, rather than a FileSpec, in LineEntry. This commit works towards having the SourceManageroperate on SupportFiles so that it can (1) validate the Checksum and (2) materialize the content of inline source information.
-
h-vetinari authored
The UserManual states wrongly (AFAICT) that these default are not being defined for clang-cl, whereas further up the opposite is stated: https://github.com/llvm/llvm-project/blob/c86fe3ee0b92934f5d18394d9a0cdc1d3f0eef64/clang/docs/UsersManual.rst#L3375-L3382 I've chosen to follow that wording, as it's the latest related update. CC @RIscRIpt who recently touched this in b3e6ff33 CC @AaronBallman who cared about this, c.f. 8fc0dcf0
-
YunQiang Su authored
Currently, almost all of the shared libraries of MIPS, rely on $t9 to get the address of current function, instead of PCREL instructions, even on MIPSr6. So we have to set $t9 properly. To get the address of preemptible function, we need the help of GOT. MIPS/O32 has .cpload, which can help to generate 3 instructions to get GOT. For __mips64, we can get GOT by: lui $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func))))) daddu $t8, $t8, $t9 daddiu $t8, $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func))))) And then get the address of __interceptor_func, and jump to it ld $t9, %got_disp(_interceptor" SANITIZER_STRINGIFY(func) ")($t8) jr $t9 Fixes #74047 Co-authored-by:YunQiang Su <yunqiang.su@cipunited.com>
-
Pranav Kant authored
as it started failing after https://github.com/llvm/llvm-project/commit/8e514c572e44eda237417236b4c92176dfce9cd9 Above commit enables llvm::DebugFlag which is a global variable.
-
Phoebe Wang authored
Fixes #77172
-
Ami-zhang authored
LoongArch V1.1 instrucions include floating-point approximate reciprocal instructions and atomic instrucions. And add testcases for these instrucions meanwhile.
-
Jacques Pienaar authored
Add overflow flags support to the following ops: * `arith.addi` * `arith.subi` * `arith.muli` Example of new syntax: ``` %res = arith.addi %arg1, %arg2 overflow<nsw> : i64 ``` Similar to existing LLVM dialect syntax ``` %res = llvm.add %arg1, %arg2 overflow<nsw> : i64 ``` Tablegen canonicalization patterns updated to always drop flags, proper support with tests will be added later. Updated LLVMIR translation as part of this commit as it currenly written in a way that it will crash when new attributes added to arith ops otherwise. Also lower `arith` overflow flags to corresponding SPIR-V op decorations Discussion https://discourse.llvm.org/t/rfc-integer-overflow-flags-support-in-arith-dialect/76025 This effectively rolls forward #77211, #77700 and #77714 while adding a test to ensure the Python usage is not broken. More follow up needed but unrelated to the core change here. The changes here are minimal and just correspond to "textual namespacing" ODS side, no C++ or Python changes were needed. --------- --------- Co-authored-by:
Ivan Butygin <ivan.butygin@gmail.com>, Yi Wu <yi.wu2@arm.com>
-
Phoebe Wang authored
-
antangelo authored
Emits an error for friend FunctionDecls that either: * are not templates and have a requires clause * are templates, and have a constrained parameter that depends on a template parameter from an enclosing template and are not a definition. For a non-template friend function with a requires clause, if the function is not templated then the original error message indicating that such a function is disallowed is shown instead, as the function will still be rejected if a definition is added.
-
Younan Zhang authored
[Clang][Sema] Extract ellipsis location from CXXFoldExpr for reattaching constraints on NTTPs (#78080) We build up a `CXXFoldExpr` for immediately declared constraints as per C++20 [temp.param]/4. This is done by `formImmediatelyDeclaredConstraint` where an `EllipsisLoc` is essential to determine whether this is a pack. On the other hand, when attempting to instantiate a class template, member templates might not be instantiated immediately, so we leave them intact. For function templates with NTTPs, we reattach constraints if possible so that they can be evaluated later. To properly form that, we attempted to extract an ellipsis location if the param per se was a parameter pack. Unfortunately, for the following NTTP case, we seemingly failed to handle: ```cpp template <Constraint auto... Pack> void member(); ``` The NTTPD Pack is neither an `ExpandedParameterPack` nor a `PackExpansion` (its type does not expand anything). As a result, we end up losing track of the constraints on packs, although we have them inside the associated `CXXFoldExpr`. This patch fixes that by extracting the ellipsis location out of the previous constraint expression. Closes https://github.com/llvm/llvm-project/issues/63837.
-
jimingham authored
We claim in a couple places that the zeroth element of the module list for a target is the main executable, but we don't actually enforce that in the ModuleList class. As we saw, for instance, in 32dd5b20 it's not all that hard to get this to be off. This patch ensures that the first object file of type Executable added to it is moved to the front of the ModuleList. I also added a test for this. In the normal course of operation, where the executable is added first, this only adds a check for whether the first element in the module list is an executable. If that's true, we just append as normal. Note, the code in Target::GetExecutableModule doesn't actually agree that the zeroth element must be the executable, it instead returns the first Module of type Executable. But I can't tell whether that was a change in intention or just working around the bug that we don't always maintain this ordering. But given we've said this in scripting as well as internally, I think we shouldn't change our minds about this.
-
Alexander Richardson authored
This variable was explicitly removed from the cache to ease transition from existing build directories but that breaks passing COMPILER_RT_BUILD_CRT=OFF on the command line. I was surprised to see the CRT builds being run for my builtins-only build config (I noticed because one of the tests was failing despite having `REQUIRES: crt`). If I pass `-DCOMPILER_RT_BUILD_CRT=OFF` to cmake and add some prints around the `unset` statement it shows the following: ``` -- before unset(): COMPILER_RT_BUILD_CRT=OFF -- after unset: COMPILER_RT_BUILD_CRT= -- after cmake_dependent_option COMPILER_RT_BUILD_CRT=ON ``` Drop this temporary workaround now that over 6 months have passed.
-
Davide Italiano authored
This reverts commit fc6faa11.
-