- Jul 12, 2023
-
-
Krzysztof Drewniak authored
To complement the bf16 expansion and truncation patterns added to ExpandOps, define a pass that replaces, for any arithmetic operation op, %y = arith.op %v0, %v1, ... : T with %e0 = arith.expf %v0 : T to U %e1 = arith.expf %v1 : T to U ... %y.exp = arith.op %e0, %e1, ... : U %y = arith.truncf %y.exp : U to T This allows for "emulating" floating-point operations not supported on a given target (such as bfloat operations or most arithmetic on 8-bit floats) by extending those types to supported ones, performing the arithmetic operation, and then truncating back to the original type (which ensures appropriate rounding behavior). The lowering of the extf and truncf ops introduced by this transformation should be handled by subsequent passes. Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D154539
-
Jon Chesterfield authored
-
Teresa Johnson authored
This restores commit b4a82b62, reverted in 3ab7ef28 because it was thought to cause a bot failure, which ended up being unrelated to this patch set. Differential Revision: https://reviews.llvm.org/D154856
-
Teresa Johnson authored
This restores commit 29252fdd, reverted in 3498cf52 because it was thought to cause a bot failure, which ended up being unrelated to this patch set. Differential Revision: https://reviews.llvm.org/D154872
-
Thurston Dang authored
Relanding with #if SANITIZER_GLIBC to avoid breaking FreeBSD. Also incorporates Arthur's BUILD.gn fix (thanks!) from https://reviews.llvm.org/rGc1e283851772ba494113311405d48cfb883751d1 Original commit message: This patch adds an msan interceptor for dladdr1 (with support for RTLD_DL_LINKMAP and RTLD_DL_SYMENT) and an accompanying test. It also adds a helper file, msan_dl.cpp, that contains UnpoisonDllAddrInfo (refactored out of the dladdr interceptor) and UnpoisonDllAddr1ExtraInfo. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D154272
-
Valentin Clement authored
Do not look for the global early in nullify codegen. The type descriptor can be emitted later and it would raise an error as it could not be found. Use `fir.type_desc` instead so it delays the type descriptor lookup until evrything is emitted. https://github.com/llvm/llvm-project/issues/63775 Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D154982
-
Corentin Jabot authored
Such jumps are not allowed by GCC and allowing them can lead to situations where we jumps into unevaluated statements. Fixes #63682 Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D154696
-
Joseph Huber authored
This ensures that if someone calls the `rpc_shutdown` method multiple times it will not segfault and gracefully continue. This was causing problems in the OpenMP usage. This could point to other issues, but for now this is a safe fix. Differential Revision: https://reviews.llvm.org/D155005
-
Jim Ingham authored
I need to call this to figure out why the assert in StopInfoMachException::CreateStopReasonWithMachException is triggering, but it isn't appropriate to directly access the GDBRemoteCommunication there. And dumping whatever history the process plugin has collected during the run isn't gdb-remote specific... Differential Revision: https://reviews.llvm.org/D154992
-
Eduard Zingerman authored
Extended BPFCheckAndAdjustIR pass with sinkMinMax() transformation that undoes LICM hoistMinMax pass. The undo transformation converts the following patterns: x < min(a, b) -> x < a && x < b x > min(a, b) -> x > a || x > b x < max(a, b) -> x < a || x < b x > max(a, b) -> x > a && x > b Where 'a' or 'b' is a constant. Also supports `sext min(...) ...` and `zext min(...) ...`. ~~~ This was previously commited as 09feee55 and reverted in 0bf9bfea because of the testbot memory leak report: https://lab.llvm.org/buildbot/#/builders/5/builds/34931 The memory leak issue was caused by incorrect instruction removal sequence in skinMinMaxBB(): I->dropAllReferences(); --------> I->eraseFromParent(); I->removeFromParent(); fixed to Differential Revision: https://reviews.llvm.org/D147990 -
Diego Caballero authored
This is part of the process to remove vector.insertelement/extractelement from the Vector dialect. RFC: https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops Differential Revision: https://reviews.llvm.org/D152644
-
Mike Crowe authored
If MatchesAnyListedNameMatcher::NameMatcher::match() is called in MatchMode::MatchUnqualified mode with a NamedDecl that has no name then calling NamedDecl::getName() will assert with: `Name.isIdentifier() && "Name is not a simple identifier"' It seems unfair to force all matchers using matchers::matchesAnyListedName to defend against this, particularly since test cases are unlikely to provoke the problem. Let's just check whether the identifier has a name before attempting to use it instead. Add test case that reproduces the problem to the use-std-print-custom.cpp lit check. Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D154884
-
Mike Crowe authored
When given: printf("Hello\r\n"); it's clearer to leave the CRLF intact and convert this to: std::print("Hello\r\n"); than to remove the trailing newline and convert it to: std::println("Hello\r"); Update the documentation to match, and clarify the situations for using println vs print which weren't previously explained. Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D154788 -
Florian Hahn authored
Update computeMinimumValueSizes to check if an instruction's operands can safely be truncated. If more than MinBW bits are demanded by for the operand or if the operand is a constant and cannot be safely truncated, it is not safe to evaluate the instruction in the narrower MinBW. Skip those cases. Fixes https://github.com/llvm/llvm-project/issues/47927 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D154717
-
Craig Topper authored
It's identical to SiFive7GetCyclesDefault. Differential Revision: https://reviews.llvm.org/D155002
-
Matt Arsenault authored
The most notable issue was producing v_mad_f32 in functions with the dynamic mode, since it just ignores the mode. fdiv lowering is still somewhat broken because it involves a mode switch and we need to query the original mode.
-
Chen, Cheng2 authored
I found that the newly added member variables, "EmitCompactUnwindNonCanonical" were not initialized in the constructor, but other member variables were initialized. The behavior seems to need to be consistent to improve code. Reviewed By: oontvoo Differential Revision: https://reviews.llvm.org/D154472
-
Craig Topper authored
We were always printing "m1", we need to calculate the correct LMUL instead. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D153659
-
Matt Arsenault authored
The implementations of a number of math functions on amdgpu involve pre and post-scaling the inputs out of the denormal range. If these are chained together we can possibly fold them out. computeConstantRange seems weaker than computeKnownBits, so this regresses some of the older vector tests.
-
wangpc authored
A new Init type ArgumentInit is added to represent arguments. We currently only support positional arguments; an upcoming change will add named argument support. The index of argument in error message is removed. Differential Revision: https://reviews.llvm.org/D154066
-
Mark de Wever authored
Fixes https://llvm.org/PR62082 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D154851
-
Mark de Wever authored
This is a preparation for P2093R14 Formatted output When the output of print is to the terminal it needs to use the native API. This means transcoding UTF-8 to UTF-16 on Windows. The encoder's interface is modeled after P2728 Unicode in the Library, Part 1: UTF Transcoding But only the required part for P2093R14 is implemented. On Windows wchar_t is 16 bits, in order to test on platforms where wchar_t is 32 bits the transcoder has support for char16_t. It also adds and UTF-8 to UTF-32 encoder which is useful for other tests. Note it is possible to use <codecvt> for transcoding, but that header is deprecated. So rather write new code that is not deprecated; the hard part, decoding, has already been done. The <codecvt> header also requires locale support while the new code works without including <locale>. Note the current transcoder implementation can be optimized since it basically does UTF-8 -> UTF-32 -> UTF-16. The first goal is to have a working impleme...
-
Michael Jones authored
Subnormal floating point numbers have a lower effective precision than normal floating point numbers. This can cause issues for the fuzz test since the MPFR floats have a constant precision regardless of the exponent, and the precision must match exactly or else create rounding errors. To solve this problem, the precision of the MPFR floats is dynamically calculated. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D154909
-
Jan Svoboda authored
This patch implements `llvm::PointerLikeTraits<FileEntryRef>` and `llvm::PointerLikeTraits<DirectoryEntryRef>`, allowing some simplifications around umbrella header/directory code. Reviewed By: benlangmuir Differential Revision: https://reviews.llvm.org/D154905
-
Arthur Eubanks authored
Reviewed By: paulkirth Differential Revision: https://reviews.llvm.org/D154308
-
David Truby authored
Currently the local builder used in IntrinsicCall doesn't have the fastmath flags passed to it. This results in the fastmath attribute not being added to certain runtime calls. This patch simply forwards the fastmath flags from the parent builder. Differential Revision: https://reviews.llvm.org/D154611
-
Fangrui Song authored
Otherwise if the current directory is not writable, we will fail with a different message.
-
Craig Topper authored
Use unsigned long in place of uint32_t for both clz and cls. As far as I can tell this matches what ACLE defines and what gcc implements. Noticed while investigating fixing https://github.com/llvm/llvm-project/issues/63113 Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D154910
-
Alex Langford authored
These methods all take a `Stream *` to get feedback about what's going on. By default, it's a nullptr, but we always feed it with a valid pointer. It would therefore make more sense to have this take a reference. Differential Revision: https://reviews.llvm.org/D154883
-
Philip Reames authored
After D154245 lands, we have greatly simplified the possible configurations for an entry in the RISCVMaskedPseudo table. This change goes through and reworks everything which uses that table to exploit the available simplifications. To justify the correctness here, let me note that we no longer had any use of HasTU=true. We were left with only the HasTu=false, and IsCombined=true|false cases. The only usage is IsCombined=false was for the comparison operations. At the moment, these operations are the only ones in the table without vector policy operands. Instead of switching on the pseudo value, we can just check the VecPolicy flag instead. It may be worth adding a passthru operand to the comparisons (which is actually needed to represent tail undefined vs tail agnostic), and a vector policy operand (which is strictly unneeded) just for consistency, but we can do that in a follow up patch for some further simplifica...
-
Qiongsi Wu authored
[clang][AIX] Fix Overly Strict LTO Option Checking against `data-sections` when `mxcoff-roptr` is in Effect The LTO `-mxcoff-roptr` [[ https://github.com/llvm/llvm-project/blob/c6b2d25927817bdeca99653ee3e66720f33ce3ae/clang/lib/Driver/ToolChains/CommonArgs.cpp#L750 | check ]] against data sections is overly strict and it ignores the fact that [[ https://github.com/llvm/llvm-project/blob/c6b2d25927817bdeca99653ee3e66720f33ce3ae/llvm/lib/LTO/LTOCodeGenerator.cpp#L427 | data sections is on by default on AIX ]], causing valid LTO compilation to fail when `-fdata-sections` is not explicitly specified. This patch revises the check so that an error is reported only if data sections is explicitly turned off for LTO. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D152021
-
Alex Langford authored
A common thing to do is to call `str().c_str()` to get a null-terminated string out of an existing StringRef. Most of the time this is to be able to use a printf-style format string. However, llvm::formatv can handle StringRefs without the need for the additional allocation. Using that makes more sense. Differential Revision: https://reviews.llvm.org/D154890
-
Philip Reames authored
This change continues with the line of work discussed in https://discourse.llvm.org/t/riscv-transition-in-vector-pseudo-structure-policy-variants/71295. This change handles most of the binary pseudos. I excluded pseudos which _TIED variants, and those that produce mask results. Both a bit different in functionality, and deserve their own change and review. As with previous changes in the series, we replace the existing TA and TU forms with a single unified pseudo with a passthru (which may be implicit_def) and a policy operand. As before, we see codegen changes (some improvements and some regressions) due to scheduling differences caused by the extra implicit_def instructions. Differential Revision: https://reviews.llvm.org/D154245
-
David Green authored
See D153632 and D154063
-
Craig Topper authored
The register being replaced might have a more restrictive register class due to requirements of the using instruction. We should constrain the register class to preserve any restrictions. This was found in our downstream on a custom instruction. I don't have a test case for upstream currently. Differential Revision: https://reviews.llvm.org/D154920
-
Aleksandr Popov authored
This reverts commit 4c6f95be and relands e16c5c09 https://reviews.llvm.org/D154069
-
Alex Zinenko authored
This is the counterpart to the forward dense dataflow analysis and integrates into the dataflow framework. The implementation follows the structure of existing dataflow analyses. Reviewed By: Mogball, phisiart Differential Revision: https://reviews.llvm.org/D154713
-
Slava Zakharin authored
When an initializer value is missing for an allocatable component in a structure constructor, the RHS is NULL() expression. We should just skip this part of the initializer, since the component must become unallocated (as it is from the initialization). Runtime detected rank mismatch when we tried to pass NULL() box RHS for assigning it to the unallocated component of rank 1, 2, etc. Reviewed By: tblah Differential Revision: https://reviews.llvm.org/D154906
-
Slava Zakharin authored
In the context of elemental operation a dynamically optional intrinsic argument must be lowered such that the elemental designator is generated under isPresent check. Reviewed By: tblah Differential Revision: https://reviews.llvm.org/D154897
-