- Mar 28, 2023
-
-
Viktoriia Bakalova authored
-
Viktoriia Bakalova authored
Differential Revision: https://reviews.llvm.org/D146244
-
Simon Pilgrim authored
Most of the combines are for ISD::SETEQ/ISD::SETNE comparisons so do a single early-check for the condcode.
-
Louis Dionne authored
The helper is mis-named, since it won't work as-is on ordered containers like set and map, because they rely on being able to store keys that are partial_ordering::unordered, and that's UB for an ordered container. This was most likely a typo or an unintended naming mistake, since the function is only used with sequence containers anyway. Differential Revision: https://reviews.llvm.org/D146991
-
Louis Dionne authored
AppleClang 1403 has some bugs that prevent std::source_location from working properly on it. Consequently, we XFAILed the unit test for source_location with that compiler. However, we should also avoid advertising that the feature is supported on that compiler, otherwise our feature-test macros lie. This was noticed to break Boost.Asio when building with a recent libc++ and AppleClang 14.0.3. rdar://106863087 Differential Revision: https://reviews.llvm.org/D146837
-
Quentin Colombet authored
NFC
-
Louis Dionne authored
Sometimes, a target can look like `<arch>-apple-macosx10.15.0` instead of `<arch>-apple-macosx10.15`. This ensures that the test suite handles those target triples properly as well. Differential Revision: https://reviews.llvm.org/D146365
-
pvanhout authored
Allows allocas with memset users to be promoted. This is intended to prevent patterns such as `memset(&alloca, 0, sizeof(alloca))` (which I think can be emitted by frontends) from preventing a vectorization of allocas. Fixes SWDEV-388784 Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D146225
-
Aaron Ballman authored
Any project that wants to import std; potentially needs to be able to build a module that does export std;. We silenced the error diagnostic if the module identified itself as a system header, but this isn't quite good enough, what we really need is a way to identify a system module. It would be nice for that feature to be shared among the major implementations, so this downgrades the diagnostic from an error to a warning temporarily to give implementers time to determine what that mechanism will look like. We may convert this warning back into an error in a future release of Clang, but it's not guaranteed we will do so. Fixes https://github.com/llvm/llvm-project/issues/61446 Differential Revision: https://reviews.llvm.org/D146986
-
Chih-Ping Chen authored
Differential Revision: https://reviews.llvm.org/D146756
-
Ingo Müller authored
-
Quentin Colombet authored
This patch adds patterns to rewrite memory accesses such that the resulting accesses are only using a base pointer. E.g., ```mlir memref.load %base[%off0, ...] ``` Will be rewritten in: ```mlir %new_base = memref.subview %base[%off0,...][1,...][1,...] memref.load %new_base[%c0,...] ``` The idea behind these patterns is to offer a way to more gradually lower address computations. These patterns are the exact opposite of FoldMemRefAliasOps. I've implemented the support of only five operations in this patch: - memref.load - memref.store - nvgpu.ldmatrix - vector.transfer_read - vector.transfer_write Going forward we may want to provide an interface for these rewritings (and the ones in FoldMemRefAliasOps.) One step at a time! Differential Revision: https://reviews.llvm.org/D146724
-
Peter Klausler authored
A CONTIGUOUS entity must be an array pointer, assumed-shape dummy array, or assumed-rank dummy argument (C752, C830). As currently implemented, f18 only implements the array requirement if the entity is a pointer. Combine these checks and start issuing citations to scalars. Differential Revision: https://reviews.llvm.org/D146588
-
Mariya Podchishchaeva authored
When a potential immediate invocation is met, it is immediately wrapped by a `ConstantExpr`. There is also a TreeTransform that removes this `ConstantExpr` wrapper when corresponding expression evaluation context is popped. So, in case initializer was an immediate invocation, `CXXTemporaryObjectExpr` was wrapped by a `ConstantExpr`, and that caused additional unnecessary `CXXFunctionalCastExpr` to be added, which later confused the TreeTransform that rebuilds immediate invocations, so it was adding unnecessary constructor call. Fixes https://github.com/llvm/llvm-project/issues/60286 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D146801
-
Peter Klausler authored
The compiler accepts arguments of any rank, or assumed rank, to a host of intrinsic inquiry functions. For scalars, this is correct for most of them, but the standard (and other compilers) prohibit scalar arguments to SIZE, LBOUND, and UBOUND (without DIM=). There are meaningful interpretations for these intrinsic inquiries on scalars, but since there's no portability concern here, continuing to support them would be an unjustifiable extension. Differential Revision: https://reviews.llvm.org/D146587
-
Manas authored
It fixes some typos in the language reference. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D147028
-
David Green authored
This is a simple patch to make sure fast math flags are propagated through to the newly created symmetric operations, which can help with later simplifications. Differential Revision: https://reviews.llvm.org/D146409
-
David Green authored
This adds a target combine for `fadd(a, vcmla(b, c, d))` -> `vcmla(fadd(a, b), b, c)`, pushing the fadd into the operands of the fcmla, which can help simplify away some additions. Differential Revision: https://reviews.llvm.org/D146407
-
Martin Braenne authored
This avoids the risk of ODR violations. Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D147032
-
Adrian Kuegel authored
-
Chuanqi Xu authored
Close https://github.com/llvm/llvm-project/issues/56916 Within C++20 modules, we may have multiple same constructors in multiple same RecordDecls. And it doesn't make sense naturally to create duplicated deduction guides for the duplicated constructors.
-
Adrian Kuegel authored
-
Alex Zinenko authored
Introduce support for external definitions of named sequences in the transform dialect by letting the TransformInterpreterPassBase read a "library" MLIR file. This file is expected to contain definitions for named sequences that are only declared in the main transformation script. This allows for sharing non-trivial transform combinations without duplication. This patch provides only the minimal plumbing for a single textual IR file. Further changes are possible to support multiple libraries and bytecode files. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D146961
-
Martin Storsjö authored
Skip this test on Windows (by requiring a posix shell), since we want to test specific corner cases of quotes passed to the executable, and llvm-lit/cmd don't seem to handle it correctly at the moment.
-
Stefan Gränitz authored
-
Ingo Müller authored
This patch adds another test case for the new 1:N type conversion utils testing that the proper user materializations are applied depending on which of the ops in are converted by the test pass. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D147027
-
Ingo Müller authored
This patch implements patterns for the newly introduced 1:N type conversion utils for several ops of the SCF dialect. It also adds an option to the existing test pass as well as test cases that applies the patterns through the test pass. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D146959
-
Petr Hosek authored
This reverts commit 55e65ad8.
-
zhanglimin authored
Introducing xor key to derive unmangled sp is here to follow the way that the glibc adds support for pointer mangling on loongarch in commit 1c9bc1b6e50293a1b7037a7bfbf835868a55baed. Reviewed By: SixWeining, wangleiat, xen0n Differential Revision: https://reviews.llvm.org/D146716
-
Juan Manuel MARTINEZ CAAMAÑO authored
[Clang][DebugInfo][AMDGPU] Emit zero size bitfields in the debug info to delimit bitfields in different allocation units. Consider the following sturctures when targetting: struct foo { int space[4]; char a : 8; char b : 8; char x : 8; char y : 8; }; struct bar { int space[4]; char a : 8; char b : 8; char : 0; char x : 8; char y : 8; }; Even if both structs have the same layout in memory, they are handled differenlty by the AMDGPU ABI. With the following code: // clang --target=amdgcn-amd-amdhsa -g -O1 example.c -S char use_foo(struct foo f) { return f.y; } char use_bar(struct bar b) { return b.y; } For use_foo, the 'y' field is passed in v4 ; v_ashrrev_i32_e32 v0, 24, v4 ; s_setpc_b64 s[30:31] For use_bar, the 'y' field is passed in v5 ; v_bfe_i32 v0, v5, 8, 8 ; s_setpc_b64 s[30:31] To make this distinction, we record a single 0-size bitfield for every member that is preceded by it. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D144870 -
Martin Braenne authored
Instead, we turn StmtToEnvMap into a concrete class with the implementation that used to live in StmtToEnvMapImpl. The layering issue that originally required the indirection through the `StmtToEnvMap` interface no longer exists. Reviewed By: ymandel, xazax.hun, gribozavr2 Differential Revision: https://reviews.llvm.org/D146507
-
Martin Storsjö authored
Some background context: GNU windres invokes the preprocessor in a subprocess. Some windres options are passed through to the preproocessor, e.g. -D options for predefining defines. When GNU windres passes these options onwards, it takes the options in exact the form they are received (in argv or similar) and assembles them into a single preprocessor command string which gets interpreted by a shell (IIRC via the popen() function, or similar). When LLVM invokes subprocesses, it does so via APIs that take properly split argument vectors, to avoid needing to worry about shell quoting/escaping/unescaping. But in the case of LLVM windres, we have to emulate the effect of the shell parsing done by popen(). Most of the relevant cases are already taken care of here, but this patch fixes an uncommon case encountered in https://github.com/llvm/llvm-project/issues/57334. (This case is uncommon since it doesn't do what one would want to; the quotes need to be escaped more to work as intended through the popen() shell). Differential Revision: https://reviews.llvm.org/D146848
-
Martin Storsjö authored
When preprocessing was integrated to llvm-rc in 2021, this was a new requirement (previously one could execute llvm-rc without a suitable preprocessing tool to be available). As a transitional helper, llvm-rc fell back on skipping preprocessing if no suitable tool was found (with a warning printed), but users could pass an llvm-rc specific option to silence the warning, if they explicitly want to run the tool without preprocessing. Now 2 years later, remove the transitional helper - error out if preprocessing failed. The option for disabling preprocessing remains. Differential Revision: https://reviews.llvm.org/D146797
-
Martin Storsjö authored
This was the original option name from the first iteration of the patch that added the feature, but during review, a different name was suggested and preferred - but the reference in the helpful message was missed. Differential Revision: https://reviews.llvm.org/D146796
-
Martin Storsjö authored
In some cases, there's no adjacent executable named "clang" or "clang-cl", but one name "clang-<major>". This logic doesn't cover every possible deployment setup of course, but should cover more fairly common/reasonable cases. See https://github.com/curl/curl-for-win/commit/caaae171ac43af5b883403714dafd42030d8de61#commitcomment-105808524 for discussion about a case where this would have been helpful. Differential Revision: https://reviews.llvm.org/D146794
-
Martin Storsjö authored
The arguments passed in this option were passed onto the child process, but we still blindly used the clang binary that we had found to sys::ExecuteAndWait as the intended executable to run. If the user hasn't specified any custom --preprocessor command, Args[0] is equal to the variable Clang. This doesn't affect any tests, since the tests only print the arguments it would try to execute (but not the first parameter to sys::ExecuteAndWait), but there's no testes for executing it (and validating that it did execute the right thing). Differential Revision: https://reviews.llvm.org/D146793
-
Nicolas Vasilache authored
`transform.pack_greedily` supports skipping dimensions in which case we may well end up with e.g. a matvec innermost. We should not spuriously crash in such cases.
-
Adrian Kuegel authored
-
Bjorn Pettersson authored
When doing a trivial unswitch of a switch statement the code need to "invalidate SCEVs for the outermost loop reached by any of the exits", as indicated by code comments. Depending on if we find such an outermost loop or not we can limit the invalidation to some sub-loops or the full loop-nest. As shown in the added test case there seem to have been some bugs in the code that was finding the "outermost loop", so we could end up invalidating too few loops. Seems like commit 1bf8ae17 introduced the bug by moving the code that invalidates the loops above some of the code that computed 'OuterL'. This patch fixes that by also moving that computation of 'OuterL' so that we compute 'OuterL' properly before we use it for the SCEV invalidation. Differential Revision: https://reviews.llvm.org/D146963
-
pvanhout authored
DAGISel uses CopyToReg/CopyFromReg to lower PHI nodes. With large PHIs, this can result in poor codegen. This is because it introduces a need to have a build_vector before copying the PHI value, and that build_vector may have many undef elements. This can cause very high register pressure and abnormal stack usage in some cases. This scalarization/phi "break-up" can be easily tuned/disabled through CL options in case it's not beneficial for some users. It's also only enabled for DAGIsel and GlobalISel handles PHIs much better (as it works on the whole function). This can both scalarize (break a vector into its elements) and simplify (break a vector into smaller, more manageable subvectors) PHIs. Fixes SWDEV-321581 Reviewed By: kzhuravl Differential Revision: https://reviews.llvm.org/D143731
-