- Jun 22, 2022
-
-
Guillaume Chatelet authored
Differential Revision: https://reviews.llvm.org/D128118
-
Joseph Huber authored
Summary: A recent patch added some new code paths to the linker wrapper. Older compilers seem to have problems with returning errors wrapped in an Excepted type without explicitly moving them. This caused failures in some of the buildbots. This patch fixes that.
-
Nikita Popov authored
Migrate some more tests that required manual fixups (e.g. due to phi nodes), but have no codegen changes. Also tweak some more tests that had leftover no-op constant expressions.
-
Valentin Clement authored
This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: jeanPerier, PeteSteinfeld Differential Revision: https://reviews.llvm.org/D128331 Co-authored-by:
Jean Perier <jperier@nvidia.com> Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com> Co-authored-by:
Kiran Chandramohan <kiran.chandramohan@arm.com>
-
Guillaume Chatelet authored
-
Florian Hahn authored
This patch adds a new transferToOtherSystem helper that tries to transfer information from signed predicates to the unsigned system and vice versa. The initial version adds A >=u B for A >=s B && B >=s 0 https://alive2.llvm.org/ce/z/8b6F9i
-
Joseph Huber authored
This patch updates the `--[no-]offload-arch` command line arguments to allow the user to pass in many architectures in a single argument rather than specifying it multiple times. This means that the following command line, ``` clang foo.cu --offload-arch=sm_70 --offload-arch=sm_80 ``` can become: ``` clang foo.cu --offload-arch=sm_70,sm_80 ``` Reviewed By: ye-luo Differential Revision: https://reviews.llvm.org/D128206
-
Joseph Huber authored
The linker wrapper currently eagerly extracts all identified offloading binaries to a file. This isn't ideal because we will soon open these files again to examine their symbols for LTO and other things. Additionally, we may not use every extracted file in the case of static libraries. This would be very noisy in the case of static libraries that may contain code for several targets not participating in the current link. Recent changes allow us to treat an Offloading binary as a standard binary class. So that allows us to use an OwningBinary to model the file. Now we keep it in memory and only write it once we know which files will be participating in the final link job. This also reworks a lot of the structure around how we handle this by removing the old DeviceFile class. The main benefit from this is that the following doesn't output 32+ files and instead will only output a single temp file for the linked module. ``` $ clang input.c -fopenmp --offload-arch=sm_70 -foffload-lto -save-temps ``` Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D127246
-
Nikita Popov authored
Run the test through -instnamer, which makes it simpler to modify it.
-
Guillaume Chatelet authored
-
Martin Storsjö authored
This comment became outdated in 053eb356 (but was moved along); that commit moved the code and the comment to a separate function, with a separate local variable `num_of_bytes_read`. On error, the possibly garbage value is never copied back to the caller's reference, thus the comment is no longer relevant (and slightly confusing as is). Differential Revision: https://reviews.llvm.org/D128226
-
Aaron Ballman authored
The misc-unused-parameters check would trigger false positive warnings about the parameter being unused when the parameter declaration was invalid. No longer issue the warning in that case on the assumption that most parameters are used in practice, so the extra diagnostic is most likely a false positive. Fixes #56152
-
Igor Kudrin authored
This helps to preserve the debug information of global variables. Differential Revision: https://reviews.llvm.org/D127510
-
Simon Pilgrim authored
Another minor cleanup as we work toward removing GetDemandedBits entirely - call SimplifyMultipleUseDemandedBits directly.
-
Nikita Popov authored
Test updates were performed using: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 These are only the test updates where the test passed without further modification (which is almost all of them, as the backend is largely pointer-type agnostic).
-
Guillaume Chatelet authored
This is a reland of D126773 / b2a9ea44. The removal of `-mllvm -combiner-global-alias-analysis` has landed separately in D128051 / 7b73f537. And the removal of `-mllvm --tail-merge-threshold=0` is scheduled for removal in a subsequent patch.
-
Nikita Popov authored
Previously left these behind due to the required instruction renumbering, drop them now. This more accurately represents opaque pointer input IR. Also drop duplicate opaque pointer check lines in one SROA test.
-
Nikita Popov authored
Tests were updated with (without manual fixup): https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
-
Guillaume Chatelet authored
This patch is a subpart of D125768 intented to make the review easier. The `SizedOp` struct represents operations to be performed on a certain number of bytes. It is responsible for breaking them down into platform types and forwarded to the `Backend`. The `Backend` struct represents a lower level abstraction that works only on types (`uint8_t`, `__m128i`, ...). It is similar to instruction selection. Differential Revision: https://reviews.llvm.org/D126768
-
Nikita Popov authored
Update performed using: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 memcpy-discriminator.ll was fixed up to use named instructions and drop the no longer needed bitcasts.
-
Nikita Popov authored
Update performed using (without manual fixup): https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
-
Nikita Popov authored
Update performed using: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 This time without any manual fixup.
-
esmeyi authored
The symbol table starts with all the C_FILE symbols. Reviewed By: shchenz Differential Revision: https://reviews.llvm.org/D126623
-
David Green authored
This fixes the combining of constant vector GEP operands in the optimization of MVE gather/scatter addresses, when opaque pointers are enabled. As opaque pointers reduce the number of bitcasts between geps, more can be folded than before. This can cause problems if the index types are now different between the two geps. This fixes that by making sure each constant is scaled appropriately, which has the effect of transforming the geps to have a scale of 1, changing [r0, q0, uxtw #1] gathers to [r0, q0] with a larger q0. This helps use a simpler instruction that doesn't need the extra uxtw. Differential Revision: https://reviews.llvm.org/D127733
-
Nikita Popov authored
Regenerate the test with current O2 result and only run CGP.
-
David Sherwood authored
This patch adds support for: * Querying the PSTATE.SM state with @llvm.aarch64.sme.get.pstatesm * Reading/writing the TPIDR2 register with new @llvm.aarch64.sme.get.tpidr2 and @llvm.aarch64.sme.set.tpidr2 intrinsics. Tests added here: CodeGen/AArch64/sme-get-pstatesm.ll CodeGen/AArch64/sme-read-write-tpidr2.ll Differential Revision: https://reviews.llvm.org/D127957
-
Hui Xie authored
For an lvalue reference to a move only view x, views::all(x) gives hard error because the expression inside noexcept is not well formed and it is not SFINAE friendly. Given a move only view type `V`, and a concept ``` template <class R> concept can_all = requires { std::views::all(std::declval<R>()); }; ``` The expression `can_all<V&>` returns libstdc++: false msvc stl : false libc++ : error: static_cast from 'V' to 'typename decay<decltype((std::forward<V &>(__t)))>::type' (aka 'V') uses deleted function noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))) The standard spec has its own problem, the spec says it is expression equivalent to `decay-copy(E)` but the spec of `decay-copy` does not have any constraint, which means the expression `decay-copy(declval<V&>())` is well-formed and the concept `can_all<V&>` should return true and should error when instantiating the function body of decay-copy. This is clearly wrong behaviour in the spec and we will probably create an LWG issue. But the libc++'s behaviour is clearly not correct. The `noexcept` is an "extension" in libc++ which is not in the spec, but the expression inside `noexpect` triggers hard error, which is not right. Reviewed By: #libc, ldionne, var-const Differential Revision: https://reviews.llvm.org/D128281 -
Nikita Popov authored
As branch on undef is immediate undefined behavior, there is no need to mark one of the edges as feasible. We can leave all the edges non-feasible. In IPSCCP, we can replace the branch with an unreachable terminator. Differential Revision: https://reviews.llvm.org/D126962
-
Nicolas Vasilache authored
This will allow implementing state-dependent behavior in the future. Differential Revision: https://reviews.llvm.org/D128327
-
Serge Pavlov authored
Previously `#pragma STDC FENV_ACCESS ON` always set dynamic rounding mode and strict exception handling. It is not correct in the presence of other pragmas that also modify rounding mode and exception handling. For example, the effect of previous pragma FENV_ROUND could be cancelled, which is not conformant with the C standard. Also `#pragma STDC FENV_ACCESS OFF` turned off only FEnvAccess flag, leaving rounding mode and exception handling unchanged, which is incorrect in general case. Concrete rounding and exception mode depend on a combination of several factors like various pragmas and command-line options. During the review of this patch an idea was proposed that the semantic actions associated with such pragmas should only set appropriate flags. Actual rounding mode and exception handling should be calculated taking into account the state of all relevant options. In such implementation the pragma FENV_ACCESS should not override properties set by other pragmas but should set them if such setting is absent. To implement this approach the following main changes are made: - Field `FPRoundingMode` is removed from `LangOptions`. Actually there are no options that set it to arbitrary rounding mode, the choice was only `dynamic` or `tonearest`. Instead, a new boolean flag `RoundingMath` is added, with the same meaning as the corresponding command-line option. - Type `FPExceptionModeKind` now has possible value `FPE_Default`. It does not represent any particular exception mode but indicates that such mode was not set and default value should be used. It allows to distinguish the case: { #pragma STDC FENV_ACCESS ON ... } where the pragma must set FPE_Strict, from the case: { #pragma clang fp exceptions(ignore) #pragma STDC FENV_ACCESS ON ... } where exception mode should remain `FPE_Ignore`. - Class `FPOptions` has now methods `getRoundingMode` and `getExceptionMode`, which calculates the respective properties from other specified FP properties. - Class `LangOptions` has now methods `getDefaultRoundingMode` and `getDefaultExceptionMode`, which calculates default modes from the specified options and should be used instead of `getRoundingMode` and `getFPExceptionMode` of the same class. Differential Revision: https://reviews.llvm.org/D126364 -
Nikolas Klauser authored
Fixes #37402 Reviewed By: ldionne Spies: EricWF, avogelsgesang, libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D124346
-
Nikolas Klauser authored
`std::function` has been deprecated for a few releases now. Remove it with an option to opt-back-in with a note that this option will be removed in LLVM 16. Reviewed By: ldionne, #libc Spies: #libc_vendors, EricWF, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D127908
-
Valentin Clement authored
This patch clean up some code for upstreaming and add couple of missing tests that were left in fir-dev. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: jeanPerier, PeteSteinfeld Differential Revision: https://reviews.llvm.org/D128258 Co-authored-by:
Jean Perier <jperier@nvidia.com> Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com>
-
Florian Hahn authored
This allows adding facts without necessarily having a corresponding CmpInst.
-
Martin Storsjö authored
Originally, the nested build was set up with the CMake command `execute_process` which implicitly passes CC/CXX variables for the configured compiler, which then was picked up by the nested CMake. (This CMake behaviour, to implicitly pass such variables is up for discussion and might change in the future; see https://gitlab.kitware.com/cmake/cmake/-/issues/21378.) How the nested cmake build is set up was changed in aa7d6db5 / D40229 - the old behaviour was brought along by manually passing -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} to the nested cmake configuration. This was then later made optional in f5f0fffe / D40947. But still, the default if the user doesn't pass CROSS_TOOLCHAIN_FLAGS_${target_name} (e.g. CROSS_TOOLCHAIN_FLAGS_NATIVE) is to pass in the surrounding build's compiler - which usually doesn't work, and is quite non-obvious to figure out. ...
-
Pavel Samolysov authored
The code has been reformatted in accordance with the code style. Some function comments were extended to the Doxygen ones and reworded a bit to eliminate the duplication of the function's/class' name in the comment. Differential Revision: https://reviews.llvm.org/D128168
-
LLVM GN Syncbot authored
-
Siva Chandra Reddy authored
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D128303
-
Mark de Wever authored
This changes the implementation of the formatter. Instead of inheriting from a specialized parser all formatters will use the same generic parser. This reduces the binary size. The new parser contains some additional fields only used in the chrono formatting. Since this doesn't change the size of the parser the fields are in the generic parser. The parser is designed to fit in 128-bit, making it cheap to pass by value. The new format function is a const member function. This isn't required by the Standard yet, but it will be after LWG-3636 is accepted. Additionally P2286 adds a formattable concept which requires the member function to be const qualified in C++23. This paper is likely to be accepted in the 2022 July plenary. Depends on D121530 NOTE parts of the code now contains duplicates for the current and new parser. The intention is to remove the duplication in followup patches. A general overview of the final code is available in D124620. That review however lacks a bit of polish. Most of the new code is based on the same algorithms used in the current code. The final version of this code reduces the binary size by 17 KB for this example code ``` int main() { { std::string_view sv{"hello world"}; std::format("{}{}|{}{}{}{}{}{}|{}{}{}{}{}{}|{}{}{}|{}{}|{}", true, '*', (signed char)(42), (short)(42), (int)(42), (long)(42), (long long)(42), (__int128_t)(42), (unsigned char)(42), (unsigned short)(42), (unsigned int)(42), (unsigned long)(42), (unsigned long long)(42), (__uint128_t)(42), (float)(42), (double)(42), (long double)(42), "hello world", sv, nullptr); } { std::wstring_view sv{L"hello world"}; std::format(L"{}{}|{}{}{}{}{}{}|{}{}{}{}{}{}|{}{}{}|{}{}|{}", true, L'*', (signed char)(42), (short)(42), (int)(42), (long)(42), (long long)(42), (__int128_t)(42), (unsigned char)(42), (unsigned short)(42), (unsigned int)(42), (unsigned long)(42), (unsigned long long)(42), (__uint128_t)(42), (float)(42), (double)(42), (long double)(42), L"hello world", sv, nullptr); } } ``` Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D125606 -
Tom Stellard authored
Reviewed By: andreil99 Differential Revision: https://reviews.llvm.org/D126985
-