Commit Graph

437612 Commits

Author SHA1 Message Date
luxufan 069d7ef084 [RISCV] Add a LocalStackSlotAllocation test
Differential Revision: https://reviews.llvm.org/D134884
2022-09-30 22:36:03 +00:00
LLVM GN Syncbot 7578d337b5 [gn build] Port a6e1080b87 2022-10-02 23:53:57 +00:00
Vitaly Buka a6e1080b87 Revert "[libc++][ranges]Refactor `copy{,_backward}` and `move{,_backward}`"
Breaks msan, asan

https://lab.llvm.org/buildbot/#/builders/5/builds/27904

This reverts commit 005916de58.
2022-10-02 16:23:35 -07:00
Fangrui Song 961439cd7e [ELF] Add LLVM_LIBRARY_VISIBILITY to some global variables. NFC 2022-10-02 13:23:52 -07:00
Valentin Clement 262c23d2ca
[flang] Introduce fir.class type
Introduce a new ClassType for polymorphic
entities. A fir.class type is similar to a fir.box type in
many ways and is also base on the BaseBoxType.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Depends on D134956

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D134957
2022-10-02 20:13:51 +02:00
Valentin Clement ceff415a1a
[flang] Introduce BaseBoxType
Introduce a BaseBoxType to be used by BoxType and
the a new ClassType that is introduced in a follow up patch.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D134956
2022-10-02 20:08:54 +02:00
Fangrui Song fd9fd4fa08 [llvm-objdump][test] Improve address test 2022-10-02 10:49:52 -07:00
Mark de Wever cfd5b8f111 [libc++] Updates generated transitve includes.
This should fix the CI.
2022-10-02 19:37:21 +02:00
Sanjay Patel 2e87333bfe [InstCombine] convert mul by negative-pow2 to negate and shift
This is an unusual canonicalization because we create an extra instruction,
but it's likely better for analysis and codegen (similar reasoning as D133399).

InstCombine::Negator may create this kind of multiply from negate and shift,
but this should not conflict because of the narrow negation.

I don't know how to create a fully general proof for this kind of transform in
Alive2, but here's an example with bitwidths similar to one of the regression
tests:
https://alive2.llvm.org/ce/z/J3jTjR

Differential Revision: https://reviews.llvm.org/D133667
2022-10-02 12:22:25 -04:00
Sanjay Patel 4490cfbaf4 [ValueTracking] peek through fpext in isKnownNeverInfinity()
https://alive2.llvm.org/ce/z/BkNoRW
2022-10-02 11:20:23 -04:00
Sanjay Patel 0243b424d7 [InstSimplify] add tests for FP infinity compare with fpext; NFC 2022-10-02 11:20:23 -04:00
David Green 5e1a9d319d [ARM] Add lowering for bf16 neon vtrn, vzup and vuzp.
These go via Dag2Dag, which are better based on element sizes not the
exact element types.
2022-10-02 15:34:37 +01:00
David Green f2fde99461 [ARM] More bf16 shuffle handling, including perfect shuffles. 2022-10-02 14:31:51 +01:00
Florian Hahn 3fe6ddd999
[ConstraintElimination] Update Changed status in ssub simplification.
Update tryToSimplifyOverflowMath to indicate whether the function made
any changes to the IR.
2022-10-02 14:25:51 +01:00
David Green 8193f0d1d2 [ARM] Add tablegen patterns for bf16 vrev 2022-10-02 13:42:14 +01:00
David Green 58369c8631 [ARM] Add tablegen patterns for bf16 vext
This adds missing tablegen patterns for VEXT, identical to the fp16
patterns as they only use baseline Neon operations.
Part of fixing #57770.
2022-10-02 12:45:58 +01:00
David Green 3651635eca [ARM][DAG] BF16 constant handling.
Much like f16 and f32, we shouldn't try to shrink bf16 to smaller fp
constant.  The code may not be optimal, but this allows us to legalize
bf16 constants under Arm without errors.
2022-10-02 11:51:08 +01:00
Peixin Qiao 3f0ad8558a Revert "[flang] Make real type of kind 10 target dependent"
This reverts commit d11e406e36.
2022-10-02 17:45:03 +08:00
Fangrui Song 6f46ff3765 [test] Make Linux/sem_init_glibc.cpp robust
and fix it for 32-bit ports defining sem_init@GLIBC_2.0 (i386, mips32, powerpc32) for glibc>=2.36.

Fix https://github.com/llvm/llvm-project/issues/58079

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D135023
2022-10-02 00:47:10 -07:00
Peixin Qiao 4e43a14bdb [flang][OpenMP] Fix resolve common block in data-sharing clauses
The previous resolve only creates the host associated varaibles for
common block members, but does not replace the original objects with
the new created ones. Fix it and also compute the sizes and offsets
for the host common block members if they are host associated.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127214
2022-10-02 10:38:27 +08:00
Peixin Qiao d11e406e36 [flang] Make real type of kind 10 target dependent
The real(10) is supported on x86_64. On aarch64, the value of
selected_real_kind(16) should be 16 rather than 10 since real(10)
is not supported on x86_64. Previously, the real type support check
is not target dependent. Support it now through the target triple
information.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D134021
2022-10-02 10:30:49 +08:00
Kees Cook aef03c9b3b [clang][auto-init] Deprecate -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
GCC 12 has been released and contains unconditional support for
-ftrivial-auto-var-init=zero:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ftrivial-auto-var-init

Maintain compatibility with GCC, and remove the -enable flag for "zero"
mode. The flag is left to generate an "unused" warning, though, to not
break all the existing users. The flag will be fully removed in Clang 17.

Link: https://github.com/llvm/llvm-project/issues/44842

Reviewed By: nickdesaulniers, MaskRay, srhines, xbolva00

Differential Revision: https://reviews.llvm.org/D125142
2022-10-01 18:45:45 -07:00
LLVM GN Syncbot facfdbe25b [gn build] Port 005916de58 2022-10-02 00:35:45 +00:00
Konstantin Varlamov 005916de58 [libc++][ranges]Refactor `copy{,_backward}` and `move{,_backward}`
Instead of using `reverse_iterator`, share the optimization between the 4 algorithms. The key observation here that `memmove` applies to both `copy` and `move` identically, and to their `_backward` versions very similarly. All algorithms now follow the same pattern along the lines of:
```
if constexpr (can_memmove<InIter, OutIter>) {
  memmove(first, last, out);
} else {
  naive_implementation(first, last, out);
}
```
A follow-up will delete `unconstrained_reverse_iterator`.

This patch removes duplication and divergence between `std::copy`, `std::move` and `std::move_backward`. It also improves testing:
- the test for whether the optimization is used only applied to `std::copy` and, more importantly, was essentially a no-op because it would still pass if the optimization was not used;
- there were no tests to make sure the optimization is not used when the effect would be visible.

Differential Revision: https://reviews.llvm.org/D130695
2022-10-01 17:35:12 -07:00
Kazu Hirata 240f41c8e4 [mlir] Use std::enable_if_t (NFC) 2022-10-01 17:24:56 -07:00
Kazu Hirata 9d0d4046c0 [clang] Use std::enable_if_t (NFC) 2022-10-01 17:24:54 -07:00
Kazu Hirata 66bb0ac251 [ADT] Use std::common_type_t (NFC) 2022-10-01 17:24:52 -07:00
Jacques Pienaar 765ac6e9df [mlir] Remove ReferTo attr constraint
The current generation is unsafe as it is evaluated during verify
invocation rather than during verifySymbolUses. Remove until this is
safely generated.

Differential Revision: https://reviews.llvm.org/D134558
2022-10-01 17:19:14 -07:00
Arthur Eubanks 5df4ab55f9 [llvm] Migrate PAEval to new pass manager 2022-10-01 16:41:58 -07:00
Craig Topper 5bbc5eb55f [RISCV] Use _TIED form of VWADD(U)_WX/VWSUB(U)_WX to avoid early clobber.
One of the sources is the same size as the destination so that source
doesn't have an overlap with the destination register. By using the _TIED
form we avoid an early clobber contraint for that source.

This matches what was already done for instrinsics. ConvertToThreeAddress
will fix it if it can't stay tied.
2022-10-01 16:34:39 -07:00
Craig Topper 85db4f10e3 [RISCV] Minor tablegen formatting cleanup. NFC 2022-10-01 15:59:25 -07:00
Fangrui Song 1837333dac [ELF] --check-sections: allow address 0xffffffff for ELFCLASS32
Fix https://github.com/llvm/llvm-project/issues/58101
2022-10-01 15:37:07 -07:00
Fangrui Song dd6aea9582 [ELF] Rename LinkerScript::ctx to state. NFC
To avoid name conflict with `elf::ctx`.
2022-10-01 15:27:39 -07:00
Jessica Paquette 8aedb435db [GlobalISel] Combine abs(undef) -> 0
SDAG does this, GISel doesn't.

See https://gcc.godbolt.org/z/sqjMx3Tfv

More context:
https://github.com/llvm/llvm-project/issues/57256

Differential Revision: https://reviews.llvm.org/D135021
2022-10-01 15:16:32 -07:00
Fangrui Song f596d82385 [ELF] Move driver into ctx and remove indirection. NFC
This removes one global variable and removes GOT and unique_ptr indirection.
2022-10-01 15:12:50 -07:00
Fangrui Song 9c626d4a0d [ELF] Remove symtab indirection. NFC
Add LLVM_LIBRARY_VISIBILITY to remove unneeded GOT and unique_ptr indirection.
2022-10-01 14:46:49 -07:00
Jessica Paquette 424c69190c Update missing test after 24553df57d 2022-10-01 14:00:01 -07:00
Nikolas Klauser 7e6a193f13 [libc++] Enable libc++-specific tests for constexpr string
Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D128578
2022-10-01 22:50:22 +02:00
Nikolas Klauser ed2d3644ab [libc++][NFC] Prefer type aliases over structs
Reviewed By: ldionne, #libc

Spies: sstefan1, libcxx-commits, jeroen.dobbelaere

Differential Revision: https://reviews.llvm.org/D134901
2022-10-01 22:49:36 +02:00
Jessica Paquette 24553df57d [GlobalISel] Combine `undef / X -> 0` and `undef % X -> 0`
This fixes the `urem_undef_lhs` case in the following:

https://gcc.godbolt.org/z/Wo9x7o679

Also see https://github.com/llvm/llvm-project/issues/57256 for more related
bugs.

This is equivalent to the undef bits in `simplifyDivRem` in the DAGCombiner.

Differential Revision: https://reviews.llvm.org/D135020
2022-10-01 13:48:55 -07:00
Alex Brachet 3b0df701b0 [llvm-driver] Support single distributions
`LLVM_DISTRIBUTION_COMPONENTS` now influences the llvm binary in the
normal cmake output directory when it is set. This allows for
distribution targets to only include tools they want in the llvm
binary. It must be done this way because only one target can be
associated with a specific output name.

Differential Revision: https://reviews.llvm.org/D131310
2022-10-01 20:20:28 +00:00
Alex Brachet aa1c58b9c6 [llvm-driver][NFC] Simplify handling of tool symlinks
Differential Revision: https://reviews.llvm.org/D134979
2022-10-01 20:18:49 +00:00
Fangrui Song 34fa860048 [ELF] Remove ctx indirection. NFC
Add LLVM_LIBRARY_VISIBILITY to remove unneeded GOT and unique_ptr
indirection. We can move other global variables into ctx without
indirection concern. In the long term we may consider passing Ctx
as a parameter to various functions and eliminate global state as
much as possible and then remove `Ctx::reset`.
2022-10-01 12:06:33 -07:00
Fangrui Song a623a4c8b4 [ELF] Remove elf::config indirection. NFC
`config` has 1000+ uses so we try to avoid changing `config->foo`. Define a
wrapper with LLVM_LIBRARY_VISIBILITY to remove unneeded GOT and unique_ptr
indirection.

My x86-64 lld executable is 11+KiB smaller.
2022-10-01 11:39:45 -07:00
David Green d7804e187a [Clang] Move ParsedTargetAttr to TargetInfo.h
This moves the struct, as it is now parsed by TargetInfo, so avoiding
some includes of AST in Basic.
2022-10-01 18:26:42 +01:00
Dave Lee 557a19ab0f [lldb] Remove scoped timer from high firing and fast running ExtractUnitDIENoDwoIfNeeded
Profiles show that `DWARFUnit::ExtractUnitDIENoDwoIfNeeded` is both high firing (tens of thousands of calls) and fast running (15 µs mean).

Timers like this are noise and load for profiling systems, and can be removed.

rdar://100326595

Differential Revision: https://reviews.llvm.org/D134920
2022-10-01 09:58:40 -07:00
Dave Lee 72a86a9dc4 [lldb] Remove scoped timer from high firing and fast running SymbolFileDWARF::FindFunctions
Profiles show that `SymbolFileDWARF::FindFunctions` is both high firing (many thousands of calls) and fast running (35 µs mean).

Timers like this are noise and load for profiling systems, and can be removed.

rdar://100326595

Differential Revision: https://reviews.llvm.org/D134922
2022-10-01 09:58:03 -07:00
Florian Hahn 05b0b48b50
[SimpleLoopUnswitch] Pass -verify-cfg-preserved to test.
This ensures PreservedCFGCheckerAnalysis is always added, independent of
whether opt was built with assertions enabled or not.

This fixes a few buildbot failures for bots that don't have assertions
enabled.
2022-10-01 17:19:02 +01:00
David Green 6dc5f3ec89 Foward declare ParsedTargetAttr as a struct. 2022-10-01 16:14:00 +01:00
Paweł Bylica e399c58778
[DAGCombine] Add tests for D57317
Add two tests for D57317: Deduplicate addcarry node using commutativity.
https://reviews.llvm.org/D57317
2022-10-01 16:59:44 +02:00