Jakub Kuderski [Wed, 15 Mar 2023 23:34:21 +0000 (19:34 -0400)]
[ADT] Allow `llvm::enumerate` to enumerate over multiple ranges
This does not work by a mere composition of `enumerate` and `zip_equal`,
because C++17 does not allow for recursive expansion of structured
bindings.
This implementation uses `zippy` to manage the iteratees and adds the
stream of indices as the first zipped range. Because we have an upfront
assertion that all input ranges are of the same length, we only need to
check if the second range has ended during iteration.
As a consequence of using `zippy`, `enumerate` will now follow the
reference and lifetime semantics of the `zip*` family of functions. The
main difference is that `enumerate` exposes each tuple of references
through a new tuple-like type `enumerate_result`, with the familiar
`.index()` and `.value()` member functions.
Because the `enumerate_result` returned on dereference is a
temporary, enumeration result can no longer be used through an
lvalue ref.
Reviewed By: dblaikie, zero9178
Differential Revision: https://reviews.llvm.org/
D144503
Michael Francis [Wed, 1 Mar 2023 00:56:06 +0000 (00:56 +0000)]
[Clang][AIX][p] Manually Claim -p in front end
The current implementation of `-p` does not claim the argument once it
is passed. Since it pushes `-pg` directly, it is only ever referred to
again when linking. As a result, when compiling with `-S`, the compiler
warns that `-p` goes unused even though that is not the case.
With this patch, if both `-p` and `-pg` are passed, the argument that is
passed second will take precedence. `-p` will still throw an error on
unsupported platforms, regardless of precedence.
This revision includes a test case, which has been placed in
`clang/test/Driver/zos-profiling-error.c`. As a result,
`zos-profiling-error.c` has been renamed to `ibm-profiling.c`. This
revision also passes `clang/test/Driver/aix-ld.c`.
Differential Revision: https://reviews.llvm.org/
D145021
Jonas Devlieghere [Wed, 15 Mar 2023 22:44:17 +0000 (15:44 -0700)]
[lldb] Update PythonDataObjectsTests for new exception formatting
PythonDataObjectsTest.TestExceptions started failing because the output
of the python traceback printers is now consistent between python and
cpython [1]. Work around the issue by supporting both variants.
Thanks to Ismail for identifying the root cause.
[1] https://github.com/python/cpython/issues/85203
Tue Ly [Tue, 14 Mar 2023 14:50:02 +0000 (10:50 -0400)]
[libc][NFC] Clean up clang-tidy warnings for `src/__support` and `src/math`.
Clean up some warnings from running libc-lint for these folders.
Reviewed By: michaelrj, sivachandra
Differential Revision: https://reviews.llvm.org/
D146048
Matt Arsenault [Wed, 15 Mar 2023 15:14:49 +0000 (11:14 -0400)]
ConstantFolding: Minor cleanups for is_fpclass
Luke Lau [Wed, 15 Mar 2023 22:00:48 +0000 (22:00 +0000)]
Revert "[RISCV] Enable interleaved access vectorization"
This reverts commit
acc03ad10af4f379a644e3956cb9aca54e40696c.
Luke Lau [Thu, 9 Mar 2023 16:18:28 +0000 (16:18 +0000)]
[RISCV] Enable interleaved access vectorization
The loop vectorizer supports generating interleaved loads and stores via
shuffle patterns for fixed length vectors.
This enables it for RISC-V, since interleaved shuffle patterns can be
lowered to vlseg/vsseg in https://reviews.llvm.org/
D145022
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/
D145155
Roy Jacobson [Sat, 11 Mar 2023 16:40:44 +0000 (18:40 +0200)]
[Clang][Sema] Fix incorrect deletion of default constructors for some unions
If a union has explicit initializers for some members, we shouldn't delete
its default constructor.
Fixes https://github.com/llvm/llvm-project/issues/48416.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/
D145851
Jon Roelofs [Wed, 15 Mar 2023 00:10:05 +0000 (17:10 -0700)]
[AArch64] Add hex comments to mov-imm spellings in the InstPrinter
Differential Revision: https://reviews.llvm.org/
D146105
Jon Roelofs [Wed, 15 Mar 2023 21:21:08 +0000 (14:21 -0700)]
Revert "[AArch64] Add hex comments to mov-imm spellings in the InstPrinter"
This reverts commit
1def3141135c072a1d3e51e82e113dd67b0def97.
Jon Roelofs [Wed, 15 Mar 2023 00:10:05 +0000 (17:10 -0700)]
[AArch64] Add hex comments to mov-imm spellings in the InstPrinter
Differential Revision: https://reviews.llvm.org/
D146105
Zain Jaffal [Wed, 15 Mar 2023 20:47:53 +0000 (20:47 +0000)]
[AArch64] Change GeneratePerfectShuffle to return one destination operand for zip and transpose operations.
The tests added where crashing because zip instruction was returning two destination operands. ZIP according to arm returns only one destination operand.
Reviewed By: dmgreen, fhahn
Differential Revision: https://reviews.llvm.org/
D146055
Dave Lee [Wed, 15 Mar 2023 20:59:46 +0000 (13:59 -0700)]
Revert "[lldb] Change dwim-print to default to disabled persistent results"
This reverts commit
8bad4ae679df6fc7dbd016dccbd3da34206e836b.
Florian Hahn [Wed, 15 Mar 2023 20:57:32 +0000 (20:57 +0000)]
[SCEV] Do not strengthen nuw/nsw flags during get[Zero,Sign]ExtendedExpr.
Modifying AddRecs when constructing other expressions can lead to
surprising changes. It also seems like it is not really beneficial i
most cases.
At the moment, there's a single regression, but we still might be able
to improve the flags at AddRec construction.
Might help with the issue discussed in
D143409.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/
D144051
bixia1 [Tue, 14 Mar 2023 23:05:54 +0000 (16:05 -0700)]
[mlir][sparse] Modify the pivot selection method for quick sort.
Previously, we choose the median of three values. We now choose the median of
five values when the number of values being sorted exceed a threshold
(currently 100). This is similar to std::sort.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/
D145534
Dave Lee [Wed, 8 Mar 2023 21:22:00 +0000 (13:22 -0800)]
[lldb] Change dwim-print to default to disabled persistent results
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.
Ex:
```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```
Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.
Differential Revision: https://reviews.llvm.org/
D145609
Arthur Eubanks [Wed, 15 Mar 2023 18:46:44 +0000 (11:46 -0700)]
Reland [StandardInstrumentations] Check function analysis invalidation in module passes as well
See comments for why we now need to pass in the MAM instead of the FAM.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146160
Arthur Eubanks [Wed, 15 Mar 2023 20:27:36 +0000 (13:27 -0700)]
Revert "[StandardInstrumentations] Check function analysis invalidation in module passes as well"
This reverts commit
d6c0724eb158efcdcd4e31289dcb954a441c4939.
Breaks clang/flang builds.
Arthur Eubanks [Wed, 15 Mar 2023 18:46:44 +0000 (11:46 -0700)]
[StandardInstrumentations] Check function analysis invalidation in module passes as well
See comments for why we now need to pass in the MAM instead of the FAM.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146160
Arthur Eubanks [Tue, 14 Mar 2023 17:44:14 +0000 (10:44 -0700)]
[StandardInstrumentations] Verify function doesn't change if analyses are preserved
Reuse StructuralHash and allow it to be used in non-expensive checks builds.
Move PreservedAnalysisChecker further down StandardInstrumentations so other Instrumentations (e.g. printing) have a chance to run before PreservedAnalysisChecker crashes.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146003
Arthur Eubanks [Tue, 14 Mar 2023 17:25:40 +0000 (10:25 -0700)]
[StandardInstrumentations] Rename -verify-cfg-preserved -> -verify-analysis-invalidation
In preparation for adding more checks under this flag.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146069
Amir Ayupov [Wed, 15 Mar 2023 19:54:41 +0000 (12:54 -0700)]
[BOLT][NFC] Simplify preprocessProfile
Move out prepareToParse lambda, generalize it to handle mem events perf process.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/
D146002
wren romano [Tue, 14 Mar 2023 20:00:29 +0000 (13:00 -0700)]
[mlir][sparse] Updating `Merger::foreachTensorLoopId` to take `LatPointId`
Since all callsites of `foreachTensorLoopId` would simply look up the `LatPointId` to extract its `BitVector`, it's cleaner to let the `Merger` handle that instead. This seems to better capture the intent of the `foreachTensorLoopId` method, and improves decoupling (since it removes a place that leaks the implementation detail that we use `BitVector`).
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/
D146082
Stephen Tozer [Tue, 28 Feb 2023 17:49:59 +0000 (17:49 +0000)]
[Dexter] Add a simple logging class to Dexter
Adds a basic logging class to Dexter that uses the existing PrettyOutput
class for printing and supports 3 levels of verbosity (note, warning,
error). Intended to consolidate the logging logic for Dexter into one
place, removing the need for conditional log statements and making it
easier for us later if we wish to use a more complete logging class.
Reviewed By: Orlando
Differential Revision: https://reviews.llvm.org/
D144983
Zequan Wu [Wed, 15 Mar 2023 18:48:34 +0000 (14:48 -0400)]
[gn build] Manually port
d505d20
Wolfgang Pieb [Wed, 15 Mar 2023 17:04:26 +0000 (10:04 -0700)]
[MSVC][dllexport/dllimport] Propagate a dllexport/dllimport attribute to template baseclass
For the Playstation platform, mimick MSVC in propagating dllexport/dllimport attributes
to an instantiated template base class.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/
D145970
Arthur Eubanks [Wed, 15 Mar 2023 18:45:25 +0000 (11:45 -0700)]
[Debugify/Strip] Fix returned PreservedAnalyses
Arthur Eubanks [Wed, 15 Mar 2023 18:43:11 +0000 (11:43 -0700)]
[WPD] Fix PreservedAnalyses value after runForTesting()
Alexandre Ganea [Wed, 15 Mar 2023 18:19:55 +0000 (14:19 -0400)]
[wasm] Silence 'not all control paths return a value' warning when
building with MSVC on Windows
Alexandre Ganea [Wed, 15 Mar 2023 18:19:12 +0000 (14:19 -0400)]
[DebugInfo][MSF] Silence 'not all control paths return a value' warning
when building with MSVC on Windows
Simon Pilgrim [Wed, 15 Mar 2023 18:14:48 +0000 (18:14 +0000)]
[X86] lzcnt-cmp.ll - enable CMOV on 32-bit LZCNT tests
There are no 32-bit targets that have LZCNT but not CMOV, and this allows us to test the straight line i64 pattern - otherwise we're doing the same branchy code as the 32-bit BSR test
Alexandros Lamprineas [Fri, 3 Mar 2023 15:29:54 +0000 (15:29 +0000)]
[FuncSpec][NFC] Command line option renaming.
Standardize all options with 'funcspec' prefix and shorter abreviations.
Differential Revision: https://reviews.llvm.org/
D145378
Alex Bradbury [Wed, 15 Mar 2023 17:59:15 +0000 (17:59 +0000)]
[clang][RISCV][test] Add test coverage for _Float16 ABI lowering
By the psABI, any test case where a FPR would be used for a float, it
should also be used if you replaced that float with a _Float16. This
doesn't hold true in current Clang for the special cases in the FP
calling convention involving structs. This patch doesn't attempt to fix
that, simply to add coverage.
D145074 contains the fix.
Differential Revision: https://reviews.llvm.org/
D145070
Lei Zhang [Wed, 15 Mar 2023 17:49:27 +0000 (17:49 +0000)]
[mlir][memref] Fold subview into GPU subgroup MMA load/store ops
This commits adds support for folding subview into GPU subgroup
MMA load/store ops.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/
D146150
Simon Pilgrim [Wed, 15 Mar 2023 17:43:56 +0000 (17:43 +0000)]
[DAG] Don't fold zext(logicalshift(zext(x),c)) -> logicalshift(zext(x),c) if the outer zext is free
Avoid widening the shift to a bigger type if the zext would be free anyway
Pulled out of
D146121
Alexey Lapshin [Wed, 15 Mar 2023 15:30:21 +0000 (16:30 +0100)]
[DWARFLinkerParallel] add AddressesMap interface.
This patch is extracted from D96035. It adds AddressesMap map interface
to the DWARFLinkerParallel library. This interface mostly match with the
paired interface from the DWARFLinker library, except that it does
not depend on DIEInfo class.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/
D140788
Yuanfang Chen [Wed, 15 Mar 2023 17:14:58 +0000 (10:14 -0700)]
[Inliner] Assign dummy debug location to the memcpy for byval argument
A similar fix to
D133095.
Fixes https://github.com/llvm/llvm-project/issues/58770.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/
D145607
Mark de Wever [Wed, 15 Mar 2023 17:30:02 +0000 (18:30 +0100)]
[libc++] Fixes accidental CI breakage.
Philip Reames [Wed, 15 Mar 2023 17:15:17 +0000 (10:15 -0700)]
[MSAN] Replace another open-coded convertToBool instance [nfc]
Note that getCleanShadow always returns Constant::getNullValue so the prior code is equivalent to convertToBool.
Philip Reames [Wed, 15 Mar 2023 17:10:00 +0000 (10:10 -0700)]
[MSAN] Inline getShadowTyNoVec into convertShadowToScalar [nfc]
This is an implementation detail of the flattening scheme, so hide it in the implementation thereof. This does require one caller to go through the appropriate utility, but doing that makes the code cleaner anyways.
Simon Pilgrim [Wed, 15 Mar 2023 17:20:37 +0000 (17:20 +0000)]
[X86] Add more thorough testing of the zext(logicalshift(zext(x),c)) -> logicalshift(zext(x),c) fold
Add tests for more extension combos, 64-bit targets and some illegal types
Mark de Wever [Wed, 15 Mar 2023 17:16:13 +0000 (18:16 +0100)]
[NFC][libc++] Uses newer libc++ style.
ibricchi [Wed, 15 Mar 2023 17:14:27 +0000 (13:14 -0400)]
[InlineOrder] Plugin Inline Order
Adds the ability to load a plugin to control the inline order.
This allows developing and distributing inlining heuristics
outside of tree. And together with the inline advisor plugins
allows for fine grained control of the inliner.
The PluginInlineOrderAnalysis class serves as the entry point
for dynamic advisors. Plugins must register instances of this
class to provide their own InlineOrder.
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/
D140637
Jake Egan [Wed, 15 Mar 2023 17:12:04 +0000 (13:12 -0400)]
Revert "[InlineOrder] Plugin Inline Order"
This commit is causing a CMake error on AIX. Will recommit with
a fix.
This reverts commit
e46d8a731535afcf0c5c2a2f6cf3c5d4fb69cd5b.
Stephen Tozer [Tue, 28 Feb 2023 17:14:13 +0000 (17:14 +0000)]
[Dexter] Add target_run_args option
Adds an option to Dexter that passes command line arguments to the
debugged process, following (and in addition to) any arguments given by
the DexCommandLine command.
Differential Revision: https://reviews.llvm.org/
D144979
Paul Kirth [Thu, 2 Mar 2023 22:11:17 +0000 (22:11 +0000)]
[codegen][riscv] Emit CFI directives when using shadow call stack
Currently we don't emit any CFI instructions for the SCS register when
enabling SCS on RISCV. This causes problems when unwinding, since the
SCS register isn't being handled properly.
Reviewed By: mcgrathr
Differential Revision: https://reviews.llvm.org/
D145205
Alex Bradbury [Wed, 15 Mar 2023 16:56:49 +0000 (16:56 +0000)]
[clang][RISCV][NFC] Combine RV32/RV64 ABI tests into single files
After
D134050, it makes sense to combine the RV64 ABI tests into a
single file in order to make it more maintainable (i.e. not having to
split tests based on the combinations of ABIs they're expected to
impact). This patch deletes duplicated tests but doesn't do much further
reorganisation beyond that.
I imagine the logical ordering of tests in the file and comments could
be further improved in the future. My personal feeling is that it's
probably not worth investing the time to try to get this "perfect", and
to instead settle for this incremental step forward. But if there's
reviewer interest in attempting to further iterate, I'm happy to do so.
Differential Revision: https://reviews.llvm.org/
D140400
Mark de Wever [Wed, 15 Mar 2023 17:03:43 +0000 (18:03 +0100)]
[NFC][libc++] Fixes a typo.
Mark de Wever [Wed, 8 Mar 2023 16:08:04 +0000 (17:08 +0100)]
[libc++][charconv] Granularizes the header.
Having the header granularized makes it possible to remove the
dependency on this header in <format>. This <format> header gets
included in more headers due to more usage of std::formatter in the
library. This should reduce the number of transitive includes.
Note formatting the new headers will be done in a followup patch.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/
D145590
Mark de Wever [Fri, 10 Mar 2023 16:31:58 +0000 (17:31 +0100)]
[libc++] Disables transitive includes in library.
I noticed this wile investigating https://llvm.org/PR61314
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/
D145798
Valentin Clement [Wed, 15 Mar 2023 16:35:00 +0000 (17:35 +0100)]
[flang] Detect fir.class nested in fir.box as invalid element type
Catch invalid element type in fir.box in the verifier so
it does not propagate later in lowering.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/
D146078
Philip Reames [Wed, 15 Mar 2023 16:23:51 +0000 (09:23 -0700)]
[RISCV][TTI] Fix indentation and remove tabs [nfc]
Valentin Clement [Wed, 15 Mar 2023 16:27:48 +0000 (17:27 +0100)]
[flang] Avoid to wrap box/class type with box/class
Adapat the fix made in
D146079 to just avoid the type
to be wrapped with an extra fir.box or fir.class. The potential
load is delegated to the code that is after.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/
D146120
Arthur Eubanks [Wed, 15 Mar 2023 16:13:13 +0000 (09:13 -0700)]
[Debugify] Invalidate function analyses
Since debugify inserts instructions.
Tres Popp [Wed, 15 Mar 2023 16:10:41 +0000 (17:10 +0100)]
[mlir][Affine] Use stable sorting to prevent non-determinism
Differential Revision: https://reviews.llvm.org/
D146151
Jakub Kuderski [Wed, 15 Mar 2023 15:56:34 +0000 (11:56 -0400)]
[ADT] Make llvm::is_contained call member `contains` or `find` when available
This makes it so that calling `llvm::is_contained` no longer degrades
performance over member contains, even though both have almost identical
names. This would be the case in most set/map classes that can check for
an element being present in O(1) or O(log n) time vs. linear scan with
`std::find`. For C++17 maps/sets without `.contains`, use `.find` when available,
falling back to a linear scan with `std::find`.
I also considered detecting member contains and triggering a
`static_assert` instead, but decided against it because it's just as easy
to do the right thing and call `.contains`. This would also make some code fail
only when compiled in the C++20 mode when more container types come with
`.contains` member functions.
This was actually already the case with `CommandLine.h` calling `is_contained`
on `SmallPtrSet` and in a recent BOLT patch.
Reviewed By: kazu, dblaikie, MaskRay
Differential Revision: https://reviews.llvm.org/
D146061
Frederic Cambus [Wed, 15 Mar 2023 16:03:22 +0000 (17:03 +0100)]
[compiler-rt] Point UndefinedBehaviorSanitizer link to its own page.
Nikita Popov [Wed, 15 Mar 2023 16:03:27 +0000 (17:03 +0100)]
[InstCombine] Add additional test for icmp eq/ne with bool load (NFC)
Nikita Popov [Wed, 15 Mar 2023 15:51:32 +0000 (16:51 +0100)]
[ASAN] Use AI.getAllocationSize() helper (NFC)
Kazu Hirata [Wed, 15 Mar 2023 15:46:32 +0000 (08:46 -0700)]
Use *{Map,Set}::contains (NFC)
Differential Revision: https://reviews.llvm.org/
D146104
Alex Bradbury [Wed, 15 Mar 2023 15:35:01 +0000 (15:35 +0000)]
[clang][RISCV][NFC][test] Move riscv-abi.cpp and riscv{32,64}-*abi.c tests to use update_cc_test_checks.py
This patch implements an initial step towards refactoring our ABI tests
(moving them to update_cc_test_checks.py). Future patches combine them.
Differential Revision: https://reviews.llvm.org/
D134050
Nikita Popov [Wed, 15 Mar 2023 15:42:02 +0000 (16:42 +0100)]
[InstCombine] Regenerate test checks (NFC)
Arthur Eubanks [Tue, 14 Mar 2023 17:13:18 +0000 (10:13 -0700)]
[StandardInstrumentations] Only turn on -verify-cfg-preserved by default in expensive checks builds
https://llvm-compile-time-tracker.com/compare.php?from=
3fd42f50d8aadb4d0c348ac17cd2115c1b0564a4&to=
50c37f6fc62a1e7bb4f0e307c89f760d42dbe4e9&stat=instructions:u
shows that this is fairly expensive, 5-10% increase in compile time, and I'd like to add more similar checks under the same flag.
This matches the legacy pass manager.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146068
Arthur Eubanks [Wed, 15 Mar 2023 15:36:28 +0000 (08:36 -0700)]
[gn build] Manually port fe7b38
Arthur Eubanks [Tue, 14 Mar 2023 21:25:57 +0000 (14:25 -0700)]
[PassManager] Run PassInstrumentation after analysis invalidation
This allows instrumentation to inspect cached analyses to verify them.
The CGSCC PassInstrumentation previously ran `runAfterPass()` on the original SCC, but really it should be running on UpdatedC when relevant since that's the relevant SCC after the pass.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D146096
Valentin Clement [Wed, 15 Mar 2023 15:31:58 +0000 (16:31 +0100)]
[flang] Rebox the polymorphic argument in merge intrinsic
When fsource or tsource is not polymorphic, the result is not
polymorphic. Rebox the polymoprhic arguement so the dynamic
type of the result is correct.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/
D146133
Alexey Lapshin [Mon, 13 Mar 2023 15:13:41 +0000 (16:13 +0100)]
[DWARFLinker][DWARFv5] add support for DW_FORM_implicit_const form.
This patch adds handling of DW_FORM_implicit_const form.
Differential Revision: https://reviews.llvm.org/
D146047
Konstantina Mitropoulou [Mon, 13 Mar 2023 21:58:31 +0000 (14:58 -0700)]
[AMDGPU] Update mul.ll with auto-generated checks
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/
D145990
Simon Pilgrim [Wed, 15 Mar 2023 15:12:58 +0000 (15:12 +0000)]
[X86] add-and-not.ll - add 32-bit test coverage
Philip Reames [Wed, 15 Mar 2023 14:39:14 +0000 (07:39 -0700)]
[ASAN] Initial support memory checks on scalable vector typed allocas
This patch adjusts the memory instrumentation to account for scalable vector types in allocas. Note that we don't allow scalable vector globals, so we don't need to update that codepath.
A couple points.
First, this simply disables the optimization for scalable allocas. We can revisit this in the future, but it requires a bit of plumbing to get scalable object sizes through the visitor to be useful.
Second, I am simply disabling stack poisoning for scalable vector allocas. This is mostly for staging the change as I can't write a working test for memory instrumentation without doing so. I don't think it's unreasonable to do on it's own basis as without the bailout, we crash the compiler.
Differential Revision: https://reviews.llvm.org/
D145259
Jakub Kuderski [Wed, 15 Mar 2023 14:43:55 +0000 (10:43 -0400)]
[ADT][mlir][NFCI] Do not use non-const lvalue-refs with enumerate
Replace references to enumerate results with either result_pairs
(reference wrapper type) or structured bindings. I did not use
structured bindings everywhere as it wasn't clear to me it would
improve readability.
This is in preparation to the switch to zip semantics which won't
support non-const lvalue reference to elements:
https://reviews.llvm.org/
D144503.
I chose to use values instead of const lvalue-refs because MLIR is
biased towards avoiding `const` local variables. This won't degrade
performance because currently `result_pair` is cheap to copy (size_t
+ iterator), and in the future, the enumerator iterator dereference
will return temporaries anyway.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
D146006
Hristo Hristov [Wed, 15 Mar 2023 14:23:53 +0000 (15:23 +0100)]
[libc++][spaceship] Implement `operator<=>` for `map` and `multimap`
Implements parts of P1614R2: `operator<=>` for `map` and `multimap`
Reviewed By: #libc, philnik
Spies: philnik, libcxx-commits, yaxunl
Differential Revision: https://reviews.llvm.org/
D145976
pvanhout [Wed, 15 Mar 2023 12:28:33 +0000 (13:28 +0100)]
[AMDGPU] Avoid constant bus limitation on V_BFE GISel pattern
For
D141247 - if that pattern was used by GISel it could cause constant bus limitation failures.
Just use inline immediates instead of S_MOV to avoid the issue.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/
D146131
Sander de Smalen [Wed, 15 Mar 2023 09:21:48 +0000 (09:21 +0000)]
[AArch64][SVE] Fix the indexed addressing mode when FI = 0.
This is an alternative fix to
D145497, which also addresses
https://github.com/llvm/llvm-project/issues/60918
In
D124457 which added the original code for this, @efriedma pointed
out that it wasn't safe to assume that FI #0 would be allocated at offset
0, but that part of the patch went in without any changes.
The downside of this solution is that any access to an object on the
stack that has been allocated at SP + 0, still gets moved to a separate
register first, which degrades performance.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/
D146056
Carlos Alberto Enciso [Wed, 15 Mar 2023 13:30:24 +0000 (13:30 +0000)]
[llvm-debuginfo-analyzer] README
llvm-debuginfo-analyzer is a command line tool that processes debug
info contained in a binary file and produces a debug information
format agnostic “Logical View”, which is a high-level semantic
representation of the debug info, independent of the low-level
format.
https://discourse.llvm.org/t/llvm-dev-rfc-llvm-dva-debug-information-visual-analyzer/62570
This patch:
Contains notes collected during the development, review and test.
It describes limitations, know issues and future work.
Reviewed By: Orlando
Differential Revision: https://reviews.llvm.org/
D144857
Simon Pilgrim [Wed, 15 Mar 2023 13:22:16 +0000 (13:22 +0000)]
[DAG] TargetLowering::ShrinkDemandedOp - rename Demanded arg to DemandedBits. NFC
Make it clear this is referring to DemandedBits not DemandedElts.
Igor Kushnir [Wed, 15 Mar 2023 13:21:41 +0000 (09:21 -0400)]
[libclang] Add index option to store preambles in memory
This commit allows libclang API users to opt into storing PCH in memory
instead of temporary files. The option can be set only during CXIndex
construction to avoid multithreading issues and confusion or bugs if
some preambles are stored in temporary files and others - in memory.
The added API works as expected in KDevelop:
https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/283
Differential Revision: https://reviews.llvm.org/
D145974
Matthias Springer [Wed, 15 Mar 2023 10:49:55 +0000 (11:49 +0100)]
[mlir][Transforms] OperationFolder: Remove redundant `create` API
These functions are available on the `OpBuilder` API.
Differential Revision: https://reviews.llvm.org/
D146126
Nicolas Vasilache [Tue, 14 Mar 2023 21:37:58 +0000 (14:37 -0700)]
[mlir][Transform] NFC - Refactor forall mapping to threads and blocks into one thing
Differential Revision: https://reviews.llvm.org/
D146095
Simon Pilgrim [Wed, 15 Mar 2023 11:36:00 +0000 (11:36 +0000)]
[DAG] mergeStore - peek through truncates when finding dead store(trunc(load())) patterns
Extend the existing store(load()) removal code to account for intermediate truncates that some targets won't remove with canCombineTruncStore - we only care about the load/store MemoryVT.
Fixes regression from
D146121
Jonas Paulsson [Wed, 8 Feb 2023 18:37:47 +0000 (19:37 +0100)]
[Clang] Give warning for an underaligned 128-bit __sync library call.
On SystemZ, int128 values are generally aligned to only 8 bytes per the ABI
while 128 bit atomic ISA instructions exist with a full 16 byte alignment
requirement.
__sync builtins are emitted as atomicrmw instructions which always require
the natural alignment (16 bytes in this case), and they always get it
regardless of the alignment of the value being addressed.
This patch improves this situation by giving a warning if the alignment is
not known to be sufficient. This check is done in CodeGen instead of in Sema
as this is currently the only place where the alignment can be computed. This
could/should be moved into Sema in case the alignment computation could be
made there eventually.
Reviewed By: efriedma, jyknight, uweigand
Differential Revision: https://reviews.llvm.org/
D143813
Shao-Ce SUN [Wed, 15 Mar 2023 05:06:10 +0000 (13:06 +0800)]
[Flang][RISCV] Emit target features for RISC-V
Fix the issue of .o file generated by `Flang`
with `Flags` info is 0x0 under RISC-V.
Reviewed By: awarzynski, kiranchandramohan
Differential Revision: https://reviews.llvm.org/
D145883
Tom Stellard [Wed, 15 Mar 2023 11:19:01 +0000 (04:19 -0700)]
lit: Fix formatting in README.rst
This was preventing lit from being uploaded to pypi.
Reviewed By: mgorny
Differential Revision: https://reviews.llvm.org/
D143419
Matt Arsenault [Mon, 6 Feb 2023 15:49:50 +0000 (11:49 -0400)]
InstCombine: Handle folding fcmp of 0 into llvm.is.fpclass
This needs to consider the denormal mode.
Matt Arsenault [Wed, 15 Feb 2023 09:27:34 +0000 (05:27 -0400)]
Reapply "InstCombine: Fold is.fpclass(x, fcZero) to fcmp oeq 0"
This reverts commit
458ad6900e6635e4640229d40e6f713147e52de7.
Archibald Elliott [Wed, 15 Mar 2023 10:38:11 +0000 (10:38 +0000)]
[AArch64] Assembly Support for FEAT_GCS/FEAT_CHK
This implements support for two new 2022 A-profile extensions:
- FEAT_CHK - Check Feature Status Extension
- FEAT_GCS - Guarded Control Stacks
FEAT_CHK is mandatory from armv8.0-a, but is in the hint space so
there's no clang command-line flag for it, and we only print the hint as
`chkfeat x16` at v8.9a and above, to be compatible when using a
non-integrated assembler that might not yet know about the extension.
FEAT_GCS is optional from armv9.4-a onwards. It is enabled using `+gcs`
in a clang `-march=` or `-mcpu=` option string, or using a
`.arch_extension gcs` assembly directive.
This patch includes changes by Ties Stuij, Tomas Matheson, and Keith
Walker.
Differential Revision: https://reviews.llvm.org/
D145563
Alexey Lapshin [Mon, 27 Feb 2023 16:59:30 +0000 (17:59 +0100)]
[DWARFLinker][DWARFv5] Support debug_loclists.
This patch adds support of DWARFv5 .debug_loclists table.
As DWARFLinker resolves relocations, it is able to always
use DW_FORM_addr instead of DW_FORM_addrx. DW_FORM_addrx
helps to minimize number of relocations, it is also used for
split DWARF. Both of these cases are not relevant for the
DWARFLinker. Thus, this patch converts all DW_FORM_addrx
forms into the DW_FORM_addr. And, as the result, it converts
location lists of DW_FORM_loclistx form into the DW_FORM_sec_offset.
For the --update case all DW_FORM_addrx, DW_FORM_loclistx
are preserved as is.
Depends On
D145499
Differential Revision: https://reviews.llvm.org/
D145680
Kadir Cetinkaya [Wed, 15 Mar 2023 08:12:58 +0000 (09:12 +0100)]
[clangd] Respect WantDiags when emitting diags from possibly stale preambles
Differential Revision: https://reviews.llvm.org/
D146116
David Spickett [Wed, 15 Mar 2023 09:56:39 +0000 (09:56 +0000)]
Reland "[lldb] Refactor CrashReason"
This reverts commit
71c4d186f1cf247f1aa45f4fd1b38f350b68d123.
The reinterpret casts were not needed.
JP Lehr [Wed, 15 Mar 2023 09:58:01 +0000 (05:58 -0400)]
[OpenMP][libomptarget][AMDGPU] Update print launch info
Clean up for the AMD-specific kernel launch info in the NextGen Plugins.
- Fixes a mistake introduced with the initial commit that added printing
of an AMD-only property.
- Removes another AMD-only property (not clear on upstream status)
- Adds some more comment to what info is printed.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/
D145924
Simon Pilgrim [Wed, 15 Mar 2023 09:56:22 +0000 (09:56 +0000)]
[DAG] Fold multiple insert_vector_elt of zero values into an AND mask
This also allows us to make use of the existing isVectorClearMaskLegal shuffle canonicalization
Differential Revision: https://reviews.llvm.org/
D145939
David Spickett [Wed, 15 Mar 2023 09:54:47 +0000 (09:54 +0000)]
Revert "[lldb] Refactor CrashReason"
This reverts commit
af38530ee29c285f3827e33a41edf27c9c3a6767 due
to a build failure on 32 bit.
David Spickett [Thu, 9 Mar 2023 14:32:52 +0000 (14:32 +0000)]
[lldb] Refactor CrashReason
So that there is only one function that NativeThreads call,
which takes a siginfo. Everything else is an internal detail.
Reviewed By: labath, JDevlieghere
Differential Revision: https://reviews.llvm.org/
D146043
Valentin Clement [Wed, 15 Mar 2023 09:37:56 +0000 (10:37 +0100)]
Revert "[flang] Load fir.ref<fir.class<T>> instead of creating a wrong box"
This reverts commit
fbca61c46612a6377b7d7cf5b56573df3c6759e2.
This is causing some issue. Revert for now.
Kito Cheng [Wed, 15 Mar 2023 09:23:42 +0000 (17:23 +0800)]
[libunwind][RISC-V] Rewrite testcase with C as possible.
Fix #60472
The testcase is writen in all inline asm but it seems not well
maintained for the CFI directive, of cause we can fix that, but this
patch also contain another issue is it use s0 and s1 without
store/restore.
This patch proposed another way to testing that, use inline asm to
generate dummy def and use, so compiler will generate store/restore for
the vector register, and then generate the CFI directives.
Also check __riscv_vector as the testcase guard, because the testcase
will read vlenb which is only available when V or zve* extensions is
present.
Reviewed By: MaskRay, asb, #libunwind
Differential Revision: https://reviews.llvm.org/
D145225
Kito Cheng [Wed, 15 Mar 2023 09:21:25 +0000 (17:21 +0800)]
[RISCV] Pass vector argument by stack correctly.
We've a argument lowering logic to prevent floating-point value pass
passed with bit-conversion, but that rule should not applied to vector
arguments.
---
How to pass argument to `foo`:
```
tail call void @foo(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer)
```
`foo` take 13 arguments, first 8 argument pass in GPR, and next 2 LMUL 8 vector
arguments passed in v8-v23, and now we run out of argument register for GPR and
vector register, so we must pass last LMUL 8 vector argument by stack.
Which means we should reserve `vlenb * 8` byte for stack for the last
vector argument.
Reviewed By: craig.topper, asb
Differential Revision: https://reviews.llvm.org/
D145938
Kito Cheng [Wed, 15 Mar 2023 09:20:13 +0000 (17:20 +0800)]
[RISCV] Precommit test to show wrong way to pass scalable FP vector on stack
Test case to demo scaleable vector on stack will cause stack corruption.
Detail explan what happened:
```
tail call void @foo(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer)
```
`foo` take 13 arguments, first 8 argument pass in GPR, and next 2 LMUL 8 vector
arguments passed in v8-v23, and now we run out of argument register for GPR and
vector register, so we must pass last LMUL 8 vector argument by stack.
However LLVM only reserve 8 byte on stack for the LMUL 8 vector
argument, it will cause stack corruption when we try to store that into
stack.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D145934
Alexandros Lamprineas [Wed, 22 Feb 2023 21:53:44 +0000 (21:53 +0000)]
[FuncSpec] Minor refactoring in statistics and debug messages.
* Remove redundant variable `NbFunctionsSpecialized` as it is no longer
used by the cost model.
* Rename statistic `NumFuncSpecialized` to `NumSpecsCreated` as a better
description (the old name confusingly implied number of functions we have
created clones for).
* Same for variable `SpecializedFuncs`. Renamed to `Specializations`.
* Move debug message in the destructor (avoids repetition when MaxIters > 1).
Differential Revision: https://reviews.llvm.org/
D145375
chenglin.bi [Wed, 15 Mar 2023 08:56:45 +0000 (16:56 +0800)]
[InstCombine] Remove one-use limit when it can simplify to a const in the pattern foldICmpUsingBoolRange
This patch follow up
dd31a3b3a5, when the pattern return a constant we needn't limit it to one-use.
chenglin.bi [Wed, 15 Mar 2023 08:28:25 +0000 (16:28 +0800)]
[InstCombine] Precommit tests for one-use check in icmp-range; NFC