- Aug 22, 2023
-
-
Sam McCall authored
For applications like clangd, the preamble remains an important optimization when editing a module definition. The global module fragment is a good fit for it as it by definition contains only preprocessor directives. Before this patch, we would terminate the preamble immediately at the "module" keyword. Differential Revision: https://reviews.llvm.org/D158439
-
Andrzej Warzynski authored
This patch simply removes one of the pre-conditions of scalable vectorisation. Namely, that only the trailing vector dimension can be scalable, e.g. vector<2x4x[8]xi32> This limitation can be lifted following the recent work to support scalable vectorisation in Linalg, most notably: * https://reviews.llvm.org/D154336 * https://reviews.llvm.org/D153372 A test is added that demonstrates scalable vectorisation of `linalg.matmul`. This is simply a copy of a similar test for fixed-width vectorisation. The latter is updated - check lines are simplified and annotated with regex patterns. This in the spirit of [1]: Tests should be minimal, and only check what is absolutely necessary. Note that this change is just one step towards scalable vectorisation in Linalg. It will allow us to exercise new code paths in the context of scalable vectors in Linalg and hence make further progress in the forthcoming patches. [1] https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices Differential Revision: https://reviews.llvm.org/D158423
-
Luke Lau authored
When folding a vmerge into its operands, if the resulting VL is smaller than what the vmerge had originally then what was previously in its body then gets moved to the tail. In that case, we can't relax the tail policy to agnostic when the merge operand is undefined, since we need to preserve these elements past the new VL. Fixes https://github.com/llvm/llvm-project/issues/64754 Reviewed By: craig.topper, reames Differential Revision: https://reviews.llvm.org/D158161
-
Luke Lau authored
Reviewed By: reames Differential Revision: https://reviews.llvm.org/D158160
-
Tuan Chuong Goh authored
Recognise G_FSHR with constant shift amount as a legal instruction. Lowers G_FSHL with constant shift to G_FSHR. If shift amount is non-constant, generic lowering is applied to the instruction. Differential Revision: https://reviews.llvm.org/D155484
-
Andrzej Warzynski authored
This patch updates one specific hook in "VectorDropLeadUnitDim.cpp" to make sure that "scalable dims" are handled correctly. While this change affects multiple patterns, I am only adding one regression tests that captures one specific case that affects me right now. I am also adding Vector dialect to the list of dependencies of `-test-vector-to-vector-lowering`. Otherwise my test case won't work as a standalone test. Differential Revision: https://reviews.llvm.org/D157993
-
Alexandros Lamprineas authored
* Changes the default value of FuncSpecMaxIters from 1 to 10. This allows specialization of recursive functions. * Adds an option to control the maximum codesize growth per function. * Measured ~45% performance uplift for SPEC2017:548.exchange2_r on AWS Graviton3. Differential Revision: https://reviews.llvm.org/D145819
-
Nikita Popov authored
In degenerate cases, the backedge value can be folded to poison. Fixes https://github.com/llvm/llvm-project/issues/64891.
-
Nikita Popov authored
With opaque pointers, we no longer need to insert the bitcast.
-
Lorenzo Chelini authored
`tensor.unpack` implements the DPS (Destination Passing Style) interface and expects the result to be "stored" in the `outs` operand, but this is not the case with the current decomposition as the final operation is a `tensor.extract_slice` that does not implement DPS. Add a `linalg.copy` to fix the problem. Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D158393
-
Nikita Popov authored
As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179, this removes support for and and or constant expressions. Places creating such expressions have been migrated in advance, so this is mostly API removal and test updates. Differential Revision: https://reviews.llvm.org/D155924
-
Nikita Popov authored
SCEVExpander tries to reuse existing instruction with the same SCEV expression. However, doing this replacement blindly is not safe, because the instruction might be more poisonous. What we were already doing is to drop poison-generating flags on the reused instruction. But this is not the only way that more poison can be introduced. The poison-generating flag might not be directly on the reused instruction, or the poison contribution might come from something like 0 * %var, which folds to 0 but can still introduce poison. This patch fixes the issue in a principled way, by determining which values can contribute poison to the SCEV expression, and then checking whether any additional values can contribute poison to the instruction being reused. Poison-generating flags are dropped if doing that enables reuse. This is a pretty big hammer and does cause some regressions in tests, but less than I would have expected. I wasn't able to come up with a less intrusive fix that still satisfies the correctness requirements. Fixes https://github.com/llvm/llvm-project/issues/63763. Fixes https://github.com/llvm/llvm-project/issues/63926. Fixes https://github.com/llvm/llvm-project/issues/64333. Fixes https://github.com/llvm/llvm-project/issues/63727. Differential Revision: https://reviews.llvm.org/D158181
-
pvanhout authored
Rewrites some simple rules that cause little to no codegen regressions as MIR patterns. I may have missed some easy cases, but some other rules have intentionally been left as-is because bigger changes are needed to make them work. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D157690
-
Jim Lin authored
-
wangpc authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D158388
-
Matthias Springer authored
The operands for which elementwise access is relevant can now be specified. All other operands are ignored. This is useful because only two particular operands participate in a RaW conflict. Furthermore, the two tensors no longer must be equivalent to rule out conflicts due to elementwise access. Equivalent tensor sets may be formed after an inplace bufferization decision is made. The two tensors are actually not required to be equivalent. The only important thing is that they have "equivalent" indexing into the same base buffer. Differential Revision: https://reviews.llvm.org/D158428
-
Fangrui Song authored
-
Congcong Cai authored
[clang-tidy][readability-braces-around-statements] ignore false-positive for constexpr if statement in lambda expression Fixed: #64545 When TreeTransform, Stmt in constexpr IfStmt will be transform to NullStmt. This NullStmt has the different beginning token. This patch add addtional check in checkStmt to handle this case. Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D158480
-
Christian Sigg authored
-
Christian Sigg authored
-
Christian Ulmann authored
This commit adds a missed update of the call mapping in the LLVM export for calls with no result. Before, these calls were not inserted and thus, the export dropped branch weights on them. Reviewed By: zero9178 Differential Revision: https://reviews.llvm.org/D158453
-
Mikael Holmen authored
Apparently the testcase coalesce-partial-redundant-reguse-terminator.mir was broken in a way that -verify-coalescing detected. Update the testcase so -verify-coalescing doesn't complain and so that it still exposes the problem originally fixed in 6c062b76. Differential Revision: https://reviews.llvm.org/D158397
-
huqizhi authored
Depth of the parameter of friend template class declaration in a template class is 1, while in the specialization the depth is 0. This will cause failure on 'IsStructurallyEquivalent' as a name conflict in 'VisitClassTemplateDecl'(see testcase of 'SkipComparingFriendTemplateDepth'). The patch fix it by ignore the depth only in this special case. Reviewed By: balazske Differential Revision: https://reviews.llvm.org/D156693
-
Christian Sigg authored
-
Kai Luo authored
-
Congcong Cai authored
``` struct XY { int *x; int *y; }; void recordInitList(int *x) { XY xy = {x, nullptr}; } ``` x cannot be const int* becase it in a initialize list which only accept int* Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D158152 -
Douglas Yung authored
-
Fangrui Song authored
See issue llvm#64166 for more information about layering.
-
Slava Zakharin authored
On x86, a simplified F128 maxval ends up calling fmaxl that does not work properly for F128 arguments. It is probably an LLVM issue, but we also should not use arith.maxf if NaN or -0.0 operands are possible. The change is to use cmpf and select. Unfortunately, these arith ops do not support FastMathFlags currently, so I will have to fix this sooner or later (depending on how this affects performance). Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D158200
-
YunQiang Su authored
If ScanLibDirForGCCTriple with target triple fails, let's try the triple with vendor stripped if vendor is unknown. Debian always uses triples without a vendor section. In general, triples without a vendor section is the most similar aliases than any other aliases. To archive this, we add a private member TripleNoVendor to GCCInstallationDetector. This modification makes testcases riscv32-toolchain.c and riscv64-toolchain.c fail. The reason is that they are wrong: --triple riscv64-unknown-elf tries to use riscv64-unknown-linux-gnu first. This patch accidentally fixes this problem. We also drop the path delimiter pattern {{/|\\\\}}, as these 2 tests are disabled on Windows, and in fact the positions of this pattern are not correct. Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D158183 -
Chuanqi Xu authored
Close https://github.com/llvm/llvm-project/issues/56301 Close https://github.com/llvm/llvm-project/issues/64151 See the summary and the discussion of https://reviews.llvm.org/D157070 to get the full context. As @rjmccall pointed out, the key point of the root cause is that currently we didn't implement the semantics for '@llvm.coro.save' well ("after the await-ready returns false, the coroutine is considered to be suspended ") well. Since the semantics implies that we (the compiler) shouldn't write the spills into the coroutine frame in the await_suspend. But now it is possible due to some combinations of the optimizations so the semantics are broken. And the inlining is the root optimization of such optimizations. So in this patch, we tried to add the `noinline` attribute to the await_suspend call. Also as an optimization, we don't add the `noinline` attribute to the await_suspend call if the awaiter is an empty class. This should be correct since the programmers can't access the local variables in await_suspend if the awaiter is empty. I think this is necessary for the performance since it is pretty common. Another potential optimization is: call @llvm.coro.await_suspend(ptr %awaiter, ptr %handle, ptr @awaitSuspendFn) Then it is much easier to perform the safety analysis in the middle end. If it is safe to inline the call to awaitSuspend, we can replace it in the CoroEarly pass. Otherwise we could replace it in the CoroSplit pass. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D157833
-
Nicolas Vasilache authored
This revision avoids the registration of dialect extensions in Pass::getDependentDialects. Such registration of extensions can be dangerous because `DialectRegistry::isSubsetOf` is always guaranteed to return false for extensions (i.e. there is no mechanism to track whether a lambda is already in the list of already registered extensions). When the context is already in a multi-threaded mode, this is guaranteed to assert. Arguably a more structured registration mechanism for extensions with a unique ExtensionID could be envisioned in the future. In the process of cleaning this up, multiple usage inconsistencies surfaced around the registration of translation extensions that this revision also cleans up. Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D157703
-
Jennifer Yu authored
When return out of __try block. In this test case, currently "false" is passed to OutlinedFinally's call. "true" should be passed to indicate abnormal terminations. The rule: Except _leave and fall-through at the end, all other exits in a _try (return/goto/continue/break) are considered as abnormal terminations, NormalCleanupDestSlot is used to indicate abnormal terminations. The problem is, during the processing abnormal terminations, the ExitSwitch is used. However, in this case, Existswitch is route out. One way to fix is to skip route it without a switch. So proper abnormal termination's code could be generated. Differential Revision: https://reviews.llvm.org/D158233
-
Ziqing Luo authored
[-Wunsafe-buffer-usage] Stop generating incorrect fix-its for variable declarations with unsupported specifiers We have to give up on fixing a variable declaration if it has specifiers that are not supported yet. We could support these specifiers incrementally using the same approach as how we deal with cv-qualifiers. If a fixing variable declaration has a storage specifier, instead of trying to find out the source location of the specifier or to avoid touching it, we add the keyword to a canonicalized place in the fix-it text that replaces the whole declaration. Reviewed by: NoQ (Artem Dergachev), jkorous (Jan Korous) Differential revision: https://reviews.llvm.org/D156192
-
Fangrui Song authored
This reverts commit 06c74b5e. Tested on AddressSanitizer-arm64-darwin that there is no more failure.
-
Gabor Horvath authored
This reverts commit c0c83668.
-
Christopher Ferris authored
The SCUDO_FUZZ macro is either defined or not defined. The previous code assumed it had a one or zero value, so change the setting of SCUDO_SMALL_STACK_DEPOT based on defined(SCUDO_FUZZ). Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D158459
-
Ziqing Luo authored
[-Wunsafe-buffer-usage] Refactor to let local variable fix-its and parameter fix-its share common code Refactor the code for local variable fix-its so that it reuses the code for parameter fix-its, which is in general better. For example, cv-qualifiers are supported. Reviewed by: NoQ (Artem Dergachev), t-rasmud (Rashmi Mudduluru) Differential revision: https://reviews.llvm.org/D156189
-
Justin Bogner authored
If the lower bound isn't specified it implies that it's zero. Differential Revision: https://reviews.llvm.org/D158441
-
Craig Topper authored
[RISCV] Check type size for lax conversions between RVV builtin types and VectorType::RVVFixedLengthDataVector. This code was copied from SVE and modified for RVV. For SVE, there is only one size for builtin types so they didn't need to check the size. For RVV, due to LMUL there are 7 different sizes of builtin types so we do need to check the size. I'm not sure we should have lax vector conversions at all for RVV. That appears to be contributing to https://github.com/llvm/llvm-project/issues/64404 This patch at least fixes the obvious correctness issue. This should be backported to LLVM 17. Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D157130
-