- Jan 04, 2022
-
-
Oleg Smolsky authored
We want to deal with non-default constructors that just happen to contain constant initializers. There was already a negative test case, it is now a positive one. We find and refactor this case: struct PositiveNotDefaultInt { PositiveNotDefaultInt(int) : i(7) {} int i; }; -
luxufan authored
Address the advice proposed at patch D105429 . Use [Low, Low+size) to represent bits. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D107250
-
Egor Zhdan authored
This is a preparation for another change in the watchOS/tvOS availability logic. It is extracted into a separate commit to simplify reviewing and to keep the linter happy at the same time. rdar://81491680 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D116459
-
Saiyedul Islam authored
Cleanup of D105191 after latest clang-format changes. Reviewed By: MyDeveloperDay Differential Revision: https://reviews.llvm.org/D111545
-
Ben Shi authored
Skip operation on the lower byte in int16 logical left shift when shift amount is greater than 8. Skip operation on the higher byte in int16 logical & arithmetic right shift when shift amount is greater than 8. Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D115594
-
Jun Zhan authored
This patch extends `emitUnaryBuiltin` so that we can better emitting IR when implement builtins specified in D111529. Also contains some NFC, applying it to existing code. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D116161
-
Nikita Popov authored
This API is no longer used since bbeaf2aa.
-
Sam McCall authored
-
Nikita Popov authored
As we're only dealing with one type of constant expression here, try to directly cast to GEPOperator.
-
Nikita Popov authored
This fold is not correct, because indices might evaluate to zero even if they are not a literal zero integer. Additionally, this fold would be wrong (in the general case) for non-i8 types as well, due to index overflow. Drop this fold and instead let the target-dependent constant folder compute the actual offset and fold the comparison based on that.
-
Nikita Popov authored
This fold is incorrect, because it assumes that all indices are non-zero. This happens to be true for the test as written, but doesn't hold if we use an extern weak global instead, for which ptrtoint might be zero. Add separate tests for the simple constant int case.
-
Haojian Wu authored
-
Anastasia Stulova authored
Along with the new language mode this commit contains misc small updates for OpenCL 3 and GitHub issues for OpenCL. Differential Revision: https://reviews.llvm.org/D116271
-
Haojian Wu authored
Previously, it was in canSafelySkipNode, which is only used to decide whether we should descend into it and its children, and we still used the incomplete Decltypeloc.getSourceRange() to claim tokens, which will cause some tokens were not claimed correctly. Separate a change of https://reviews.llvm.org/D116536 Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D116586
-
Alexander Belyaev authored
This reverts commit f014ab93. These tests are failing with asan: clang/unittests:format_tests clang/unittests:format_tests clang-tools-extra/unittests:clang_move_tests clang/unittests:tooling_tests clang-tools-extra/test/clang-move:move-template-class.cpp.test clang-tools-extra/test/clang-move:move-multiple-classes.cpp.test clang-tools-extra/test/clang-move:move-used-helper-decls.cpp.test clang-tools-extra/clangd/unittests:clangd_tests clang/test/Format:access-modifiers.cpp.test clang/unittests:rename_tests clang/unittests:rename_tests
-
Haojian Wu authored
This involves separating out the concepts of "which tokens should we descend into this node for" vs "which tokens should this node claim". Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D116218
-
Sam McCall authored
This is separate from --query-driver but can combine with it. Fixes https://github.com/clangd/clangd/issues/642 Differential Revision: https://reviews.llvm.org/D116196
-
Ben Shi authored
Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D115593
-
Rosie Sumpter authored
For loops that contain in-loop reductions but no loads or stores, large VFs are chosen because LoopVectorizationCostModel::getSmallestAndWidestTypes has no element types to check through and so returns the default widths (-1U for the smallest and 8 for the widest). This results in the widest VF being chosen for the following example, float s = 0; for (int i = 0; i < N; ++i) s += (float) i*i; which, for more computationally intensive loops, leads to large loop sizes when the operations end up being scalarized. In this patch, for the case where ElementTypesInLoop is empty, the widest type is determined by finding the smallest type used by recurrences in the loop instead of falling back to a default value of 8 bits. This results in the cost model choosing a more sensible VF for loops like the one above. Differential Revision: https://reviews.llvm.org/D113973
-
Nikolas Klauser authored
Fixes https://github.com/llvm/llvm-project/issues/52902 In debug mode during constant evaluation the iterator was never assigend. There seem to be no other instances of this bug. Reviewed By: Quuxplusone, Mordante, #libc, ldionne Spies: ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D116346
-
LLVM GN Syncbot authored
-
Stanislav Gatev authored
This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev. Reviewed-by: xazax.hun Differential Revision: https://reviews.llvm.org/D116368
-
Nikita Popov authored
Indirect inline asm operands may require the materialization of a memory access according to the pointer element type. As this will no longer be available with opaque pointers, we require it to be explicitly annotated using the elementtype attribute, for example: define void @test(i32* %p, i32 %x) { call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32 %x) ret void } This patch only includes the LangRef change and Verifier updates to allow adding the elementtype attribute in this position. It does not yet enforce this, as this will require changes on the clang side (and test updates) first. Something I'm a bit unsure about is whether we really need the elementtype for all indirect constraints, rather than only indirect register constraints. I think indirect memory constraints might not strictly need it (though the backend code is written in a way that does require it). I think it's okay to just make this a general requirement though, as this means we don't need to carefully deal with multiple or alternative constraints. In addition, I believe that MemorySanitizer benefits from having the element type even in cases where it may not be strictly necessary for normal lowering (https://github.com/llvm/llvm-project/blob/cd2b050fa4995b75b9c36fae16c0d9f105b67585/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp#L4066). Differential Revision: https://reviews.llvm.org/D116531 -
Nikita Popov authored
Fix a build warning.
-
Nikita Popov authored
Currently, the code in TargetLoweringObjectFile only assigns @init_array section type to plain .init_array sections, but not prioritized sections like .init_array.00001. This is inconsistent with the interpretation in the AsmParser (see https://github.com/llvm/llvm-project/blob/791523bae6153b13bb41ba05c9fc89e502cc4a1a/llvm/lib/MC/MCParser/ELFAsmParser.cpp#L621-L632) and upcoming expectations in LLD (see https://github.com/rust-lang/rust/issues/92181 for context). This patch assigns @init_array section type to all sections with an .init_array prefix. The same is done for .fini_array and .preinit_array as well. With that, the logic matches the AsmParser. Differential Revision: https://reviews.llvm.org/D116528
-
Nikita Popov authored
Global ctor evaluation currently models memory as a map from Constant* to Constant*. For this to be correct, it is required that there is only a single Constant* referencing a given memory location. The Evaluator tries to ensure this by imposing certain limitations that could result in ambiguities (by limiting types, casts and GEP formats), but ultimately still fails, as can be seen in PR51879. The approach is fundamentally fragile and will get more so with opaque pointers. My original thought was to instead store memory for each global as an offset => value representation. However, we also need to make sure that we can actually rematerialize the modified global initializer into a Constant in the end, which may not be possible if we allow arbitrary writes. What this patch does instead is to represent globals as a MutableValue, which is either a Constant* or a MutableAggregate*. The mutable aggregate exists to allow efficient mutation of individual aggregate elements, as mutating an element on a Constant would require interning a new constant. When a write to the Constant* is made, it is converted into a MutableAggregate* as needed. I believe this should make the evaluator more robust, compatible with opaque pointers, and a bit simpler as well. Fixes https://github.com/llvm/llvm-project/issues/51221. Differential Revision: https://reviews.llvm.org/D115530
-
Marek Kurdej authored
Fixes https://github.com/llvm/llvm-project/issues/27146. Fixes https://github.com/llvm/llvm-project/issues/52943. Before: ``` namespace ns { void foo() { std::variant<int, double> v; std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr; }}, v); } } // namespace ns int break_me() { int x = 42; return int{[x = x]() { return x; }()}; } ``` got formatted as: ``` namespace ns { void foo() { std::variant<int, double> v; std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr; } } // namespace ns , v); } } // namespace ns int break_me() { int x = 42; return int{[x = x](){return x; } () } ; } ``` Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D116553
-
Markus Böck authored
Exporting a llvm.landingpad operation with the cleanup flag set is currently ignored by the export code. Differential Revision: https://reviews.llvm.org/D116565
-
Nicolas Vasilache authored
By default, the listeners do nothing unless linked in. This revision allows the "Perf" and "Intel" Jit event listeners to be used. The "OProfile" event listener is not enabled at this time, the associated library structure is not well-isolated. Differential Revision: https://reviews.llvm.org/D116552
-
Jim Lin authored
-
Mikael Holmen authored
-
Ben Shi authored
This reverts commit 57232613. There are failures as reported in https://lab.llvm.org/buildbot#builders/16/builds/21638 https://lab.llvm.org/buildbot#builders/104/builds/5394
-
Freddy Ye authored
These two intrinsics are documented o SDM and intrinsic guide. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D116325
-
Ben Shi authored
Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D115593
-
Jim Lin authored
-
Chuanqi Xu authored
The inlined llvm.coro.id should contain the function it refers to. The modifed test would caused the compiler crash under O2. See issue52912 for example.
-
Uday Bondhugula authored
NFC. Fix unused variable warning in PDLToPDLInterp.cpp. Differential Revision: https://reviews.llvm.org/D116571
-
Stanislav Funiak authored
This diff adds support to printing a Value when it is null. We encounter this situation when debugging the PDL bytcode execution (where a null Value is perfectly valid). Currently, the AsmPrinter crashes (with an assert in a cast) when it encounters such Value. We follow the same format used in other printed entities (e.g., null attribute). Reviewed By: mehdi_amini, bondhugula Differential Revision: https://reviews.llvm.org/D116084
-
Stanislav Funiak authored
Presently the result type verification checks if the type is used by a `pdl::OperationOp` inside the matcher. This is unnecessarily restrictive; the type could come from a `pdl::OperandOp or `pdl::OperandsOp` and still be inferrable. Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D116083
-