- Jan 27, 2023
-
-
Florian Hahn authored
This patch updates SCCP to use the value ranges of AddInst operands to try to prove the AddInst does not overflow in the signed sense and adds the NSW flag. The reasoning is done with makeGuaranteedNoWrapRegion (thanks @nikic for point it out!). Follow-ups will include extending this to more OverflowingBinaryOperators. Depends on D142387. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D142390
-
Matthias Springer authored
The multi-op entry point now also takes a GreedyPatternRewriteConfig and respects config.maxNumRewrites. The scope is also a part of the config now. Differential Revision: https://reviews.llvm.org/D142614
-
Michael Buch authored
`std::sort` requires a comparison operator that obides by strict weak ordering. `operator<=` on pointer does not and leads to undefined behaviour. Specifically, when we grow the `scratch_type_systems` vector slightly larger (and thus take `std::sort` down a slightly different codepath), we segfault. This happened while working on a patch that would in fact grow this vector. In such a case ASAN reports: ``` $ ./bin/lldb ./lldb-test-build.noindex/lang/cpp/complete-type-check/TestCppIsTypeComplete.test_builtin_types/a.out -o "script -- lldb.target.FindFirstType(\"void\")" (lldb) script -- lldb.target.FindFirstType("void") ================================================================= ==59975==ERROR: AddressSanitizer: container-overflow on address 0x000108f6b510 at pc 0x000280177b4c bp 0x00016b7d7430 sp 0x00016b7d7428 READ of size 8 at 0x000108f6b510 thread T0 #0 0x280177b48 in std::__1::shared_ptr<lldb_private::TypeSystem>::shared_ptr[abi:v15006](std::__1::shared_ptr<lldb_private::TypeSystem> const&)+0xb4 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0x177b48) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #1 0x280dcc008 in void std::__1::__introsort<std::__1::_ClassicAlgPolicy, lldb_private::Target::GetScratchTypeSystems(bool)::$_3&, std::__1::shared_ptr<lldb_private::TypeSystem>*>(std::__1::shared_ptr<lldb_private::TypeSystem>*, std::__1::shared_ ptr<lldb_private::TypeSystem>*, lldb_private::Target::GetScratchTypeSystems(bool)::$_3&, std::__1::iterator_traits<std::__1::shared_ptr<lldb_private::TypeSystem>*>::difference_type)+0x1050 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblld b.17.0.0git.dylib:arm64+0xdcc008) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #2 0x280d88788 in lldb_private::Target::GetScratchTypeSystems(bool)+0x5a4 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0xd88788) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #3 0x28021f0b4 in lldb::SBTarget::FindFirstType(char const*)+0x624 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0x21f0b4) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #4 0x2804e9590 in _wrap_SBTarget_FindFirstType(_object*, _object*)+0x26c (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0x4e9590) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #5 0x1062d3ad4 in cfunction_call+0x5c (/opt/homebrew/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/Python:arm64+0xcfad4) (BuildId: c9efc4bbb1943f9a9b7cc4e91fce477732000000200000000100000000000d00) <--- snipped ---> 0x000108f6b510 is located 400 bytes inside of 512-byte region [0x000108f6b380,0x000108f6b580) allocated by thread T0 here: #0 0x105209414 in wrap__Znwm+0x74 (/Applications/Xcode2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51414) (BuildId: 0a44828ceb64337bbfff60b22cd838f0320000 00200000000100000000000b00) #1 0x280dca3b4 in std::__1::__split_buffer<std::__1::shared_ptr<lldb_private::TypeSystem>, std::__1::allocator<std::__1::shared_ptr<lldb_private::TypeSystem>>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<std::__1::shared_pt r<lldb_private::TypeSystem>>&)+0x11c (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0xdca3b4) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #2 0x280dc978c in void std::__1::vector<std::__1::shared_ptr<lldb_private::TypeSystem>, std::__1::allocator<std::__1::shared_ptr<lldb_private::TypeSystem>>>::__push_back_slow_path<std::__1::shared_ptr<lldb_private::TypeSystem> const&>(std::__1::s hared_ptr<lldb_private::TypeSystem> const&)+0x13c (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0xdc978c) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #3 0x280d88dec in std::__1::vector<std::__1::shared_ptr<lldb_private::TypeSystem>, std::__1::allocator<std::__1::shared_ptr<lldb_private::TypeSystem>>>::push_back[abi:v15006](std::__1::shared_ptr<lldb_private::TypeSystem> const&)+0x80 (/Users/mic haelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0xd88dec) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #4 0x280d8857c in lldb_private::Target::GetScratchTypeSystems(bool)+0x398 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0xd8857c) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #5 0x28021f0b4 in lldb::SBTarget::FindFirstType(char const*)+0x624 (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0x21f0b4) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #6 0x2804e9590 in _wrap_SBTarget_FindFirstType(_object*, _object*)+0x26c (/Users/michaelbuch/Git/lldb-build-main-no-modules/lib/liblldb.17.0.0git.dylib:arm64+0x4e9590) (BuildId: ea963d2c0d47354fb647f5c5f32b76d932000000200000000100000000000d00) #7 0x1062d3ad4 in cfunction_call+0x5c (/opt/homebrew/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/Python:arm64+0xcfad4) (BuildId: c9efc4bbb1943f9a9b7cc4e91fce477732000000200000000100000000000d00) #8 0x10627fff0 in _PyObject_MakeTpCall+0x7c (/opt/homebrew/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/Python:arm64+0x7bff0) (BuildId: c9efc4bbb1943f9a9b7cc4e91fce477732000000200000000100000000000d00) #9 0x106378a98 in _PyEval_EvalFrameDefault+0xbcf8 (/opt/homebrew/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/Python:arm64+0x174a98) (BuildId: c9efc4bbb1943f9a9b7cc4e91fce477732000000200000000100000000000d00) ``` Differential Revision: https://reviews.llvm.org/D142709 -
Lucas Prates authored
This updates the AArch64's Target Parser and its uses to capture information about default features directly from ArchInfo and CpuInfo objects, instead of relying on an API function to access them indirectly. Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D142540
-
Lucas Prates authored
This updates the parsing methods in AArch64's Target Parser to make use of optional returns instead of "invalid" enum values, making the API's behaviour clearer. Reviewed By: lenary, tmatheson Differential Revision: https://reviews.llvm.org/D142539
-
Luca Di Sera authored
The new method is a wrapper of `CXXConstructorDecl::isExplicit` and `CXXConversionDecl::isExplicit`, allowing the user to recognize whether the declaration pointed to by a cursor was marked with the explicit specifier. An export for the function, together with its documentation, was added to "clang/include/clang-c/Index.h" with an implementation provided in "clang/tools/libclang/CIndex.cpp". The implementation is based on similar `clang_CXXMethod` implementations, returning a falsy unsigned value when the cursor is not a declaration, is not a declaration for a constructor or conversion function or is not a relevant declaration that was marked with the `explicit` specifier. The new symbol was added to "clang/tools/libclang/libclang.map" to be exported, under the LLVM16 tag. "clang/tools/c-index-test/c-index-test.c" was modified to print a specific tag, "(explicit)", for cursors that are recognized by `clang_CXXMethod_isExplicit`. Two new regression files, "ex...
-
Shivam Gupta authored
This fix https://github.com/llvm/llvm-project/issues/53371 Zero is not a legal alignment. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D142633
-
Jean Perier authored
Differential Revision: https://reviews.llvm.org/D142700
-
Jean Perier authored
The scalar must be placed in memory before creating descriptors and calling the runtime assignment API. Differential Revision: https://reviews.llvm.org/D142698
-
David Spickett authored
This reverts commit 1cf52e540242f968e0cf789587bcf76c01332aeb. Due to test failures on Arm and AArch64 bots: https://lab.llvm.org/buildbot/#/builders/96/builds/34718 (which were obscured by an earlier build failure)
-
Matthias Springer authored
There were issues with the CSE equivalence analysis that have been fixed with D142558. This makes it possible to CSE ops with multiple regions. Differential Revision: https://reviews.llvm.org/D142562
-
Simon Pilgrim authored
Test coverage to ensure D142313 lowers ISD::ABDU -> VABSD but not ISD::ABDS (although I think v4i32 would be compatible with the XVNEGSP trick)
-
Matthias Springer authored
Replace `mapOperands` and `mapResults` with two new callbacks. It was not clear what "mapping" meant and why the equivalence relationship was a property of the Operand/OpResult as opposed to just SSA values. This revision changes the contract of the two callbacks: `checkEquivalent` compares two values for equivalence. `markEquivalent` informs the caller that the analysis determined that two values are equivalent. This simplifies the API because callers do not have to reason about operands/results, but just SSA values. `OperationEquivalence::isEquivalentTo` can be used directly in CSE and there is no need for a custom op equivalence analysis. Differential Revision: https://reviews.llvm.org/D142558
-
Matthias Springer authored
The rewrite driver is typically applied to a single region or all regions of the same op. There is no longer an overload to apply the rewrite driver to a list of regions. This simplifies the rewrite driver implementation because the scope is now a single region as opposed to a list of regions. Note: This change is not NFC because `config.maxIterations` and `config.maxNumRewrites` is now counted for each region separately. Furthermore, worklist filtering (`scope`) is now applied to each region separately. Differential Revision: https://reviews.llvm.org/D142611
-
Quentin Colombet authored
The `transform.structured.masked_vectorize` operator assumes that the iteration space of the given linalg op is smaller than the given vector sizes. Explicitly states this requirement in the description of the operation. Also fix the related comment and assert message in the vectorization code. The wording was flipped. NFC Differential Revision: https://reviews.llvm.org/D142628
-
Thomas Preud'homme authored
In Toy tutorial chapter 1, multiply_transpose() is called with b<2, 3> and c<3, 2> when both parameters should have the same shape. This commit fixes this by instead using c and d as parameters and fix a comment typo where c and d are mentioned to have shape <2, 2> when they actually have shape <3, 2>. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D142622
-
Matthias Springer authored
Less mutable state, more `const`. This is to address a concern about complexity of state in D140304. Differential Revision: https://reviews.llvm.org/D141949
-
Matthias Springer authored
The `MultiOpPatternRewriteDriver` can be reused. This gives us better debug messages and more code reuse. Debug messages such as `** Replace: (op name)` were previously not printed when using the `applyOpPatternsAndFold(Operation *, ...)` overload. Differential Revision: https://reviews.llvm.org/D142613
-
Matthias Springer authored
The `GreedyPatternRewriteDriver` was extended to enqueue ancestors in D140304. With this change, `MultiOpPatternRewriteDriver` behaves the same way. Note: `MultiOpPatternRewriteDriver` now also has a scope that limits how far we go when checking ancestors. By default, this is the first common region of all given ops. Differential Revision: https://reviews.llvm.org/D141945
-
Quentin Colombet authored
Since the recent MemRef refactoring that centralizes the lowering of complex MemRef operations outside of the conversion framework, the MemRefToLLVM pass doesn't directly convert these complex operations. Instead, to fully convert the whole MemRef dialect space, MemRefToLLVM needs to run after `expand-strided-metadata`. Make this more obvious by changing the name of the pass and the option associated with it from `convert-memref-to-llvm` to `finalize-memref-to-llvm`. The word "finalize" conveys that this pass needs to run after something else and that something else is documented in its tablegen description. This is a follow-up patch related to the conversation at: https://discourse.llvm.org/t/psa-you-need-to-run-expand-strided-metadata-before-memref-to-llvm-now/66956/14 Differential Revision: https://reviews.llvm.org/D142463
-
Alex Zinenko authored
Previously, the CallOpSignatureConversion pattern would assert if function signature change affected the number of results. Fail the pattern instead and let the caller propagate failure. Fixes #60186. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D142624
-
Evgeniy Brevnov authored
This reverts commit 26e7cb24.
-
Andrzej Warzynski authored
It is possible that the input to the Linalg vectorizer contains `affine.apply` ops (see the example in [1]). Such operations are not vectarizable at the moment, but this can be fixed by simply converting them to arithmetic operations. This is basically what this patch introduces. The IR change enabled in this patch could be part of a larger set of "linalgOp pre-processing" transformations that happens right before vectorization starts but after we know we can vectorize the op. I am leaving this as a TODO. [1] https://github.com/iree-org/iree/issues/10876. Differential Revision: https://reviews.llvm.org/D142371
-
Timm Bäder authored
in Function::dump().
-
Timm Bäder authored
We already do an isPrimitiveArray() check, so no need for the isArray() check.
-
Evgeniy Brevnov authored
Currently, JT creates and updates local instances of BPI\BFI. As a result global ones have to be invalidated if JT made any changes. In fact, JT doesn't use any information from BPI/BFI for the sake of the transformation itself. It only creates BPI/BFI to keep them up to date. But since it updates local copies (besides cases when it updates profile metadata) it just waste of time. Current patch is a rework of D124439. D124439 makes one step and replaces local copies with global ones retrieved through AnalysisPassManager. Here we do one more step and don't create BPI/BFI if the only reason of creation is to keep BPI/BFI up to date. Overall logic is the following. If there is cached BPI/BFI then update it along the transformations. If there is no existing BPI/BFI, then create it only if it is required to update profile metadata. Please note if BPI/BFI exists on exit from JT (either cached or created) it is always up to date and no reason to invalidate it. Reviewed By: mkazantsev Differential Revision: https://reviews.llvm.org/D136827
-
Timm Bäder authored
Change GetPtrBase to *not* pop the base pointer and add a *Pop variant. This will be used in later patches.
-
Timm Bäder authored
Just ignore it. As part of this, move the Ret and RetVoid implementation to Interp.h, so they can be shared with InterpBuiltin.cpp. Differential Revision: https://reviews.llvm.org/D141193
-
Shilei Tian authored
When `N` is 1024, `int result[N][N]` is obviously large stack that Windows cannot support... Fix #60326. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142684
-
Michael Buch authored
Suggested in https://reviews.llvm.org/D140030
-
Michael Buch authored
Fixes build failures caused by a faulty rebase in `a29e06bb` Differential Revision: https://reviews.llvm.org/D140030
-
Michael Buch authored
Differential Revision: https://reviews.llvm.org/D142653
-
Michael Buch authored
**Summary** This patch makes LLDB understand the `DW_AT_default_value` on template argument DIEs. As a result, type summaries will no longer contain the defaulted template arguments, reducing noise substantially. E.g., Before: ``` (lldb) v nested (std::vector<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator <char> > > > > >) nested = size=0 {} ``` After: ``` (lldb) v nested (std::vector<std::vector<std::basic_string<char> > >) nested = size=0 {} ``` See discussion in https://reviews.llvm.org/D140423 **Testing** * Adjust API tests * Added unit-test Differential Revision: https://reviews.llvm.org/D141828 -
Michael Buch authored
This patch makes the members of `TemplateParameterInfos` only accessible via public APIs. The motivation for this is that `TemplateParameterInfos` attempts to maintain two vectors in tandem (`args` for the template arguments and `names` for the corresponding name). Working with this structure as it's currently designed makes it easy to run into out-of-bounds accesses later down the line. This patch proposes to introduce a new `TemplateParameterInfos::InsertArg` which is the only way to set the `TemplateArgument` and name of an entry and since we require both to be specified we maintain the vectors in sync out-of-the-box. To avoid adding non-const getters just for unit-tests a new `TemplateParameterInfosManipulatorForTests` is introduced that can be used to control internal state from tests.
-
Michael Buch authored
Since `ClassTemplateSpecializationDecl`s now set the `TemplateArgument::IsDefaulted` bit, there's no need to derive it here. Differential Revision: https://reviews.llvm.org/D142333
-
Michael Buch authored
**Summary** This patch allows clients who can't properly construct a `ClassTemplateDecl` to still benefit from the `clang::TypePrinter`s ability to skip printing defaulted template arguments. The clients simply have to call `TemplateArgument::setIsDefaulted` in advance. See discussion in https://reviews.llvm.org/D140423 Differential Revision: https://reviews.llvm.org/D141827
-
Michael Buch authored
**Summary** This patch adds a `IsDefaulted` field to `clang::TemplateArgument`. To prevent memory footprint increase we still 1 bit from `ArgKind`. **Changes** 1. `getIsDefaulted`/`setIsDefaulted` to allow clients to communicate an argument's defaulted-ness to the TypePrinter 2. The `TemplateArgument` properties description had to be changed to make sure we correctly mark the defaulted-ness of arguments that came from a deserialized AST (caught by the HLSL test-suite) 3. The `TemplateArgument` constructors now accept a `IsDefaulted` parameter to simplify construction from the tablegen description. Though if people don't want to clutter the constructors we can instead call `setIsDefaulted` from tablegen 4. When `clang::Sema` checks the template arguments against template parameters we now call `setIsDefaulted`. This makes sure that whenever a specialization decl gets constructed, the defaulted-ness of the associated `TemplateArgument`s has already been deduced. This preserves the immutability of `TemplateArgumentList`s **Background** In LLDB we construct ASTs from debug-info and hand it to clang to perform actions such as printing/formatting a typenames. Some debug formats, specifically DWARF, may only encode information about class template instantiations, losing the structure of the generic class definition. However, the `clang::TypePrinter` needs a properly constructed `ClassTemplateDecl` with generic default argument decls to be able to deduce whether a `ClassTemplateSpecializationDecl` was instantiatiated with `TemplateArgument`s that correspond to the defaults. LLDB does know whether a particular template argument was defaulted, but can't currently tell clang about it. This patch allows LLDB to set the defaulted-ness of a `TemplateArgument` and thus benefit more from `clang::TypePrinter`. See discussion in https://reviews.llvm.org/D140423 **Testing** * Added unit-test * LLDB/clang/llvm test-suite passes Differential Revision: https://reviews.llvm.org/D141826
-
Michael Buch authored
This patch adds support for `TemplateArgument`s of kind `TemplateArgument::Expression` to `clang::isSubstitutedDefaultArgument`. We do so by evaluating both the `Pattern` and `Arg` expression to an `APInt`, if we can, and comparing the results. This will be useful in an upcoming change where `clang::isSubstitutedDefaultArgument` gets called from `clang::Sema` where the `TemplateArgument`s are instantiated as expressions (without being evaluted to `APInt` beforehand). **Testing** - Added unit-tests Differential Revision: https://reviews.llvm.org/D142632
-
Jordan Rupprecht authored
-
Phoebe Wang authored
This patch is inspired by D111433. It would affect the performance under strict FP mode. But it preserves the correct rounding behavior accross function calls. Fixes #59305 Reviewed By: sepavloff Differential Revision: https://reviews.llvm.org/D139549
-