Alexey Lapshin [Fri, 31 Mar 2023 15:10:11 +0000 (17:10 +0200)]
[DWARFLinker][NFC] Make interfaces to be compatible.
This patch makes interface of AddressManager from DWARFLinker
to be compatible with AddressesMap from DWARFLinkerParallel.
This makes both linkers to be interchangeable.
Differential Revision: https://reviews.llvm.org/D147455
4vtomat [Sat, 18 Mar 2023 12:15:24 +0000 (05:15 -0700)]
[RISCV][RISCV][clang] Split out SiFive Vector C intrinsics from riscv_vector.td
Since we don't always need the vendor extension to be in riscv_vector.td,
so it's better to make it be in separated header.
Depends on D148223 and D148680
Differential Revision: https://reviews.llvm.org/D148308
Alexandre Ganea [Tue, 2 May 2023 12:49:35 +0000 (08:49 -0400)]
[llvm][unittests] Silence warning on MSVC after
5b2423183cb3
Differential revision: https://reviews.llvm.org/D149609
Dmitry Chernenkov [Tue, 2 May 2023 12:45:28 +0000 (12:45 +0000)]
4vtomat [Wed, 19 Apr 2023 02:43:57 +0000 (19:43 -0700)]
[RISCV] Split out part of riscv_vector.td to riscv_vector_common.td
This makes other new targets able to reuse predefined classes
in their own *.td files.
Differential Revision: https://reviews.llvm.org/D148680
Nelson Chu [Wed, 18 May 2022 10:03:34 +0000 (03:03 -0700)]
[SiFive][RISCV][clang] Support C intrinsics for xsfvcp extension.
Depends on D147934 and D147935
Differential Revision: https://reviews.llvm.org/D148223
Jay Foad [Tue, 2 May 2023 12:29:51 +0000 (13:29 +0100)]
[CodeGen] Make use of MachineBasicBlock::phis. NFC.
Shilei Tian [Tue, 2 May 2023 12:35:55 +0000 (08:35 -0400)]
Revert "[OpenMP] Make `libomptarget` link against `libomp`"
This reverts commit
dc049a4ea681b1d0a4880bae3e19ae0ef40f6e80.
It causes issue of export target.
Mariya Podchishchaeva [Tue, 2 May 2023 12:20:29 +0000 (08:20 -0400)]
[clang] Do not attempt to zero-extend _BitInt(1) when not required
`ConvertTypeForMem` doesn't return wider type for _BitInt unless it is
used in a bitfield, so no need to extend when trying to initialize a
global variable.
Fixes https://github.com/llvm/llvm-project/issues/62207
Reviewed By: erichkeane, shafik
Differential Revision: https://reviews.llvm.org/D149436
Zhiyao Ma [Tue, 2 May 2023 09:23:19 +0000 (10:23 +0100)]
[ARM] Don't allocate memory if free space in segmented stack is just enough
Assuming that the stack grows downwards, it is fine if the stack
pointer is exactly at the stacklet boundary. We should use
less-or-equal condition when deciding whether to skip new memory
allocation.
Differential Revision: https://reviews.llvm.org/D149315
Kiran Chandramohan [Tue, 2 May 2023 11:29:42 +0000 (11:29 +0000)]
[Flang][OpenMP] Use fir.if instead of scf.if in lastprivate lowering
For finding the last iteration of a loop, or the last section an
if condition is generated. Using scf::if can cause some lowering
issues since the code contained inside it can have branches. Using
fir::if instead ensures that the fir::if is lowered into branches
along with any code contained inside that can generate branches.
Fixes #62458.
Reviewed By: NimishMishra
Differential Revision: https://reviews.llvm.org/D149547
Michael Buch [Mon, 1 May 2023 17:09:54 +0000 (13:09 -0400)]
[lldb][test] TestCPP20Standard.py: make it a libc++ test
We just want to test whether the language switch works.
This is easier to control for libc++, since for bots building
the tests against libstdc++ we might not have the necessary
`<compare>` header available currently.
LU Hongyi [Mon, 1 May 2023 11:05:47 +0000 (07:05 -0400)]
[lldb][DWARFExpression] Fix DW_OP_div to use signed division
This patch resolves an issue where a value
is incorrectly displayed if it is represented
by DW_OP_div.
This issue is caused by lldb evaluating
operands of DW_OP_div as unsigned
and performed unintended unsigned
division.
This issue is resolved by creating two
temporary signed scalar and performing
signed division.
(Addresses GH#61727)
Differential Revision: https://reviews.llvm.org/D147370
Samira Bazuzi [Tue, 2 May 2023 00:08:30 +0000 (00:08 +0000)]
[clang][dataflow] Expose DataflowAnalysisContext from DataflowEnvironment.
This will eliminate the need for more pass-through APIs. Also replace pass-through usages with this exposure.
Reviewed By: ymandel, gribozavr2, xazax.hun
Differential Revision: https://reviews.llvm.org/D149464
Nikita Popov [Tue, 2 May 2023 10:43:12 +0000 (12:43 +0200)]
[EarlyCSE] Only combine metadata for load CSE
There is no need to combine metadata if we're performing store to
load forwarding. In that case we would end up combining metadata
on an unrelated load instruction.
Nikita Popov [Tue, 2 May 2023 10:37:52 +0000 (12:37 +0200)]
[EarlyCSE] Add additional metadata preservation test (NFC)
LLVM GN Syncbot [Tue, 2 May 2023 10:31:09 +0000 (10:31 +0000)]
[gn build] Port
852bf52cc957
Balázs Kéri [Tue, 2 May 2023 07:56:57 +0000 (09:56 +0200)]
[clang-tidy] Add check bugprone-multiple-new-in-one-expression.
Reviewed By: donat.nagy
Fixed test failures with previous commit.
Differential Revision: https://reviews.llvm.org/D138777
Nikita Popov [Tue, 2 May 2023 10:13:53 +0000 (12:13 +0200)]
[LCSSA] Remove unused ScalarEvolution argument (NFC)
After D149435, LCSSA formation no longer needs access to
ScalarEvolution, so remove the argument from the utilities.
David Green [Tue, 2 May 2023 10:05:35 +0000 (11:05 +0100)]
[AArch64] Add sign bits handling for vector compare nodes
This adds ComputeNumSignBits for the NEON vector comparison nodes, which all
either return 0 or -1. Also adds sign_extend_inreg from VASHR+VSHL to show it
performing transforms.
Differential Revision: https://reviews.llvm.org/D148624
Simon Pilgrim [Tue, 2 May 2023 09:42:13 +0000 (10:42 +0100)]
Fix MSVC "truncation of constant value" warnings. NFC.
Simon Pilgrim [Tue, 2 May 2023 09:30:29 +0000 (10:30 +0100)]
Fix MSVC "not all control paths return a value" warnings. NFC.
Vassil Vassilev [Tue, 2 May 2023 09:29:37 +0000 (09:29 +0000)]
[clang-repl] Add a test coverage for nested out-of-line dtor disambiguation.
This came up as a review comment in https://reviews.llvm.org/D148425
Jay Foad [Tue, 2 May 2023 09:29:17 +0000 (10:29 +0100)]
[AMDGPU] Make use of new tablegen operator !range. NFC.
LLVM GN Syncbot [Tue, 2 May 2023 09:28:16 +0000 (09:28 +0000)]
[gn build] Port
7b7a6b641afd
Balázs Kéri [Tue, 2 May 2023 09:23:31 +0000 (11:23 +0200)]
Revert "[clang-tidy] Add check bugprone-multiple-new-in-one-expression."
This reverts commit
1aa36da15369678d94add0f64809b11f95795efd.
Christian Ulmann [Tue, 2 May 2023 09:15:29 +0000 (09:15 +0000)]
[PGO] Avoid potential const_cast UB (NFC)
This commit removes potential UB in the PGO instrumentation passes that
was caused by casting away constness and then potentially modifying the
object.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D148903
LLVM GN Syncbot [Tue, 2 May 2023 09:11:37 +0000 (09:11 +0000)]
[gn build] Port
1aa36da15369
Victor Perez [Mon, 1 May 2023 08:34:32 +0000 (09:34 +0100)]
[mlir][llvm] Add trap intrinsics to the dialect
Define llvm.trap, llvm.debugtrap, and llvm.ubsantrap intrinsics in the
llvm dialect.
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
Differential Revision: https://reviews.llvm.org/D149574
Nikita Popov [Tue, 2 May 2023 09:00:27 +0000 (11:00 +0200)]
[SCEV] Reuse Accum variable when handling GEP flags
The GEP minus the base pointer (which is the pre-inc addrec) is
exactly the Accum value that was already calculated.
Balázs Kéri [Tue, 2 May 2023 07:56:57 +0000 (09:56 +0200)]
[clang-tidy] Add check bugprone-multiple-new-in-one-expression.
Reviewed By: donat.nagy
Differential Revision: https://reviews.llvm.org/D138777
Hans Wennborg [Tue, 2 May 2023 08:31:37 +0000 (10:31 +0200)]
Typo fix
NAKAMURA Takumi [Tue, 2 May 2023 08:02:06 +0000 (17:02 +0900)]
add_tablegen: Quick fix to reflect LLVM_TABLEGEN to llvm-min-tblgen
`sanitizer-x86_64-linux-android` uses LLVM_TABLEGEN.
Nikita Popov [Thu, 27 Apr 2023 10:23:11 +0000 (12:23 +0200)]
[LCSSA] Don't invalidate SCEV
LCSSA currently invalidates SCEV for all instructions for which
LCSSA phi nodes are created. This used to be necessary, because
SCEV has historically tried to maintain LCSSA form as well. As
such, some SCEV uses of the value would have to become uses of
the phi node instead.
However, nowadays SCEV itself no longer maintains LCSSA form.
The SCEV of on LCSSA phi node will be the same as the SCEV of its
argument. LCSSA is instead maintained in the SCEVExpander.
As such, I believe it is no longer necessary to perform any SCEV
invalidation during LCSSA construction.
After this patch the ScalarEvolution argument to the LCSSA utilities
is no longer necessary -- I'll remove it in a followup NFC patch to
keep this patch more concise.
Differential Revision: https://reviews.llvm.org/D149435
Ulrich Weigand [Tue, 2 May 2023 07:33:16 +0000 (09:33 +0200)]
[LLD][MachO] Do not run Mach-O tests on big-endian hosts
Currently, most Mach-O tests fail when executed on a big-endian host. This is
because the Mach-O back-end does not perform the necessary byte swaps when
accessing the (little-endian) binary file format.
For now, simply consider all Mach-O tests unsupported on big-endian hosts,
to enable running the test suite at all on such hosts.
Reviewed by: oontvoo
Differential Revision: https://reviews.llvm.org/D149270
Jonas Devlieghere [Tue, 2 May 2023 07:17:52 +0000 (00:17 -0700)]
[lldb] Remove unused will_modify argument (NFC)
Various OptionValue related classes are passing around will_modify but
the value is never used. This patch simplifies the interfaces by
removing the redundant argument.
Adrian Kuegel [Tue, 2 May 2023 06:37:44 +0000 (08:37 +0200)]
[mlir][Bazel] Adjust BUILD file for changes in
5e118f933b6590cecd7f1afb30845a1594bc4a5d
Théo Degioanni [Tue, 2 May 2023 06:06:12 +0000 (06:06 +0000)]
[mlir][mem2reg] Follow-up adjustments (NFC).
Ajustments to the MLIR mem2reg changes.
Reviewed By: gysit, kuhar
Differential Revision: https://reviews.llvm.org/D149431
Mehdi Amini [Sun, 26 Feb 2023 15:46:01 +0000 (10:46 -0500)]
Introduce MLIR Op Properties
This new features enabled to dedicate custom storage inline within operations.
This storage can be used as an alternative to attributes to store data that is
specific to an operation. Attribute can also be stored inside the properties
storage if desired, but any kind of data can be present as well. This offers
a way to store and mutate data without uniquing in the Context like Attribute.
See the OpPropertiesTest.cpp for an example where a struct with a
std::vector<> is attached to an operation and mutated in-place:
struct TestProperties {
int a = -1;
float b = -1.;
std::vector<int64_t> array = {-33};
};
More complex scheme (including reference-counting) are also possible.
The only constraint to enable storing a C++ object as "properties" on an
operation is to implement three functions:
- convert from the candidate object to an Attribute
- convert from the Attribute to the candidate object
- hash the object
Optional the parsing and printing can also be customized with 2 extra
functions.
A new options is introduced to ODS to allow dialects to specify:
let usePropertiesForAttributes = 1;
When set to true, the inherent attributes for all the ops in this dialect
will be using properties instead of being stored alongside discardable
attributes.
The TestDialect showcases this feature.
Another change is that we introduce new APIs on the Operation class
to access separately the inherent attributes from the discardable ones.
We envision deprecating and removing the `getAttr()`, `getAttrsDictionary()`,
and other similar method which don't make the distinction explicit, leading
to an entirely separate namespace for discardable attributes.
Recommit
d572cd1b067f after fixing python bindings build.
Differential Revision: https://reviews.llvm.org/D141742
Shengchen Kan [Tue, 2 May 2023 05:49:15 +0000 (13:49 +0800)]
[SelectionDAG] Use int64_t to store the integer power of llvm.powi
https://llvm.org/docs/LangRef.html#llvm-powi-intrinsic
The max length of the integer power of `llvm.powi` intrinsic is 32, and
the value can be negative. If we use `int32_t` to store this value, `-Val`
will underflow when it is `INT32_MIN`
The issue was reported in D149033.
Phoebe Wang [Mon, 1 May 2023 14:24:24 +0000 (22:24 +0800)]
[Coverity] Fix unchecked return value, NFC
The `ReversePredicate` should have made sure the reverse predicate is
supported by target, but the check comes from early function and might
be invalid by any mistake. So it's better to double confirm it here.
Differential Revision: https://reviews.llvm.org/D149586
Phoebe Wang [Mon, 1 May 2023 13:59:01 +0000 (21:59 +0800)]
[MC] Remove dead code, NFC
This code was added in
408b5e660300f9, but neither the return value nor
`Res` was used in the following code.
Differential Revision: https://reviews.llvm.org/D149584
4vtomat [Wed, 12 Apr 2023 02:49:14 +0000 (19:49 -0700)]
[RISCV] Add Smaia and Ssaia extensions support
This patch implements 1.0-RC3:
https://github.com/riscv/riscv-aia/releases/download/1.0-RC3/riscv-interrupts-1.0-RC3.pdf
Differential Revision: https://reviews.llvm.org/D148066
Shengchen Kan [Tue, 2 May 2023 05:13:29 +0000 (13:13 +0800)]
Revert "[SelectionDAG] Use logic right shift to avoid loop hang"
This reverts commit
b73229e55543b4ba2b293adcb8b7d6025f01f7d9.
It caused LIT failure on non-X86 targets.
4vtomat [Tue, 25 Apr 2023 06:31:49 +0000 (23:31 -0700)]
[RISCV] Add missing constraints for vwsll
Add missing early clobber and widen constraints for vector crypto instruction: vwsll
Differential Revision: https://reviews.llvm.org/D149127
NAKAMURA Takumi [Tue, 2 May 2023 04:57:35 +0000 (13:57 +0900)]
add_tablegen: Remove LLVM_ENABLE_OBJLIB
- It doesn't work if `ALL_FILES` has `$<TARGET_OBJECTS>` with Makefile generator.
- It was a micro-optimization in the ancient age. (introduced in rGe6bc093b42ff)
Shengchen Kan [Tue, 2 May 2023 03:46:57 +0000 (11:46 +0800)]
[SelectionDAG] Use logic right shift to avoid loop hang
Issue was reported in D149033, `Val` can be negative value and
arithmetic right shift always keeps the sign bit.
BTW, the redundant code `Val = -Val` is removed by this patch.
Jonas Devlieghere [Tue, 2 May 2023 04:04:24 +0000 (21:04 -0700)]
[lldb] Refactor OptionValueProperties to return a std::optional (NFC)
Similar to
fdbe7c7faa54, refactor OptionValueProperties to return a
std::optional instead of taking a fail value. This allows the caller to
handle situations where there's no value, instead of being unable to
distinguish between the absence of a value and the value happening the
match the fail value. When a fail value is required,
std::optional::value_or() provides the same functionality.
Vitaly Buka [Tue, 2 May 2023 04:37:41 +0000 (21:37 -0700)]
Revert "[SimpleLoopUnswitch] unswitch selects"
Revert "Don't loop unswitch vector selects"
Breaks msan. Details in D138526.
This reverts commit
bf089732775520624cb4983bfed6c341e1b4c405.
This reverts commit
e479ed90b591c18873fda68c12946b9d08cbe02f.
Jonas Devlieghere [Tue, 2 May 2023 04:25:12 +0000 (21:25 -0700)]
[lldb] Remove TestExternalEditor.test
Remove TestExternalEditor.test as the code to open the transcript in an
external editor is conditional on lldb running in a graphical session.
As a result this test passes locally but not on the bots.
Jonas Devlieghere [Tue, 2 May 2023 04:23:47 +0000 (21:23 -0700)]
[lldb] Fix warning: extra ';' outside of a function is incompatible with C++98
Fix warning, remove trailing whitespace and fix formatting.
Jonas Devlieghere [Tue, 2 May 2023 04:22:40 +0000 (21:22 -0700)]
[lldb] Fix bug introduced by
fdbe7c7faa54
I didn't account for the scenario where the string was set but was
empty. This commit restores the old behavior and fixes
TestMemoryFind.py.
Timm Bäder [Sun, 30 Apr 2023 17:37:03 +0000 (19:37 +0200)]
[clang][Interp][NFC] Make OptionScope final
Timm Bäder [Sun, 30 Apr 2023 14:02:46 +0000 (16:02 +0200)]
[clang][Interp][NFC] Add documentation for SetLocal
Jonas Devlieghere [Tue, 2 May 2023 03:34:51 +0000 (20:34 -0700)]
[lldb] Refactor OptionValue to return a std::optional (NFC)
Refactor OptionValue to return a std::optional instead of taking a fail
value. This allows the caller to handle situations where there's no
value, instead of being unable to distinguish between the absence of a
value and the value happening the match the fail value. When a fail
value is required, std::optional::value_or() provides the same
functionality.
NAKAMURA Takumi [Tue, 2 May 2023 03:43:16 +0000 (12:43 +0900)]
Add deps on LLVMTableGenCommon even if it is actually unused.
NAKAMURA Takumi [Tue, 2 May 2023 03:19:27 +0000 (12:19 +0900)]
llvm-tblgen: Split out `obj.LLVMTableGenCommon`
`$<TARGET_OBJECTS:llvm-min-tblgen>` was too lazy.
It has `rc.res` in the list with MS toolchain.
Fixup for D146352
Kai Sasaki [Tue, 2 May 2023 02:47:26 +0000 (11:47 +0900)]
[mlir][tosa] Typo in transpose canonicalization message
NAKAMURA Takumi [Fri, 17 Mar 2023 20:04:22 +0000 (05:04 +0900)]
Introduce `llvm-min-tblgen` to build public header files
`llvm-min-tblgen` is capable of building `llvm/include/llvm`;
- `-gen-attrs`
- `-gen-directive-*`
- `-gen-intrinsics-*`
- `-gen-riscv-target-def`
`llvm-min-tblgen` is built and used only when `llvm-tblgen` is built in-tree.
This is not installed.
`llvm-tblgen` is built with complete set and may be installed.
`check-llvm` uses not `llvm-min-tblgen` but `llvm-tblgen`.
`LLVM_TABLEGEN_PROJECT` overrides the definition of `tablegen(project)`.
`LLVM_HEADERS` is used as the overridden prefix for LLVM header generators.
If `EXPORT` is not specified in `add_tablegen`, its tablegen is treated as internal.
Let `llvm-tblgen` depend on `intrinsics_gen`
Depends on D149072
Differential Revision: https://reviews.llvm.org/D146352
NAKAMURA Takumi [Thu, 27 Apr 2023 13:15:46 +0000 (22:15 +0900)]
[CMake] add_tablegen: Rename host tablegen to `${target}-host"
Since `llvm-min-tblgen` has been introduced, `llvm-min-tblgen-host`
would make more sense than `LLVM_HEADERS-tablegen-host`.
Depends on D146352
Differential Revision: https://reviews.llvm.org/D149343
Philip Reames [Tue, 2 May 2023 01:47:28 +0000 (18:47 -0700)]
[RISCV] Use vslide1down idiom for generic build_vector
We had previously been going through the stack.
A couple small notes:
We have the vslide1down idiom in a few other places. As a post patch, I plan to try to common the code a bit.
VF=2 case is still going through the splat + insert path. Picking the optimal sequence for this seems to be a bit fiddly (due to constant mat costs), so I restricted this to cases which would have previously hit the stack.
I'm only handling integer vectors for the moment. Mostly because I don't see the existing vfslide1down ISD nodes being in place. This will be an obvious followup.
One of the test diffs does expose a missing combine - a build_vector with a prefix coming from a vector extract sequence. The code after this is arguably worse (due to domain crossing vs stack store), but I think this is a narrow enough case to be non-blocking for now. Let me know if you disagree.
Differential Revision: https://reviews.llvm.org/D149263
Philip Reames [Tue, 2 May 2023 00:49:35 +0000 (17:49 -0700)]
[RISCV][InsertVSETVLI] Avoid VL toggles for extractelement patterns
Noticed this while looking at some SLP output. If we have an extractelement, we're probably using a slidedown into an destination with no contents. Given this, we can allow the slideup to use a larger VL and clobber tail elements of the destination vector. Doing this allows us to avoid vsetvli toggles in many fixed length vector examples.
Differential Revision: https://reviews.llvm.org/D148834
Ben Shi [Mon, 1 May 2023 08:33:40 +0000 (16:33 +0800)]
[ELF][test] Improve AVR tests
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D149318
KOMATA Manabu [Tue, 2 May 2023 01:34:09 +0000 (18:34 -0700)]
[clang][Driver] Fix crash with unsupported architectures in MinGW and CrossWindows
MinGW and CrossWindows crash if the target is an unsupported target architecture.
Changed it to emit an error message.
Fixes https://github.com/llvm/llvm-project/issues/59545
Reviewed By: MaskRay, mstorsjo
Differential Revision: https://reviews.llvm.org/D148944
Fangrui Song [Tue, 2 May 2023 01:22:49 +0000 (18:22 -0700)]
[Driver] Drop incorrect hint from err_target_unknown_triple
For an unknown target triple, the ", please use -triple or -arch" hint of the
diagnostic is almost always wrong.
For cc1, the error is due to a specified but unknown -triple.
For driver, -triple and -arch are not driver options.
Stefan Pintilie [Mon, 1 May 2023 17:11:47 +0000 (13:11 -0400)]
[PowerPC] Implement DFP add and sub instructions.
Add the following Decimal Floating Point (DFP) instructions for PowerPC.
dadd, daddq, dsub, dsubq
In order to add these instructions a new register class for a pair
of floating point registers is added.
This patch is only to allow the user to specify the instructions in
assembly. There is no scheduling or patterns for the instructions.
Reviewed By: amyk
Differential Revision: https://reviews.llvm.org/D148597
Nikolas Klauser [Fri, 28 Apr 2023 23:26:09 +0000 (16:26 -0700)]
[libc++][PSTL] Simplify pstl_config.h
This is done by removing configurations we don't support.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D149499
LLVM GN Syncbot [Mon, 1 May 2023 23:27:58 +0000 (23:27 +0000)]
[gn build] Port
a50e54fbeb48
Artem Belevich [Thu, 27 Apr 2023 18:10:37 +0000 (11:10 -0700)]
[CUDA] Temporarily undefine __noinline__ when including bits/shared_ptr_base.h
This avoid CUDA compilation errors caused by CUDA headers defining __noinline__
and conflicting with __noinline__ use in libstdc++.
Differential Revision: https://reviews.llvm.org/D149364
Valentin Clement [Mon, 1 May 2023 23:23:46 +0000 (16:23 -0700)]
[flang][openacc] Remove unused variable
Fix buildbot failure after landing D149385
Jorge Gorbe Moya [Mon, 1 May 2023 22:57:53 +0000 (15:57 -0700)]
Re-land "[lldb] Make the libcxx unique_ptr prettyprinter support custom deleters."
This reverts commit
45351120105a7257ccb1e38ec1b1f8a452269da2.
Alex Langford [Fri, 28 Apr 2023 20:23:55 +0000 (13:23 -0700)]
[lldb] Change ObjectValueDictionary to use a StringMap
llvm has a structure for maps where the key's type is a string. Using
that also means that the keys for OptionValueDictionary don't stick
around forever in ConstString's StringPool (even after they are gone).
The only thing we lose here is ordering: iterating over the map where the keys
are ConstStrings guarantees that we iterate in alphabetical order.
StringMap makes no guarantees about the ordering when you iterate over
the entire map.
Differential Revision: https://reviews.llvm.org/D149482
Valentin Clement [Mon, 1 May 2023 23:15:34 +0000 (16:15 -0700)]
[flang][openacc] Add basic support for derived type component in data operand
Add lowering support for derived type component appearing
in a data clause to the newly added data operand operations.
Depends on D149297
Reviewed By: razvanlupusoru, jeanPerier
Differential Revision: https://reviews.llvm.org/D149385
Aart Bik [Mon, 1 May 2023 19:56:26 +0000 (12:56 -0700)]
[mlir][sparse] relax constraints on tensor.cast with pre-rewriting
Reviewed By: wrengr
Differential Revision: https://reviews.llvm.org/D149489
Shilei Tian [Mon, 1 May 2023 23:01:33 +0000 (19:01 -0400)]
[OpenMP] Make `libomptarget` link against `libomp`
In `libomptarget` we use a couple of functions from `libomp`, but we didn't link
`libomptarget` against `libomp`. That will not work on some platforms such
as macOS. A linker error will be encountered because those symbols are not resolved
at link time when building `libomptarget`. This patch simply makes `libomptarget`
link agains `libomp`, makes it a "user" of `libomp`. I think this will not break
the policies between `libomp` and `libomptarget`.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D149617
Mehdi Amini [Mon, 1 May 2023 22:55:58 +0000 (15:55 -0700)]
Revert "Introduce MLIR Op Properties"
This reverts commit
d572cd1b067f1177a981a4711bf2e501eaa8117b.
Some bots are broken and investigation is needed before relanding.
Shilei Tian [Mon, 1 May 2023 22:25:11 +0000 (18:25 -0400)]
[OpenMP] Handle function calls from `libomp` to `libomptarget` correctly
D132005 introduced function calls from `libomp` to `libomptarget` if offloading
is enabled. However, the external function declaration may not always work. For
example, it causes a link error on macOS. Currently it is guarded properly by
a macro, but in order to get OpenMP target offloading working on macOS, it has
to be handled correctly. This patch applies the same idea of how we support
target memory extension by using function pointer indirect call for that function.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D149557
Mehdi Amini [Sun, 26 Feb 2023 15:46:01 +0000 (10:46 -0500)]
Introduce MLIR Op Properties
This new features enabled to dedicate custom storage inline within operations.
This storage can be used as an alternative to attributes to store data that is
specific to an operation. Attribute can also be stored inside the properties
storage if desired, but any kind of data can be present as well. This offers
a way to store and mutate data without uniquing in the Context like Attribute.
See the OpPropertiesTest.cpp for an example where a struct with a
std::vector<> is attached to an operation and mutated in-place:
struct TestProperties {
int a = -1;
float b = -1.;
std::vector<int64_t> array = {-33};
};
More complex scheme (including reference-counting) are also possible.
The only constraint to enable storing a C++ object as "properties" on an
operation is to implement three functions:
- convert from the candidate object to an Attribute
- convert from the Attribute to the candidate object
- hash the object
Optional the parsing and printing can also be customized with 2 extra
functions.
A new options is introduced to ODS to allow dialects to specify:
let usePropertiesForAttributes = 1;
When set to true, the inherent attributes for all the ops in this dialect
will be using properties instead of being stored alongside discardable
attributes.
The TestDialect showcases this feature.
Another change is that we introduce new APIs on the Operation class
to access separately the inherent attributes from the discardable ones.
We envision deprecating and removing the `getAttr()`, `getAttrsDictionary()`,
and other similar method which don't make the distinction explicit, leading
to an entirely separate namespace for discardable attributes.
Differential Revision: https://reviews.llvm.org/D141742
Craig Topper [Mon, 1 May 2023 22:26:17 +0000 (15:26 -0700)]
[RISCV] Don't store CPUKind in CPUInfo. NFC
This field is never used today. If you have a pointer to the row
you can find the CPUKind by subtracting the pointer from the start
of the array.
Craig Topper [Mon, 1 May 2023 22:26:09 +0000 (15:26 -0700)]
[RISCV] Remove INVALID from the list of CPUs in RISCVTargetParser. NFC
This value is never used outside and is only used as a sentinel
internally which we can solve with other means.
Craig Topper [Mon, 1 May 2023 22:26:03 +0000 (15:26 -0700)]
[RISCV] Remove or simplify some StringSwitches in RISCVTargetParser.cpp. NFC
We can iterate over the RISCVCPUInfo table instead of using a
separate StringSwitch.
Noah Goldstein [Mon, 1 May 2023 20:37:23 +0000 (15:37 -0500)]
Recommit "[ValueTracking] Use knownbits interface for determining if `div`/`rem` are safe to speculate" (2nd Try)
Add `poison` checks that where missing.
Reviewed By: nikic
Noah Goldstein [Mon, 1 May 2023 20:37:11 +0000 (15:37 -0500)]
[InstCombine] Fix bug in `FoldOpIntoSelect` where we would incorrectly fold `undef` as constant
D146349 Introduced the ability to use the information from the
`select` condition to deduce constants as we folded a binop into
select. I.e if the `select` cond was `icmp eq %A, 10`, then in the
true-arm of `select`, we would be able to replace usage of `A` with
`10`.
This is broken for vectors that contain `undef` elements. I.e with
`icmp eq %A, <10, undef>`, subsituting `<10, undef>` for `A` can
result in creating a more undefined result than we otherwise would
have.
We fix the issue with simply checking if the candidate constant for
substituting may contain `undef` elements and don't do it in that
case.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D149592
Nikolas Klauser [Fri, 28 Apr 2023 18:02:46 +0000 (11:02 -0700)]
[libc++][PSTL] Fix clang-tidy
Reviewed By: ldionne, #libc
Spies: libcxx-commits, miyuki, carlosgalvezp
Differential Revision: https://reviews.llvm.org/D149500
Shilei Tian [Mon, 1 May 2023 22:22:23 +0000 (18:22 -0400)]
Revert "[OpenMP] Handle function calls from `libomp` to `libomptarget` correctly"
This reverts commit
479e335fc37c06767654141358ea076ac066de11.
The assertion at `kmp_tasking.cpp(29)` is triggered.
Shilei Tian [Mon, 1 May 2023 22:16:32 +0000 (18:16 -0400)]
[OpenMP] Handle function calls from `libomp` to `libomptarget` correctly
D132005 introduced function calls from `libomp` to `libomptarget` if offloading
is enabled. However, the external function declaration may not always work. For
example, it causes a link error on macOS. Currently it is guarded properly by
a macro, but in order to get OpenMP target offloading working on macOS, it has
to be handled correctly. This patch applies the same idea of how we support
target memory extension by using function pointer indirect call for that function.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D149557
LLVM GN Syncbot [Mon, 1 May 2023 21:30:38 +0000 (21:30 +0000)]
[gn build] Port
ade9c3bdca2c
Louis Dionne [Mon, 1 May 2023 21:25:14 +0000 (17:25 -0400)]
[libc++][NFC] Fix typos in documentation
Jim Ingham [Mon, 24 Apr 2023 23:08:27 +0000 (16:08 -0700)]
Improve the help output for `type XXX delete` where XXX is summary, format,
etc...
Differential Revision: https://reviews.llvm.org/D148282
Corentin Jabot [Mon, 23 Jan 2023 21:05:48 +0000 (22:05 +0100)]
[Clang] Fix a crash when recursively callig a default member initializer.
This fixes a regression introduced by
ca61961380, that would lead
to a segfault due to stack exhaustion when recursively calling
a default member initializer.
Fixes #60082
I'm not able to get clang to emit a stack exhaustion warning,
which it seems like it should be able to.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D142401
Jorge Gorbe Moya [Mon, 1 May 2023 21:13:28 +0000 (14:13 -0700)]
Revert "[lldb] Make the libcxx unique_ptr prettyprinter support custom deleters."
This reverts commit
d366da97bd24ddfb91c9f260fa0aaf105d947652.
Nikolas Klauser [Mon, 1 May 2023 21:11:07 +0000 (14:11 -0700)]
[libc++][NFC] Fix synopsis in a few tests
Jonas Devlieghere [Mon, 1 May 2023 21:08:43 +0000 (14:08 -0700)]
[lldb] Add debugger.external-editor setting
Add a new setting (debugger.external-editor) to specify an external
editor. The setting takes precedence over the existing
LLDB_EXTERNAL_EDITOR environment variable.
Differential revision: https://reviews.llvm.org/D149565
Hanhan Wang [Fri, 28 Apr 2023 18:16:26 +0000 (11:16 -0700)]
[mlir][linalg] Relax masked_vectorize(pad) to allow zero low Values.
It only accepted zeros attributes before the revision. It now acccepts
constant-like zero values as well.
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D149474
Nikolas Klauser [Fri, 28 Apr 2023 23:00:14 +0000 (16:00 -0700)]
[libc++][PSTL] Implement std::fill{,_n}
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D149540
Philip Reames [Mon, 1 May 2023 20:54:09 +0000 (13:54 -0700)]
[LV] Refresh some auto-gen tests to reduce diff [nfc]
Teresa Johnson [Mon, 1 May 2023 18:04:59 +0000 (11:04 -0700)]
[MemProf] Recognize hot/cold operator new as replaceable allocations
Follow up to LLVM-side change to allow conversion to hot/cold hinted
operator new, not yet standard but supported by open source tcmalloc.
The LLVM change in
a35206d78280e0ebcf48cd21bc5fff5c3b9c73fa added the
necessary support to recognize these as library functions, and we
subsequently found that a clang-side change is needed to give them
builtin/nobuiltin attributes as appropriate so they have consistent
removeability.
Based on discussion with Richard Smith, converted the parameter type to
a reserved identifier (
39f7b48671dae5fbe3afc49f33f50c2b6340bb89) and
added support in this patch to recognize it in clang.
Differential Revision: https://reviews.llvm.org/D149600
Jorge Gorbe Moya [Tue, 18 Apr 2023 20:19:45 +0000 (13:19 -0700)]
[lldb] Make the libcxx unique_ptr prettyprinter support custom deleters.
The unique_ptr prettyprinter calls `GetValueOfLibCXXCompressedPair`,
which looks for a `__value_` child. However, when the second value in
the compressed pair is not an empty class, there are two `__value_`
children because `__compressed_pair` derives twice from
`__compressed_pair_elem`, one for each member of the pair. And then the
lookup fails because it's ambiguous.
This patch makes the following changes:
- Rename `GetValueOfLibCXXCompressedPair` to
`GetFirstValueOfLibCXXCompressedPair`, and add a similar function to
get the second value. Put both functions in
Plugin/Language/CPlusPlus/LibCxx.cpp because it seems inappropriate to
have libcxx-specific helpers separate from all the libcxx-dependent
code.
- Read the second value of the `__ptr_` pair and display a "deleter"
child in the unique_ptr synthetic child provider, when available.
- Add a test case for the non-empty deleter case.
Differential Revision: https://reviews.llvm.org/D148662
Craig Topper [Mon, 1 May 2023 20:00:05 +0000 (13:00 -0700)]
[RISCV] Merge RISCV::parseCPUKind and RISCV::checkCPUKind.
Similar for RISCV::parseTuneCPU and RISCV::checkTuneCPUKind.
This makes the CPUKind enum no longer part of the API. It wasn't
providing much value. It was only used to pass between the two
functions.
By removing it, we can remove a dependency on a tablegen generated
file from the RISCVTargetParser.h file. Then we can remove a
dependency from several CMakeLists.txt.
Arthur Eubanks [Tue, 25 Apr 2023 20:16:01 +0000 (13:16 -0700)]
Reland [clang] Canonicalize system headers in dependency file when -canonical-prefixes
Clang was writing paths to the dependency file that don't exist when using a sysroot with symlinks, causing everything to get rebuilt every time. This is reproducible on Linux by creating a symlink to '/', using that as the sysroot, and trying to build something with ninja that includes the C++ stdlib (e.g. a typical build of LLVM).
This fixes https://github.com/ninja-build/ninja/issues/1330 and somewhat matches gcc.
gcc canonicalizes system headers in dependency files under a -f[no-]canonical-system-headers, but it makes more sense to look at -canonical-prefixes.
D37954 was a previous attempt at this.
Fixed use of %T instead of %t in test, causing bots to fail the test on the initial commit.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D149187