Commit Graph

421427 Commits

Author SHA1 Message Date
John McIver 3787de40de [llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all
Fixes #54417

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D123798
2022-04-18 14:16:10 -07:00
Groverkss 15650b320b [MLIR][Presburger] Remove inheritence in MultiAffineFunction
This patch removes inheritence of MultiAffineFunction from IntegerPolyhedron
and instead makes IntegerPolyhedron as a member.

This patch removes virtualization in MultiAffineFunction and also removes
unnecessary functions inherited from IntegerPolyhedron.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D123921
2022-04-19 01:25:13 +05:30
Stefan Pintilie ef34442232 [NFC][PowerPC] Move the Regsiter Operands for PowerPC into PPCRegisterInfo.td
Currently the regsiter operand definitions are found in three separate files.
This patch moves all of the definitions into PPCRegisterInfo.td.

Reviewed By: amyk

Differential Revision: https://reviews.llvm.org/D123543
2022-04-18 14:50:24 -05:00
Michael Kruse af0285122f Revert "[OpenMP] Refactor OMPScheduleType enum."
This reverts commit 9ec501da76.

It may have caused the openmp-gcc-x86_64-linux-debian buildbot to fail.
https://lab.llvm.org/buildbot/#/builders/4/builds/20377
2022-04-18 14:38:31 -05:00
Sanjay Patel 3a27b51b27 [InstCombine] reduce code for freeze of undef
The description was ambiguous about the behavior
when boths select arms are constant or both arms
are not constant. I don't think there's any
evidence to support either way, but this matches
the code with a more specified description.

We can extend this to deal with vector constants
with undef/poison elements. Currently, those don't
get folded anywhere.
2022-04-18 15:14:02 -04:00
Sanjay Patel 60de144119 [InstCombine] add tests for select with frozen condition; NFC 2022-04-18 15:14:02 -04:00
Vasileios Porpodas 359dbb0d3d Revert "[SLP] Support internal users of splat loads"
This reverts commit f8e1337115.
2022-04-18 12:12:34 -07:00
Joseph Huber 15e62062c0 [Clang][Docs] Update information on the new driver now that it's default
Summary:
This patch updates some of the documentation on the new driver now that
it's the default. Also the ABI for embedding these images changed.
2022-04-18 15:05:09 -04:00
Joseph Huber ae23be84cb [OpenMP] Make the new offloading driver the default
Previously an opt-in flag `-fopenmp-new-driver` was used to enable the
new offloading driver. After passing tests for a few months it should be
sufficiently mature to flip the switch and make it the default. The new
offloading driver is now enabled if there is OpenMP and OpenMP
offloading present and the new `-fno-openmp-new-driver` is not present.

The new offloading driver has three main benefits over the old method:
- Static library support
- Device-side LTO
- Unified clang driver stages

Depends on D122683

Differential Revision: https://reviews.llvm.org/D122831
2022-04-18 15:05:09 -04:00
Michael Kruse 9ec501da76 [OpenMP] Refactor OMPScheduleType enum.
The OMPScheduleType enum stores the constants from libomp's internal sched_type in kmp.h and are used by several kmp API functions. The enum values have an internal structure, namely each scheduling algorithm (e.g.) exists in four variants: unordered, orderend, normerge unordered, and nomerge ordered.

This patch (basically a followup to D114940) splits the "ordered" and "nomerge" bits into separate flags, as was already done for the "monotonic" and "nonmonotonic", so we can apply bit flags operations on them. It also now contains all possible combinations according to kmp's sched_type. Deriving of the OMPScheduleType enum from clause parameters has been moved form MLIR's OpenMPToLLVMIRTranslation.cpp to OpenMPIRBuilder to make available for clang as well. Since the primary purpose of the flag is the binary interface to libomp, it has been made more private to LLVMFrontend. The primary interface for generating worksharing-loop using OpenMPIRBuilder code becomes `applyWorkshareLoop` which derives the OMPScheduleType automatically and calls the appropriate emitter function.

While this is mostly a NFC refactor, it still applies the following functional changes:
 * The logic from OpenMPToLLVMIRTranslation to derive the OMPScheduleType also applies to clang. Most notably, it now applies the nonmonotonic flag for non-static schedules by default.
 * In OpenMPToLLVMIRTranslation, the nonmonotonic default flag was previously not applied if the simd modifier was used. I assume this was a bug, since the effect was due to `loop.schedule_modifier()` returning `mlir::omp::ScheduleModifier::none` instead of `llvm::Optional::None`.
 * In OpenMPToLLVMIRTranslation, the nonmonotonic default flag was set even if ordered was specified, in breach to what the comment before citing the OpenMP specification says. I assume this was an oversight.

The ordered flag with parameter was not considered in this patch. Changes will need to be made (e.g. adding/modifying function parameters) when support for it is added. The lengthy names of the enum values can be discussed, for the moment this is avoiding reusing previously existing enum value names such as `StaticChunked` to avoid confusion.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D123403
2022-04-18 14:03:17 -05:00
River Riddle 58ceae9561 [mlir:NFC] Remove the forward declaration of FuncOp in the mlir namespace
FuncOp has been moved to the `func` namespace for a little over a month, the
using directive can be dropped now.
2022-04-18 12:01:55 -07:00
Vasileios Porpodas f8e1337115 [SLP] Support internal users of splat loads
Until now we would only accept a broadcast load pattern if it is only used
by a single vector of instructions.

This patch relaxes this, and allows for the broadcast to have more than one
user vector, as long as all of its uses are internal to the SLP graph and
vectorized.

Differential Revision: https://reviews.llvm.org/D121940
2022-04-18 11:59:44 -07:00
chenglin.bi 222adf338a [Arch64][SelectionDAG] Add target-specific implementation of srem
1. X%C to the equivalent of X-X/C*C is not always fastest path if there is no SDIV pair exist. So check target have faster for srem only first.
2. Add AArch64 faster path for SREM only pow2 case.

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

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D122968
2022-04-19 02:49:42 +08:00
Mehdi Amini b968c59050 Improve terminator doc in MLIR LangRef
Reviewed By: rriddle, bondhugula

Differential Revision: https://reviews.llvm.org/D123886
2022-04-18 18:43:30 +00:00
Stefan Pintilie bc9916fff2 [NFC][PowerPC] Style and ordering changes for PPCInstrP10.td
Renamed the two classes 8LS_DForm_R_SI34_RTA5 and 8LS_DForm_R_SI34_XT6_RA5 to
8LS_DForm_R_SI34_RTA5_MEM and 8LS_DForm_R_SI34_XT6_RA5_MEM because the
instructions that use the classes use memory reads/writes.

Moved the instruction defs up closer to the classes.
Removed unnecessary whitespace.
2022-04-18 13:28:48 -05:00
Mehdi Amini 21b251624b Apply clang-tidy fixes for readability-identifier-naming in GPUDialect.cpp (NFC) 2022-04-18 18:15:30 +00:00
Mehdi Amini c817628b67 Apply clang-tidy fixes for readability-simplify-boolean-expr in TypeConverter.cpp (NFC) 2022-04-18 18:15:30 +00:00
Richard Smith e43c93dd63 Don't treat 'T &forward(T&&)' as builtin.
This allows the standard library to diagnose it properly. Suppress
warning in libc++ testsuite for unused result of call to std::forward.
2022-04-18 11:11:21 -07:00
Peter Klausler b8a929cb2f [flang] Fix regression with recent work on intrinsic/generic interactions
When resolving a procedure reference, do not allow a successful
intrinsic procedure probe result to override an existing
symbol.

Differential Revision: https://reviews.llvm.org/D123905
2022-04-18 11:10:41 -07:00
Joseph Huber ba01306009 [Libomptarget] Fix LIBOMPTARGET_INFO test
Summary:
A patch added a new line to one of the info outputs without updating
this test. This patch adds the new text to the existing test.
2022-04-18 14:09:02 -04:00
Wenlei He 526af13eba Fix llvm-profgen breakage 2022-04-18 11:02:29 -07:00
Arthur Eubanks e0736e7429 [ocaml bindings] Remove LTO bindings
Followup to D123882.
2022-04-18 10:22:26 -07:00
Arthur Eubanks 2e6ac54cf4 [LegacyPM] Remove ThinLTO/LTO pipelines
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove the (Thin)LTO pipelines.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D123882
2022-04-18 10:09:41 -07:00
Arthur Eubanks a7e20a8a7a [CallPrinter] Port CallPrinter passes to new pass manager
Port the legacy CallGraphViewer and CallGraphDOTPrinter to work with the new pass manager.

Addresses issue https://github.com/llvm/llvm-project/issues/54323
Adds back related tests that were removed in commits d53a4e7b4a and 9e9d9aba14

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D122989
2022-04-18 10:02:18 -07:00
Wenlei He 17f6cba30d [llvm-profgen] Add process filter for perf reader
For profile generation, we need to filter raw perf samples for binary of interest. Sometimes binary name along isn't enough as we can have binary of the same name running in the system. This change adds a process id filter to allow users to further disambiguiate the input raw samples.

Differential Revision: https://reviews.llvm.org/D123869
2022-04-18 09:50:16 -07:00
Jacques Pienaar f4085c57dd [mlir] Fix two AttributeParser aborts
Reproducers that resulted in triggering the following asserts

mlir::NamedAttribute::NamedAttribute(mlir::StringAttr, mlir::Attribute)
mlir/lib/IR/Attributes.cpp:29:3
consumeToken
mlir/lib/Parser/Parser.h:126

Differential Revision: https://reviews.llvm.org/D122240
2022-04-18 09:30:35 -07:00
Blue Gaston a6efcf1c31 Format fix in recent change. Removed whitespace. [NFC] 2022-04-18 09:23:01 -07:00
Zarko Todorovski ce87133120 [llvm][IPO] Inclusive language: Rename mergefunc-sanity to mergefunc-verify and remove other instances of sanity in MergeFunctions.cpp
This patch renames the mergefunc-sanity to mergefunc-verify and renames the related functions to use more
inclusive language

Reviewed By: cebowleratibm

Differential Revision: https://reviews.llvm.org/D114374
2022-04-18 11:50:08 -04:00
Eli Friedman 13fc178173 Force GHashCell to be 8-byte-aligned.
Otherwise, with recent versions of libstdc++, clang can't tell that the
atomic operations are properly aligned, and generates calls to
libatomic.  (Actually, because of the use of reinterpret_cast, it wasn't
guaranteed to be aligned, but I think it ended up being aligned in
practice.)

Fixes https://github.com/llvm/llvm-project/issues/54790 , the part where
LLVM failed to build.

Differential Revision: https://reviews.llvm.org/D123872
2022-04-18 08:46:03 -07:00
Corentin Jabot daa6d7b250 [Clang] Use of decltype(capture) in parameter-declaration-clause
Partially implement the proposed resolution to CWG2569.

D119136 broke some libstdc++ code, as P2036R3, implemented as a DR to
C++11 made ill-formed some previously valid and innocuous code.

We resolve this issue to allow decltype(x) - but not decltype((x)
to appear in the parameter list of a lambda that capture x by copy.

Unlike CWG2569, we do not extend that special treatment to
sizeof/noexcept yet, as the resolution has not been approved yet
and keeping the review small allows a quicker fix of impacted code.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123909
2022-04-18 15:58:25 +02:00
Aaron Ballman 86cdb2929c Silence a "not all control paths return a value" warning; NFC 2022-04-18 08:54:08 -04:00
Simon Pilgrim 9cae511aa1 [InstCombine] Add additional test coverage for D123374
More basic test coverage for the fold: (A & 2^C1) + A => A & (2^C1 - 1) iff bit C1 in A is a sign bit
2022-04-18 13:25:24 +01:00
Piotr Kubaj 315d792130 [PowerPC] Fix sanitizers build on FreeBSD
1. Add correct pc, sp and bp for FreeBSD.
2. Since there's no personality.h header on FreeBSD, move SANITIZER_PPC64V2
   case below FREEBSD case.
3. __ppc_get_timebase_freq() is glibc-specific. Add a shim for FreeBSD that
   does the same.
2022-04-18 07:16:13 -05:00
Momchil Velikov e0ff354b83 [AArch64] Async unwind - Adjust unwind info in AArch64LoadStoreOptimizer
[Re-commit after fixing a dereference of "end" iterator]

The AArch64LoadStoreOptimnizer pass may merge a register
increment/decrement with a following memory operation. In doing so, it
may break CFI by moving a stack pointer adjustment past the CFI
instruction that described *that* adjustment.

This patch fixes this issue by moving said CFI instruction after the
merged instruction, where the SP increment/decrement actually takes
place.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D114547
2022-04-18 12:09:44 +01:00
Dmitry Makogon 6f8feeb342 [Test] Add more tests showing duplicate PHIs generated by RS4GC (NFC) 2022-04-18 17:39:06 +07:00
Siva Chandra Reddy f8cdbeb471 [libc][docs] Remove the description of a "www" directory.
We plan to use the "docs" directory as the home for our "www" pages,
similar to how it is for the libcxx project.
2022-04-18 07:16:21 +00:00
Siva Chandra Reddy 6b4ee566e9 [libc] Add a doc describing the current status of libc runtimes build.
A section briefly mentioning the planned future enhancements has also
been included.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D123761
2022-04-18 06:48:43 +00:00
Qiu Chaofan 1e23175df6 [PowerPC] Mark side effects of Power9 darn instruction
This fixes CVE-2019-15847, preventing random number generation from
being merged.

Reviewed By: lkail

Differential Revision: https://reviews.llvm.org/D122783
2022-04-18 13:21:40 +08:00
Groverkss 4ffd0b6fde [MLIR][Presburger] Make IntegerRelation::mergeLocalIds not delete duplicates
This patch modifies mergeLocalIds to not delete duplicate local ids in
`this` relation. This allows the ordering of the final local ids for `this`
to be determined more easily, which is generally required when other objects
refer to these local ids.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D123866
2022-04-18 10:15:35 +05:30
luxufan 429cbac039 [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified
In the past, `clang --target=riscv64-unknown-linux-gnu -mno-relax -c hello.s` will assemble hello.s without relaxation, but `clang --target=riscv64-unknown-linux-gnu -mno-relax -fno-integrated-as -c hello.s` doesn't pass the `-mno-relax` option to assembler, and assemble with relaxation
This patch pass the -mno-relax option to assembler when -fno-integrated-as is specified.

Differential Revision: https://reviews.llvm.org/D120639
2022-04-18 11:16:41 +08:00
jacquesguan 5479044bfc [mlir][Vector] Fold transpose splat to splat with transposed type.
This revision folds transpose splat to a new splat with the transposed vector type. For a splat, there is no need to actually do transpose for it, it would be more effective to just build a new splat as the result.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D123765
2022-04-18 03:00:17 +00:00
Richard Smith c105bcbf98 Specify -fno-builtin when testing to make sure that certain stdlib
functions are not treated as [[nodiscard]].

The compiler might choose to treat them as [[nodiscard]] without the
involvement of libc++ if we allow it to recognize them as builtins.
2022-04-17 19:41:34 -07:00
chenglin.bi acfc025a72 Revert "[Arch64][SelectionDAG] Add target-specific implementation of srem"
This reverts commit 9d9eddd3dd.
2022-04-18 10:35:09 +08:00
Richard Smith 3eeca52456 Fix wrong signature for std::move and std::swap in test. 2022-04-17 19:25:20 -07:00
Chris Lattner cac19f4141 [LogicalResult.h] Move ParseResult to the bottom of file and fix comment, NFC.
This was review feedback that I missed in the phab review:
https://reviews.llvm.org/D123760
2022-04-17 15:34:26 -07:00
Chris Lattner 81b2dc548b [Support] Move ParseResult from OpDefinition.h to LogicalResult.h
This class is a helper for 'parser-like' use cases of LogicalResult
where the implicit conversion to bool is tolerable.  It is used by the
operation asmparsers, but is more generic functionality that is closely
aligned with LogicalResult.  Hoist it up to LogicalResult.h to make it
more accessible.  This is part of Issue #54884

Differential Revision: https://reviews.llvm.org/D123760
2022-04-17 15:18:33 -07:00
Richard Smith b27430f9f4 Treat `std::move`, `forward`, etc. as builtins.
This is extended to all `std::` functions that take a reference to a
value and return a reference (or pointer) to that same value: `move`,
`forward`, `move_if_noexcept`, `as_const`, `addressof`, and the
libstdc++-specific function `__addressof`.

We still require these functions to be declared before they can be used,
but don't instantiate their definitions unless their addresses are
taken. Instead, code generation, constant evaluation, and static
analysis are given direct knowledge of their effect.

This change aims to reduce various costs associated with these functions
-- per-instantiation memory costs, compile time and memory costs due to
creating out-of-line copies and inlining them, code size at -O0, and so
on -- so that they are not substantially more expensive than a cast.
Most of these improvements are very small, but I measured a 3% decrease
in -O0 object file size for a simple C++ source file using the standard
library after this change.

We now automatically infer the `const` and `nothrow` attributes on these
now-builtin functions, in particular meaning that we get a warning for
an unused call to one of these functions.

In C++20 onwards, we disallow taking the addresses of these functions,
per the C++20 "addressable function" rule. In earlier language modes, a
compatibility warning is produced but the address can still be taken.

The same infrastructure is extended to the existing MSVC builtin
`__GetExceptionInfo`, which is now only recognized in namespace `std`
like it always should have been.

This is a re-commit of
  fc30901096,
  a571f82a50, and
  64c045e25b
which were reverted in
  e75d8b7037
due to a crasher bug where CodeGen would emit a builtin glvalue as an
rvalue if it constant-folds.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123345
2022-04-17 13:26:16 -07:00
Lang Hames 45e390cfee [ORC] Report paths in errors when creating StaticLibrarySearchGenerators. 2022-04-17 12:01:06 -07:00
Lang Hames 412c6d1591 [llvm-jitlink] Add paths to file-not-found errors. 2022-04-17 12:01:06 -07:00
Lang Hames ef61592bb4 [llvm-jitlink] Don't show FailedToMaterialize errors by default.
This patch makes printing of FailedToMaterialize errors in llvm-jitlink
conditional on the -show-err-failed-to-materialize option, which defaults to
false.

FailedToMaterialize errors are not root-cause errors: they're generated when a
symbol is requested but cannot be provided because of a failure that was
reported on some other error path. They typically don't convey actionable
information, and tend to flood error logs making root cause errors harder to
spot. Hiding FailedToMaterialize errors by default addresses these issues.
2022-04-17 12:01:06 -07:00