- Dec 17, 2022
-
-
Paul Robinson authored
Using std::optional in Support/TypeTraitsTest.cpp causes gcc 7.5 to complain. No public bots run a gcc that old, but we have internal bots that do. /home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp: In instantiation of ‘void {anonymous}::triviality::TrivialityTester() [with T = std::optional<int>; bool IsTriviallyCopyConstructible = true; bool IsTriviallyMoveConstructible = true]’: /home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:121:52: required from here /home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:29:3: error: static assertion failed: Mismatch in expected trivial copy construction! static_assert(llvm::is_trivially_copy_constructible<T>::value == ^~~~~~~~~~~~~ /home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:32:3: error: static assertion failed: Mismatch in expected trivial move construction! static_assert(llvm::is_trivially_move_constructible<T>::value == ^~~~~~~~~~~~~ -
Matt Arsenault authored
The constructor should not depend on the MachineFunction
-
Roman Lebedev authored
The test was passing for me locally, but fails on bots: https://lab.llvm.org/buildbot/#/builders/98/builds/29290/steps/10/logs/stdio
-
https://reviews.llvm.org/D139275#4001580Roman Lebedev authored
SimplifyCFG change is correct and not at fault here. The actual miscompile appears to be happening in InstCombine. ``` $ /builddirs/llvm-project/build-Clang15/bin/opt -load /repositories/alive2/build-Clang-release/tv/tv.so -load-pass-plugin /repositories/alive2/build-Clang-release/tv/tv.so -passes='tv,instcombine,tv' -o /dev/null /repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll ---------------------------------------- define float @D139275_c4001580(float %arg) { %0: %i = fcmp ugt float %arg, 0.000000 %i1 = fcmp ult float %arg, 1.000000 %i2 = and i1 %i, %i1 %i3 = fcmp uge float %arg, 0.100000 %i4 = xor i1 %i, %i2 %i5 = select i1 %i4, float 0.100000, float 0.000000 %i6 = and i1 %i3, %i2 %i7 = fadd float %arg, -0.100000 %i8 = select i1 %i6, float %i7, float %i5 ret float %i8 } => define float @D139275_c4001580(float %arg) { %0: %i = fcmp ugt float %arg, 0.000000 %i1 = fcmp ult float %arg, 1.000000 %i2 = and i1 %i, %i1 %i3 = fcmp uge float %arg, 0.100000 %i7 = fadd float %arg, -0.100000 %i5 = select i1 %i3, float %i7, float 0.100000 %i8 = select i1 %i2, float %i5, float 0.000000 ret float %i8 } Transformation doesn't verify! (unsound) ERROR: Value mismatch Example: float %arg = #x3dcbb820 (0.099472284317?) Source: i1 %i = #x1 (1) i1 %i1 = #x1 (1) i1 %i2 = #x1 (1) i1 %i3 = #x0 (0) i1 %i4 = #x0 (0) float %i5 = #x00000000 (+0.0) i1 %i6 = #x0 (0) float %i7 = #xba0a5680 (-0.000527717173?) float %i8 = #x00000000 (+0.0) Target: i1 %i = #x1 (1) i1 %i1 = #x1 (1) i1 %i2 = #x1 (1) i1 %i3 = #x0 (0) float %i7 = #xba0a5680 (-0.000527717173?) float %i5 = #x3dcccccd (0.100000001490?) float %i8 = #x3dcccccd (0.100000001490?) Source value: #x00000000 (+0.0) Target value: #x3dcccccd (0.100000001490?) Pass: (anonymous namespace)::TVPass Command line: '/builddirs/llvm-project/build-Clang15/bin/opt' '-load' '/repositories/alive2/build-Clang-release/tv/tv.so' '-load-pass-plugin' '/repositories/alive2/build-Clang-release/tv/tv.so' '-passes=tv,instcombine,tv' '-o' '/dev/null' '/repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll' Alive2: Transform doesn't verify! ``` -
Florian Hahn authored
This fixes a build failure with libc++ (`error: no matching function for call to 'max')`
-
Paul Robinson authored
Part of the project to eliminate special handling for triples in lit expressions.
-
Peter Klausler authored
Most attributes apply to only object or only procedure entities, and attempts to apply them to other kinds of symbol table entries are caught in name resolution when ConvertToObjectEntity() or ConvertToProcEntity() fails. However, the POINTER attribute can be applied to both, and name resolution can't perform that conversion yet, and as a result we don't catch many kinds of silly errors. Fix by ensuring that the symbol is of a type that could eventually become an object or procedure entity if it is not one already. Differential Revision: https://reviews.llvm.org/D140137
-
LLVM GN Syncbot authored
-
Hongtao Yu authored
This change introduces a missing frame inferrer aiming at fixing missing frames. It current only handles missing frames due to the compiler tail call elimination (TCE) but could also be extended to supporting other scenarios like frame pointer omission. When a tail called function is sampled, the caller frame will be missing from the call chain because the caller frame is reused for the callee frame. While TCE is beneficial to both perf and reducing stack overflow, a workaround being made in this change aims to find back the missing frames as much as possible. The idea behind this work is to build a dynamic call graph that consists of only tail call edges constructed from LBR samples and DFS-search for a unique path for a given source frame and target frame on the graph. The unique path will be used to fill in the missing frames between the source and target. Note that only a unique path counts. Multiple paths are treated unreachable since we don't want to overcount for any particular possible path. A switch --infer-missing-frame is introduced and defaults to be on. Some testing results: - 0.4% perf win according to three internal benchmarks. - About 2/3 of the missing tail call frames can be recovered, according to an internal benchmark. - 10% more profile generation time. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D139367
-
Kai Nacke authored
Change: negtive -> negative is -> are Thanks to tschuett for finding these.
-
Roman Lebedev authored
* This is a recommit of 3c4d2a03, * which was reverted in 25f01d59, because it exposed a miscompile in PPC backend, which was resolved in https://reviews.llvm.org/D140089 / cb3f415c. * which was a recommit of cf624b23, * which was reverted in 5cfc22ca, because the cut-off on the number of vector elements was not low enough, and it triggered both SDAG SDNode operand number assertions, 5and caused compile time explosions in some cases. Let's try with something really *REALLY* conservative first, just to get somewhere, and try to bump it later. FIXME: should this respect TTI reg width * num vec regs? Original commit message: Now, there's a big caveat here - these bytes are abstract bytes, not the i8 we have in LLVM, so strictly speaking this is not exactly legal, see e.g. https://github.com/AliveToolkit/alive2/issues/860 ^ the "bytes" "could" have been a pointer, and loading it as an integer inserts an implicit ptrtoint. But at the same time, InstCombine's `InstCombinerImpl::SimplifyAnyMemTransfer()` would expand a memtransfer of 1/2/4/8 bytes into integer-typed load+store, so this isn't exactly a new problem. Note that in memory, poison is byte-wise, so we really can't widen elements, but SROA seems to be inconsistent here. Fixes #59116.
-
Alexander Kornienko authored
Revert "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI's in common successor block" This reverts commit 1bd0b82e, since it leads to miscompiles. See https://reviews.llvm.org/D139275#3993229 and https://reviews.llvm.org/D139275#4001580.
-
Roy Sundahl authored
This change is breaking internal builds. We use the -Xfoo pattern but can now no longer manage whether we allow an unused -Xfoo option to pass as a warning or promote it to an error. This reverts commit 98615fd3. Reviewed By: davide Differential Revision: https://reviews.llvm.org/D139717
-
- Dec 16, 2022
-
-
Nikolas Klauser authored
The clang-tidy checks can't be properly implemented before LLVM16 because the Clang CMake files don't provide the version before. Reviewed By: Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D140071
-
Sjoerd Meijer authored
Opaque ptr types have a size in bits of 0. The legalised type is an i64 or vector of i64s, which do have a size. Because of this difference in size, target hook getMemoryOpCost modelled stores of ptr types as extending/truncating load/stores. Now we just check for opaque ptr types and return the legalised cost. This makes stores of pointers cheaper, and as a result we now SLP vectorise the changed test case. Differential Revision: https://reviews.llvm.org/D140193
-
Lorenzo Chelini authored
Use op separator to improve code navigation. Reviewed By: hanchung Differential Revision: https://reviews.llvm.org/D139917
-
Sjoerd Meijer authored
-
HanSheng Zhang authored
When promoting a phi in a catchswitch block to memory, we cannot insert load/store instruction in that block, and need to insert them inside all successors instead. Fixes https://github.com/llvm/llvm-project/issues/59185. Differential Revision: https://reviews.llvm.org/D138641
-
Nikita Popov authored
Currently InstCombine folds using the `return replaceInstUsesWith(V, Builder.CreateFoo())` pattern do not preserve the original name of the instruction. To preserve the name, you either have to use something like `return FooInst::Create(...)` which is usually less nice, or go out of the way to preserve the name with takeName(). We often don't do that. This patch instead preserves the name in replaceInstUsesWith() when replacing a named instruction with an unnamed instruction. To be conservative, I also added a zero-use check, which is a proxy for the case where the instruction was just created, rather than an existing one reused. Possibly we could drop that part. As InstCombine tests are robust against renames this does not cause any test diffs, so I regenerated a random test to show the effects. Differential Revision: https://reviews.llvm.org/D140192
-
Nemanja Ivanovic authored
The combiner for BUILD_VECTOR that merges consecutive loads into a wide load had two issues: - It didn't check that the input loads all have the same input chain - It didn't update nodes that are chained to the original loads to be chained to the new load This caused issues with bootstrap when 3c4d2a03 was committed. This patch fixes the issue so it can unblock this commit. Differential revision: https://reviews.llvm.org/D140046
-
Nikita Popov authored
Add an operands() method on SCEV, which forwards to the operands() method of individual SCEV expressions.
-
Archibald Elliott authored
This change: - Modifies the ACLE code to allow the new SLC value (3) for the prefetch target. - Introduces a new intrinsic, @llvm.aarch64.prefetch which matches the PRFM family instructions much more closely, and can represent all values for the PRFM immediate. The target-independent @llvm.prefetch intrinsic does not have enough information for us to be able to lower to it from the ACLE intrinsics correctly. - Lowers the acle calls to the new intrinsic on aarch64 (the ARM lowering is unchanged). - Implements code generation for the new intrinsic in both SelectionDAG and GlobalISel. We specifically choose to continue to support lowering the target-independent @llvm.prefetch intrinsic so that other frontends can continue to use it. Differential Revision: https://reviews.llvm.org/D139443
-
Dani Ferreira Franco Moura authored
Reviewed By: krasimir Differential Revision: https://reviews.llvm.org/D140211
-
Archibald Elliott authored
This feature adds upstream support for FEAT_RASv2 and FEAT_PFAR. Both are system-register-only, but FEAT_RAS is behind the command-line extension "+ras", so FEAT_RASv2 is behind "+rasv2". This patch includes support for ID_AA64MMFR4_EL1. This is an ID system register so it is not behind any feature flags. Differential Revision: https://reviews.llvm.org/D139936
-
Michael Buch authored
The `clang::TypePrinter` has recently been changed to suppress defaulted integral template parameters in D139986. Differential Revision: https://reviews.llvm.org/D139986
-
Nikita Popov authored
Use a consistent type for the operands() methods of different SCEV types. Also make the API consistent by only providing operands(), rather than also providin op_begin() and op_end() for some of them.
-
serge-sans-paille authored
And sneak in a small storage optimization of OptTable::PrefixChars
-
Backl1ght authored
Reviewed By: HazardyKnusperkeks, MyDeveloperDay Differential Revision: https://reviews.llvm.org/D140105
-
Nikita Popov authored
-
Nikita Popov authored
-
Joseph Huber authored
Summary: We use the dynamic HSA file to forward declare needed definitions from the HSA runtime if not present at build time. These definitions were not included so using them caused problems on systems without it if used. Just add them.
-
Nikita Popov authored
-
Guillaume Chatelet authored
Differential Revision: https://reviews.llvm.org/D139110
-
Jean Perier authored
Lower procedure ref to user defined elemental procedure when: - there are no arguments that may be dynamically optional - for functions, the result has no length parameters - the reference can be unordered - there are not character by value arguments This uses the recently added hlfir.elemental operation and tools. The "core" of the argument preparation is shared between elemental and non elemental calls (genUserCalls is code moved without any functional changes) Differential Revision: https://reviews.llvm.org/D140118
-
Nikita Popov authored
-
Michael Buch authored
After this patch, in the following snippet: ``` template <typename T> Foo {}; template <template <typename T> class CT = Foo> Bar {}; Bar<> b; ``` The debug-info entry for the `CT` template parameter will have a `DW_AT_default_value (true)` attached to it. Differential Revision: https://reviews.llvm.org/D139989 -
Michael Buch authored
This is in preparation for Clang to emit `DW_AT_default_value` for defaulted template template parameters. Differential Revision: https://reviews.llvm.org/D139989
-
Michael Buch authored
DWARFv5 added support for labelling template parameters with DW_AT_default_value to indicate whether the particular instantiation defaulted parameter. The current implementation only supports a limited set of possible cases. Namely for non-value-dependent integral template parameters and simple type template parameters. Useful cases that don't work are: 1. Type template parameters with defaults that are themselves templates. E.g., ``` template<typename T1, typename T2 = Foo<T1>> class C1; template<typename T = Foo<int>> class C2; etc. ``` 2. Template template parameters `clang::isSubstitutedDefaultArgument` already implement the required logic to determine whether a template argument is defaulted. This patch re-uses this logic for DWARF CodeGen. Differential Revision: https://reviews.llvm.org/D139988
-
Michael Buch authored
This patch handles default integral non-type template parameters. After this patch the clang TypePrinter will omit default integral template arguments when the `PrintingPolicy::SuppressDefaultTemplateArgs` option is specified and sets us up to be able to re-use `clang::isSubstitutedDefaultArgument` from the DWARF CodeGen component. Differential Revision: https://reviews.llvm.org/D139986
-
Michael Buch authored
**Summary** A use-case has come up in DWARF CodeGen where we want to determine whether a particular template argument matches the default template parameter declaration. Re-using this TypePrinter component there allows us to avoid duplicating most of this code and immediately allows us to cover a wider range of use-cases than the DWARF CodeGen does today.
-