Jason Molenda [Fri, 27 Jan 2023 17:37:34 +0000 (09:37 -0800)]
Don't flag memory-only mach-o corefiles as invalid
It is possible to have a memory-only mach-o corefile, with the
threads provided by an os-plugin thread provider, or a scripted
process, in Python.
Differential Revision: https://reviews.llvm.org/D142662
rdar://
102579544
Joseph Huber [Fri, 27 Jan 2023 17:29:47 +0000 (11:29 -0600)]
[LinkerWrapper] Add support for --[no-]whole-archive into the linker wrapper
Summary:
This patch adds support for `--[no-]whole-archive` to the linker
wrapper. This allows us to bypass the symbol resolution logic that is
normally used for static archives. For multi-architecture binaries this
also allows us to build for every single member.
Stefan Gränitz [Fri, 27 Jan 2023 15:48:05 +0000 (16:48 +0100)]
[Verifier][WinEH] Check funclet tokens on intrinsic calls that may lower to function calls
WinEHPrepare requires funclet operand bundles ("tokens") on function calls from EH funclets to prevent them from getting removed as "implausible" calls. This includes calls to intrinsic functions that lower to function calls in the course of IR transformations (e.g. ObjC ARC runtime calls).
We can not detect such cases in WinEHPrepare itself, because at this point they mixed up with valid implausible calls. These must be removed to guarantee that the EH backend can assign unique colors and EH state numbers to all blocks.
This patch allows the IR Verifier to detect missing and dangling funclet tokens. Non-conforming IR becomes illegal and miscompilations are detected early. In order to find funclet pad instructions for funclets that extend over multiple blocks, we have to calculate EH funclet colors. As coloring can be expensive, it runs on-demand and results are cached per function.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D138123
Stefan Gränitz [Tue, 24 Jan 2023 11:29:53 +0000 (12:29 +0100)]
Lift EHPersonalities from Analysis to IR (NFC)
Computing EH-related information was only relevant for analysis passes so far. Lifting it to IR will allow the IR Verifier to calculate EH funclet coloring and validate funclet operand bundles in a follow-up step.
Reviewed By: rnk, compnerd
Differential Revision: https://reviews.llvm.org/D138122
Matthias Springer [Fri, 27 Jan 2023 16:49:26 +0000 (17:49 +0100)]
[mlir][sparse] Implement BufferizableOpInterface for additional ops
The handling of unknown ops will be tightened in a subsequent change. All sparse_tensor ops should implement BufferizableOpInterface, otherwise, they are treated as "unknown" and additional buffer allocs/copies may be inserted around them.
Differential Revision: https://reviews.llvm.org/D142005
Matthias Springer [Fri, 27 Jan 2023 16:49:14 +0000 (17:49 +0100)]
[mlir][sparse][NFC] Disallow writing into sparse_tensor.to_... results
Writing into the memrefs returned by `sparse_tensor.to_values` etc. can cause additional copies during bufferization.
Differential Revision: https://reviews.llvm.org/D142728
Joseph Huber [Fri, 27 Jan 2023 16:44:16 +0000 (10:44 -0600)]
[LinkerWrapper][NFC] Remove unused options
Summary:
These options are no longer used, we don't need to keep them.
Michael Buch [Fri, 27 Jan 2023 14:17:02 +0000 (14:17 +0000)]
[lldb][CXXModuleHandler] Set TemplateArgument::IsDefaulted
Since https://reviews.llvm.org/D141827 this field gets used
to print type names. Thus propagate it after importing TemplateArguments
from modules.
**Testing**
* Confirmed that this fixes the ongoing `import-std-module` test
failures.
Differential Revision: https://reviews.llvm.org/D142714
Michael Buch [Fri, 27 Jan 2023 14:09:48 +0000 (14:09 +0000)]
[clang][ASTImporter] Propagate TemplateArgument::IsDefaulted during import
With https://reviews.llvm.org/D141826 `TemplateArgument`s have an
additional field that indicates their defaulted-ness. This gets
used during debug-info generation and in the `clang::TypePrinter`.
This patch copies the field during the import process so consumers
of the ASTImporter can benefit from the other Clang components that
read the field.
**Testing**
* Added unit-test
* Checked that this fixes (in addition to a follow-up LLDB patch)
fix current test failures in LLDB
Differential Revision: https://reviews.llvm.org/D142713
Matthias Springer [Fri, 27 Jan 2023 16:25:55 +0000 (17:25 +0100)]
[mlir][NFC] GreedyPatternRewriteDriver: Merge region-based and multi-op-based drivers
Deduplicate large parts of the worklist processing (`GreedyPatternRewriteDriver::processWorklist`).
The new class hierarchy is as follows:
```
GreedyPatternRewriteDriver (abstract)
^
|
-----------------------------------
| |
RegionPatternRewriteDriver MultiOpPatternRewriteDriver
```
Also update the Markdown documentation.
Differential Revision: https://reviews.llvm.org/D141396
Sacha Ballantyne [Fri, 27 Jan 2023 15:31:42 +0000 (15:31 +0000)]
[flang] Add Count to simplified intrinsics
This patch adds a simplfiied version of count for the simplify intrinsics pass, allowing the function to be inlined.
This was done specifically to help improve performance for exchange2, and provides a ~12% performance increase.
Reviewed By: vzakhari, Leporacanthicus
Differential Revision: https://reviews.llvm.org/D142209
Nico Weber [Fri, 27 Jan 2023 16:26:55 +0000 (11:26 -0500)]
[gn] merge
650bbc56203c9
Needed to link e.g. LexTests after
ca446037af0.
Aaron Ballman [Fri, 27 Jan 2023 16:17:42 +0000 (11:17 -0500)]
Correct the link to the latest C DR status page for C11 and C17
We were linking against:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2148.htm
However, the latest DR page for the 400s is:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm
Tue Ly [Fri, 27 Jan 2023 15:15:46 +0000 (10:15 -0500)]
[libc][math] Implement asinhf function correctly rounded for all rounding modes.
Implement asinhf function correctly rounded for all rounding modes.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D142681
Mark de Wever [Fri, 27 Jan 2023 16:01:55 +0000 (17:01 +0100)]
[libc++] Disables a test in clang-17.
This test already had issues and bumping main to 17 causes them to fail
again.
Florian Hahn [Fri, 27 Jan 2023 16:02:29 +0000 (16:02 +0000)]
[SCCP] Add test cases with switch on range containing undef.
Aaron Ballman [Fri, 27 Jan 2023 16:01:12 +0000 (11:01 -0500)]
Stop diagnosing member and array access in offsetof as an extension
This was a mistake from
e7300e75b51a7e7d4e81975b4be7a6c65f9a8286
(https://reviews.llvm.org/D133574) caused by us accidentally tracking
an older copy of the C DR list for DR496. The text in
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_496 makes
it clear that subobjects are allowed, which means member and array
access expressions are allowed.
This backs out the changes from the previous commit that relate to this
diagnostic.
Nico Weber [Fri, 27 Jan 2023 15:59:54 +0000 (10:59 -0500)]
[gn] port
a3b0dde4edb9 (llvm-cov -> Debuginfod dep)
Samuel Parker [Fri, 27 Jan 2023 15:31:54 +0000 (15:31 +0000)]
Revert "[DAGCombine] fp_to_sint isSaturatingMinMax"
This reverts commit
85395af27241ab9c8d5763b8afcaa07f1bab26d5.
This is causing trouble with scalable vectors.
Lucas Prates [Wed, 25 Jan 2023 12:15:00 +0000 (12:15 +0000)]
[NFC][AArch64] Get extension strings directly from ArchInfo in target parser
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D142541
Tue Ly [Mon, 9 Jan 2023 15:05:41 +0000 (10:05 -0500)]
[libc][cmake] Fix LIBC_TARGET_OS query from compiler triple for `darwin`.
Currently LIBC_TARGET_OS query from compiler triple returns `apple` for
macOS. This change will fix it back to `darwin` as before.
Differential Revision: https://reviews.llvm.org/D141282
Tom Stellard [Fri, 27 Jan 2023 14:57:35 +0000 (06:57 -0800)]
Workflows: Fix version-check.py script for when there is no RC tag yet
Reviewed By: thieta
Differential Revision: https://reviews.llvm.org/D142598
Matthias Springer [Fri, 27 Jan 2023 14:44:12 +0000 (15:44 +0100)]
[mlir] GreedyPatternRewriteDriver: Move strict mode to GreedyPatternRewriteDriver
`strictMode` is moved to GreedyRewriteConfig to simplify the API and state of rewriter classes. The region-based GreedyPatternRewriteDriver now also supports strict mode.
MultiOpPatternRewriteDriver becomes simpler: fewer method must be overridden.
Differential Revision: https://reviews.llvm.org/D142623
Florian Hahn [Fri, 27 Jan 2023 14:09:25 +0000 (14:09 +0000)]
[SCCP] Use range info to prove AddInst has NSW flag.
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 [Fri, 27 Jan 2023 13:14:41 +0000 (14:14 +0100)]
[mlir] GreedyPatternRewriteDriver: All entry points take a config
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 [Fri, 27 Jan 2023 13:03:57 +0000 (13:03 +0000)]
[lldb][Target] GetScratchTypeSystems: sort TypeSystems with strict weak ordering
`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 [Tue, 24 Jan 2023 17:44:15 +0000 (17:44 +0000)]
[NFC][AArch64] Get default features directly from ArchInfo and CpuInfo objects
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 [Mon, 23 Jan 2023 11:12:38 +0000 (11:12 +0000)]
[NFC][AArch64] Use optional returns in target parser instead of 'invalid' objects
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 [Mon, 23 Jan 2023 12:14:17 +0000 (13:14 +0100)]
Add clang_CXXMethod_isExplicit to libclang
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, "explicit-constructor.cpp" and
"explicit-conversion-function.cpp", were added to "clang/test/Index", to
ensure that the behavior of the new function is correct for constructors
and conversion functions, respectively.
The "get-cursor.cpp", "index-file.cpp" and
"recursive-cxx-member-calls.cpp" regression files in "clang/test/Index"
were updated as they were affected by the new "(explicit)" tag.
A binding for the new function was added to libclang's python's
bindings, in "clang/bindings/python/clang/cindex.py", as the
"is_explicit_method" method under `Cursor`.
An accompanying test was added to
"clang/bindings/python/tests/cindex/test_cursor.py", mimicking the
regression tests for the C side.
The current release note for Clang, "clang/docs/ReleaseNotes.rst" was
modified to report the new addition under the "libclang" section.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D140756
Shivam Gupta [Fri, 27 Jan 2023 11:59:00 +0000 (17:29 +0530)]
[Docs] Fix a statement wrt instruction alignment of 0
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 [Fri, 27 Jan 2023 11:52:01 +0000 (12:52 +0100)]
[flang][hlfir] Handle box and non constant must_free in end_associate.
Differential Revision: https://reviews.llvm.org/D142700
Jean Perier [Fri, 27 Jan 2023 11:49:55 +0000 (12:49 +0100)]
[flang][hlfir] Handle scalar to array in hlfir.assign codegen.
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 [Fri, 27 Jan 2023 11:13:31 +0000 (11:13 +0000)]
Revert "[lldb] Add support for DW_AT_default_value in template params"
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 [Fri, 27 Jan 2023 11:14:10 +0000 (12:14 +0100)]
[mlir][transforms] CSE ops with multiple regions
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 [Fri, 27 Jan 2023 11:12:10 +0000 (11:12 +0000)]
[PowerPC] ppc64-P9-vabsd.ll - add some basic ISD::ABDS test coverage
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 [Fri, 27 Jan 2023 10:49:25 +0000 (11:49 +0100)]
[mlir][transforms] Simplify OperationEquivalence and CSE
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 [Fri, 27 Jan 2023 10:09:13 +0000 (11:09 +0100)]
[mlir] GreedyPatternRewriteDriver: Entry point takes single region
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 [Thu, 26 Jan 2023 14:36:44 +0000 (15:36 +0100)]
[memref][Transform][NFC] Improve the doc for masked_vectorize
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 [Mon, 23 Jan 2023 14:01:08 +0000 (14:01 +0000)]
[MLIR] Fix tensor shapes in Toy chapter 1
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 [Fri, 27 Jan 2023 09:49:16 +0000 (10:49 +0100)]
[mlir] GreedyPatternRewriteDriver: Make classes single-use
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 [Fri, 27 Jan 2023 09:41:45 +0000 (10:41 +0100)]
[mlir][NFC] GreedyPatternRewriteDriver: Remove OpPatternRewriteDriver
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 [Fri, 27 Jan 2023 09:19:50 +0000 (10:19 +0100)]
[mlir] GreedyPatternRewriteDriver: Enqueue ancestors in MultiOpPatternRewriteDriver
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 [Tue, 24 Jan 2023 13:05:47 +0000 (13:05 +0000)]
[mlir][Conversion] Rename the MemRefToLLVM pass
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 [Thu, 26 Jan 2023 14:02:34 +0000 (14:02 +0000)]
[mlir] fail gracefull in CallOpSignatureConversion
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 [Fri, 27 Jan 2023 08:35:32 +0000 (15:35 +0700)]
Revert "[JT][CT] Preserve exisiting BPI/BFI during JumpThreading"
This reverts commit
26e7cb24cb5dfa560683064d37f560558f00aa67.
Andrzej Warzynski [Mon, 23 Jan 2023 19:01:04 +0000 (19:01 +0000)]
[mlir][linalg] Make Linalg vectorizer lower affine.apply
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 [Thu, 26 Jan 2023 11:47:08 +0000 (12:47 +0100)]
[clang][Interp][NFC] Print parent class name of methods
in Function::dump().
Timm Bäder [Tue, 24 Jan 2023 18:58:09 +0000 (19:58 +0100)]
[clang][Interp][NFC] Remove an unnecessary isArray() check
We already do an isPrimitiveArray() check, so no need for the isArray()
check.
Evgeniy Brevnov [Fri, 25 Nov 2022 10:29:27 +0000 (17:29 +0700)]
[JT][CT] Preserve exisiting BPI/BFI during JumpThreading
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 [Thu, 5 Jan 2023 11:55:29 +0000 (12:55 +0100)]
[clang][Interp][NFC] Add GetPtrBasePop opcode
Change GetPtrBase to *not* pop the base pointer and add a *Pop variant.
This will be used in later patches.
Timm Bäder [Sat, 7 Jan 2023 11:05:05 +0000 (12:05 +0100)]
[clang][Interp] Implement __builtin_assume
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 [Fri, 27 Jan 2023 04:45:02 +0000 (23:45 -0500)]
[OpenMP] Fix stack overflow for test bug54082.c
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 [Fri, 27 Jan 2023 03:25:16 +0000 (03:25 +0000)]
[lldb][Test][NFC] TestCreateClassTemplateDecl: make variable names more readable
Suggested in https://reviews.llvm.org/D140030
Michael Buch [Fri, 27 Jan 2023 03:08:39 +0000 (03:08 +0000)]
[lldb][NFC] Build fix: use TemplateParameterInfos public APIs instead of accessing private members
Fixes build failures caused by a faulty rebase
in `
a29e06bbeaad7012ac85b221f1aaba3fe1d5fd35`
Differential Revision: https://reviews.llvm.org/D140030
Michael Buch [Thu, 26 Jan 2023 17:52:09 +0000 (17:52 +0000)]
[ReleaseNotes] Add release notes for LLDB/Clang changes to handling of defaulted template arguments
Differential Revision: https://reviews.llvm.org/D142653
Michael Buch [Sun, 15 Jan 2023 03:26:41 +0000 (03:26 +0000)]
[lldb] Add support for DW_AT_default_value in template params
**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 [Sat, 17 Dec 2022 17:32:51 +0000 (17:32 +0000)]
[lldb][TypeSystemClang][NFC] Make TemplateParameterInfos members private
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 [Sat, 21 Jan 2023 01:49:14 +0000 (01:49 +0000)]
[clang][DebugInfo] Check TemplateArgument::IsDefaulted
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 [Sun, 15 Jan 2023 03:37:09 +0000 (03:37 +0000)]
[clang][TypePrinter] Test TemplateArgument::IsDefaulted when omitting default arguments
**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 [Sun, 15 Jan 2023 03:36:50 +0000 (03:36 +0000)]
[clang][TemplateBase] Add IsDefaulted bit to TemplateArgument
**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 [Wed, 25 Jan 2023 17:09:06 +0000 (17:09 +0000)]
[clang][TypePrinter] Support expression template arguments when checking defaultedness
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 [Fri, 27 Jan 2023 02:23:23 +0000 (18:23 -0800)]
[test] Remove unused `unittest2` import from concurrent_base.py
Phoebe Wang [Fri, 27 Jan 2023 01:24:57 +0000 (09:24 +0800)]
[X86][ConstraintFP] Model `MXCSR` for function call
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
Jordan Rupprecht [Fri, 27 Jan 2023 02:02:16 +0000 (18:02 -0800)]
[test] Remove unused `unittest2` import
Emilia Dreamer [Fri, 27 Jan 2023 01:56:11 +0000 (03:56 +0200)]
[clang-format] Disallow templates to be followed by literal
There should not be any cases where the angle brackets of template
parameters are directly followed by a literal. It is more likely that a
comparison is taking place instead.
This patch makes the TokenAnnotator prefer to annotate < and > as
operators when directly followed by a literal. A similar check already
exists for literals directly *before* potential template args.
Fixes https://github.com/llvm/llvm-project/issues/60140
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D142139
Hanhan Wang [Wed, 18 Jan 2023 00:44:32 +0000 (16:44 -0800)]
[mlir][tensor] Add a tiling interface registration for pack/unpack only.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D141977
Jez Ng [Fri, 27 Jan 2023 01:28:58 +0000 (20:28 -0500)]
[NFC] Optimize vector usage in lld
By using emplace_back, as well as converting some loops to for-each, we can do more efficient vectorization.
Make copy constructor for TemporaryFile noexcept.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D139552
Tom Stellard [Thu, 26 Jan 2023 23:18:58 +0000 (15:18 -0800)]
test-release.sh: Use parallel xz for packaging the binaries
Reviewed By: amyk, dim, hans
Differential Revision: https://reviews.llvm.org/D142417
Jordan Rupprecht [Thu, 26 Jan 2023 22:29:48 +0000 (14:29 -0800)]
[test][lldb-vscode] Fix unclean shutdown in test_terminate_commands
This test manually sends `terminateCommands` to shutdown, but then the test attempts another `terminateCommands` request in test tear down, which fails since it's already torn down. This error is ignored in LLDB's old fork of unittest2, but will be reported as a test failure in `unittest` from the Python standard library. Use `disconnectAutomatically` to avoid terminating twice.
Benjamin Kramer [Thu, 26 Jan 2023 22:25:15 +0000 (23:25 +0100)]
[bazel] Add missing dependency after
55cf0de35e
Slava Zakharin [Thu, 26 Jan 2023 22:20:47 +0000 (14:20 -0800)]
[flang] Fixed restrictions checking for OpenACC loop-associated constructs.
CheckDoConcurrentClauseRestriction and CheckTileClauseRestriction expect
that the construct has associated DoConstruct, while it is not set
when the do-loop has no loop control. The change is to skip the clauses
checks, when the do-loop does not have the loop control.
An alternative fix would be to associate the DoConstruct even when
the do-loop has no loop control and let Check*ClauseRestriction run their
checks, but I am not sure if associating invalid DoConstruct is a good idea.
This fixes failure in Semantics/OpenACC/acc-canonicalization-validity.f90
reported in D142279.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D142652
Slava Zakharin [Thu, 26 Jan 2023 22:17:13 +0000 (14:17 -0800)]
[flang] Fixed uninitialized std::unique_ptr dereference.
This fixes unittest failures reported in D142279:
flang-Unit :: Frontend/./FlangFrontendTests/5/7
flang-Unit :: Frontend/./FlangFrontendTests/6/7
Nicolas Vasilache [Thu, 26 Jan 2023 20:30:54 +0000 (12:30 -0800)]
[mlir][Linalg] Adding a greedy packing transform dialect op.
This PR adds a `pack_greedily` transform operation that infers the packing for gemm
subcomputations embedded within in any LinalgOp and packs accordingly.
A normalization step guarantees that we get the innermost op dimensions in one of `8`
possible `(m, n, k)` orders, specified as a parameter, from which we can emit all
packed forms.
The current implementation takes an arbitrary LinalgOp and tries to pack it along
the specified dimensions with specified sizes and inner dim permutation.
This achieves a new level of normalization and generalization for any `n-D`
LinalgOp that contains a gemm embedded within it:
we will always see a predictable packed form for any of these ops.
Differential Revision: https://reviews.llvm.org/D142661
Elizabeth Andrews [Thu, 26 Jan 2023 21:51:56 +0000 (13:51 -0800)]
[SYCL] Fix test to conform to SYCL2020
Dominik Adamski [Tue, 17 Jan 2023 09:51:48 +0000 (03:51 -0600)]
[OpenMP][OMPIRBuilder]Move SIMD alignment calculation to LLVM Frontend
Currently default simd alignment is defined by Clang specific TargetInfo class.
This class cannot be reused for LLVM Flang. That's why default simd alignment
calculation has been moved to OMPIRBuilder which is common for Flang and Clang.
Previous attempt: https://reviews.llvm.org/D138496 was wrong because
the default alignment depended on the number of built LLVM targets.
If we wanted to calculate the default alignment for PPC and we hadn't specified
PPC LLVM target to build, then we would get 0 as the alignment because
OMPIRBuilder couldn't create PPCTargetMachine object and it returned 0 as
the default value.
If PPC LLVM target had been built earlier, then OMPIRBuilder could have created
PPCTargetMachine object and it would have returned 128.
Differential Revision: https://reviews.llvm.org/D141910
Reviewed By: jdoerfert
Joseph Huber [Thu, 26 Jan 2023 21:00:24 +0000 (15:00 -0600)]
[LinkerWrapper] Fix `-Bsymbolic` being sent to the compiler and not the linker
Summary:
Clang doesn't warn on `-B` options passed to it. This one is not
forwarded to the linker which results in some tests failing when
offloading to x86_64 with the `bfd` linker.
Daniel Thornburgh [Mon, 24 Oct 2022 22:35:00 +0000 (15:35 -0700)]
Reland: [llvm-cov] Look up object files using debuginfod
Reviewed By: gulfem
Differential Revision: https://reviews.llvm.org/D136702
WuXinlong [Thu, 26 Jan 2023 20:54:00 +0000 (12:54 -0800)]
[RISCV] Add MC support of RISCV Zcb Extension
This patch add the instructions of Zcb extension.
Instructions in zcb extensions shorten part of bit manipulation instructions.
Co-authored-by: Craig Topper <craig.topper@sifive.com>
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D131141
Kazu Hirata [Thu, 26 Jan 2023 20:29:48 +0000 (12:29 -0800)]
[Support] Remove findFirstSet and findLastSet
This patch removes findFirstSet and findLastSet as there are no uses
left in LLVM.
I am not aware of any uses of findFirstSet and findLastSet in the
open-source world outside LLVM, so I am skipping the deprecation step.
Differential Revision: https://reviews.llvm.org/D142603
Mike Hommey [Thu, 26 Jan 2023 20:28:09 +0000 (21:28 +0100)]
[extract_symbols.py] Filter out more symbols for MSVC
This strips out about 5k symbols.
Fixes https://github.com/llvm/llvm-project/issues/60109
Reviewed By: john.brawn
Differential Revision: https://reviews.llvm.org/D142431
Louis Dionne [Wed, 25 Jan 2023 18:09:39 +0000 (13:09 -0500)]
[libc++] Add documentation for reproducing CI issues locally
Differential Revision: https://reviews.llvm.org/D142566
LLVM GN Syncbot [Thu, 26 Jan 2023 19:41:53 +0000 (19:41 +0000)]
[gn build] Port
36080434a885
Louis Dionne [Fri, 2 Dec 2022 21:45:49 +0000 (13:45 -0800)]
[libc++] Move the definition of aligned allocation helpers outside of <new>
They are not needed in <new> -- in fact they are only needed in .cpp files.
Getting those out of the way makes the headers smaller and also makes it
easier to use the library on platforms where aligned allocation is not
available.
Differential Revision: https://reviews.llvm.org/D139231
Ivan Kosarev [Thu, 26 Jan 2023 17:44:43 +0000 (17:44 +0000)]
[CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().
https://reviews.llvm.org/D142405 made this function relying on the
LLVM_NATIVE_ARCH be defined, which is not necessarily the case for
third-party projects that include LLVM as their part.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D142610
Paul Kirth [Thu, 26 Jan 2023 17:53:19 +0000 (17:53 +0000)]
[llvm][docs] Update old metadata syntax in examples
This patch updates examples in the documentation to match the existing
convention. Calls to intrinsics that have metadata arguments were not
included.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D142651
Artem Belevich [Wed, 25 Jan 2023 20:12:32 +0000 (12:12 -0800)]
[NVPTX] Do not addrspacecast AS-specific kernel arguments.
Fixes https://github.com/llvm/llvm-project/issues/46954
The assumption that generic pointers passed to a CUDA kernel is CUDA-specific
and should not be applied to non-CUDA compilations. Addrspacecasts to global AS
and back should never be applied to AS-specific pointers.
In order to make tests actually do the testing for non-CUDA compilation, we need
to get TargetMachine from the TargetPassConfig, instead of passing it explicitly
as a pass constructor argument.
Differential Revision: https://reviews.llvm.org/D142581
Joseph Huber [Thu, 26 Jan 2023 17:23:21 +0000 (11:23 -0600)]
[OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode
The `OpenMPOpt` pass is pivotal to the performance of many OpenMP
offloading programs. When we perform non-LTO builds with OpenMP we used
to link the OpenMP deviceRTL individually for each TU. This lead to us
getting an additional attributor run on the combined runtime and user
code. When we used LTO we lost a run and suffered a large performance
degradation. This patch simply adds in the extra `OpenMPOpt` pass that
we miss into the LTO pipeline. This patch fixes the performance
regression shown in applications that used OpenMP offloading in LTO
mode.
Previously, this wasn't legal to do as we could emit new runtime calls
into the module. That was fixed by D142646.
Depends on D142646
Fixes https://github.com/llvm/llvm-project/issues/60300
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D142650
Joseph Huber [Thu, 26 Jan 2023 17:13:56 +0000 (11:13 -0600)]
[OpenMP] Make OpenMPOpt aware of the OpenMP runtime's status
The `OpenMPOpt` pass contains optimizations that generate new calls into
the OpenMP runtime. This causes problems if we are in a state where the
runtime has already been linked statically. Generating these new calls
will result in them never being resolved. We should indicate if we are
in a "post-link" LTO phase and prevent OpenMPOpt from generating new
runtime calls.
Generally, it's not desireable for passes to maintain state about the
context in which they're called. But this is the only reasonable
solution to static linking when we have a pass that generates new
runtime calls.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D142646
Zahira Ammarguellat [Wed, 25 Jan 2023 22:11:07 +0000 (17:11 -0500)]
__arithmetic_fence enforces ordering on expression evaluation when fast-math
is enabled.
In fast math mode some floating-point optimizations are performed such as
reassociation and distribution.
For example, the compiler may transform (a+b)+c into a+(b+c). Although these
two expressions are equivalent in integer arithmetic, they may not be in
floating-point arithmetic. The builtin tells the compiler that the expression
in parenthesis can’t be re-associated or distributed.
__arithmetic_fence(a+b)+c is not equivalent to a+(b+c).
This patch adds the support of the builtin to SPIR target.
Differential Revision: https://reviews.llvm.org/D142583
Erich Keane [Thu, 26 Jan 2023 19:11:29 +0000 (11:11 -0800)]
[NFC][Concepts] Change the Source Range of Concepts ParamMatching
As came up in the discussion on
https://reviews.llvm.org/rG12cb1cb3720de8d164196010123ce1a8901d8122
We were asserting because the attempt to print a note found that our
source range for a immediately declared constraint (as a part of
Parameter Mapping Substitution) wasn't in order.
However, it doesn't really make sense to have the location of this be
the whole list of template arguments, as that would result in the range
being:
bool func(std::thing<char*> auto foo) {}
^^^^^^^^^^^^^^^
Even if done correctly. Instead, this patch makes the range be just
'foo' in this case (or a pointer right after 'auto' if unnamed).
Arthur Eubanks [Wed, 25 Jan 2023 19:25:35 +0000 (11:25 -0800)]
[lld] Remove transitional legacy pass manager flags
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D142571
Joseph Huber [Thu, 26 Jan 2023 19:02:22 +0000 (13:02 -0600)]
[Clang][NFC] Fix out-of-date comments on 'clang-offload-bundler'
Summary:
These comments are confusing as the `clang-offload-bundler` is no longer
used by these toolchains.
einvbri [Thu, 26 Jan 2023 14:23:22 +0000 (08:23 -0600)]
[analyzer] Fix crash exposed by D140059
Change https://reviews.llvm.org/D140059 exposed the following crash in
Z3Solver, where bit widths were not checked consistently with that
change. This change makes the check consistent, and fixes the crash.
```
clang: <root>/llvm/include/llvm/ADT/APSInt.h:99:
int64_t llvm::APSInt::getExtValue() const: Assertion
`isRepresentableByInt64() && "Too many bits for int64_t"' failed.
...
Stack dump:
0. Program arguments: clang -cc1 -internal-isystem <root>/lib/clang/16/include
-nostdsysteminc -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection
-analyzer-config crosscheck-with-z3=true -verify reproducer.c
#0 0x00000000045b3476 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
<root>/llvm/lib/Support/Unix/Signals.inc:567:22
#1 0x00000000045b3862 PrintStackTraceSignalHandler(void*)
<root>/llvm/lib/Support/Unix/Signals.inc:641:1
#2 0x00000000045b14a5 llvm::sys::RunSignalHandlers()
<root>/llvm/lib/Support/Signals.cpp:104:20
#3 0x00000000045b2eb4 SignalHandler(int)
<root>/llvm/lib/Support/Unix/Signals.inc:412:1
...
#9 0x0000000004be2eb3 llvm::APSInt::getExtValue() const
<root>/llvm/include/llvm/ADT/APSInt.h:99:5
<root>/llvm/lib/Support/Z3Solver.cpp:740:53
clang::ASTContext&, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&, bool)
<root>/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h:552:61
```
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D142627
Sanjay Patel [Thu, 26 Jan 2023 18:03:46 +0000 (13:03 -0500)]
[InstSimplify] X && !(X || Y) --> false
https://alive2.llvm.org/ce/z/7J8Exr
This is a commuted variant that was not included in:
D138853 /
f2973327496fc966c4e89597
Sanjay Patel [Thu, 26 Jan 2023 17:30:37 +0000 (12:30 -0500)]
[InstSimplify] add commuted variants of logical and/or pattern; NFC
Existing tests were added with D138853, but that patch failed
to handle all of the commutes. The poison-safety behavior is
symmetric, so I'm not duplicating all of the tests that were
added with that patch.
Stanislav Mekhanoshin [Wed, 25 Jan 2023 20:07:30 +0000 (12:07 -0800)]
[AMDGPU] Split dot7 feature
Differential Revision: https://reviews.llvm.org/D142507
Jonas Paulsson [Thu, 19 Jan 2023 18:46:34 +0000 (12:46 -0600)]
[SystemZ] Add atomicrmw tests for i128 (NFC).
Review: Ulrich Weigand
Alex Brachet [Thu, 26 Jan 2023 18:18:21 +0000 (18:18 +0000)]
[CMake] Remove libLTO from Fuchsia toolchain
Differential Revision: https://reviews.llvm.org/D142649
Paul Kirth [Tue, 19 Jul 2022 22:55:41 +0000 (22:55 +0000)]
[clang-doc] Reduce duplicate code with template
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D142564
Jay Foad [Thu, 26 Jan 2023 17:27:56 +0000 (17:27 +0000)]
[flang] Fix dereference of std::optional with no value
Differential Revision: https://reviews.llvm.org/D142648