Commit Graph

433574 Commits

Author SHA1 Message Date
Simon Pilgrim 53c0be28a7 [PhaseOrdering][X86] Regenerate vdiv.ll
Noticed while cleaning up x86 cost tables for upcoming cost kind support and it affected this test
2022-08-21 13:39:55 +01:00
LiaoChunyu 1fb87ace4d [RISCV] Optimize x > 1 ? x : 1 -> x > 0 ? x : 1
if x == 1,
  x > 1 ? x : 1  return x, which is also 1.
  x > 0 ? x : 1  return 1.

Reduce the number of load 1 instructions.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132211
2022-08-21 20:26:39 +08:00
John Ericson e6a0800532 [libcxxabi][cmake] Allow building without libcxx again
This allows `-DLLVM_ENABLE_RUNTIMES=libcxxabi` to work.

This functionality was removed in D125561 (among other such removals) as
dead code, because it was only available as part of the standalone build
before.

The functionality as added back as it was, except `target_include_directories` is used instead of the cruder `target_compile_options` (with an MSVC vs not MSVC conditional split). That is just wholly better.

Reviewed By: phosek, #libc_abi

Differential Revision: https://reviews.llvm.org/D132298
2022-08-21 08:22:57 -04:00
John Ericson 176db3b3ab [RFC] Remove support for building C++ with `LLVM_ENABLE_PROJECTS`
This has been officially deprecated since D112724, meaning the
deprecation warning is present in released 14 and 15.

This makes me think that now, shortly after the 15 release is branched,
is a good time to pull the trigger.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D132324
2022-08-21 08:10:56 -04:00
Simon Pilgrim 39173066e9 [CostModel][X86] Add trunc cost kinds tests 2022-08-21 12:33:10 +01:00
Simon Pilgrim efc1c0236b [CostModel][X86] Split integer div/rem cost kinds tests
It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.
2022-08-21 12:08:57 +01:00
Anubhab Ghosh e309f5ebc0 [Orc] Improve deintialize and shutdown logic
When deinitializing, the allocation needs to be removed from the
allocation list of its associated reservation so that remaining
allocations can be deinitialized when releasing the reservation.

Differential Revision: https://reviews.llvm.org/D132313
2022-08-21 16:36:37 +05:30
Anubhab Ghosh 0ecfee0b9e [Orc] Provide correct Reservation address for slab allocations
When slab allocator is used, the MappingBase is not necessarily
the same as the original reservation base as the allocation could
be a part of the whole reservation.

In this case the original reservation address needs to be passed to
ExecutorSharedMemoryMapperService to associate the new allocation
with the original reservation.

Differential Revision: https://reviews.llvm.org/D132313
2022-08-21 16:36:37 +05:30
Anubhab Ghosh 1134d3a03f [Orc] Only unmap shared memory in controller process destructor
By the time SharedMemoryMapper destructor is called, the RPC
connection is no longer available causing the release() call to
always fail. Instead at this point only shared memory regions
can be unmapped safely.

Deinitializers are called and mapped memory is released at the
executor side by ExecutorSharedMemoryMapperService::shutdown()
instead. Memory can also be released earlier by calling release()
earlier before RPC connection is closed.

Differential Revision: https://reviews.llvm.org/D132313
2022-08-21 16:36:37 +05:30
Anubhab Ghosh 5df428eac3 [Orc] Actually save the callback
The callback function was captured by reference but it lived on the
stack and was in danger of being overwritten and could cause a crash.

Differential Revision: https://reviews.llvm.org/D132313
2022-08-21 16:36:37 +05:30
Simon Pilgrim 883538f472 [CostModel][X86] Split int/fp arithmetic cost kinds tests
It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.
2022-08-21 11:49:32 +01:00
Tung D. Le d4284baf1e [mlir][normalize-memrefs] NFC Follow-up D125854
NFC follow-up D125854 to reflect some remaining comments in D125854

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D132200
2022-08-21 16:04:41 +05:30
Simon Pilgrim 5263155d5b [CostModel] Add CostKind argument to getShuffleCost
Defaults to TCK_RecipThroughput - as most explicit calls were assuming TCK_RecipThroughput (vectorizers) or was just doing a before-vs-after comparison (vectorcombiner). Calls via getInstructionCost were just dropping the CostKind, so again there should be no change at this time (as getShuffleCost and its expansions don't use CostKind yet) - but it will make it easier for us to better account for size/latency shuffle costs in inline/unroll passes in the future.

Differential Revision: https://reviews.llvm.org/D132287
2022-08-21 10:54:51 +01:00
Iain Sandoe fee3cccc6c [C++20][Modules] Improve handing of Private Module Fragment diagnostics.
This adds a check for exported inline functions, that there is a definition in
the definition domain (which, in practice, can only be the module purview but
before any PMF starts) since the PMF definition domain cannot contain exports.

This is:
[dcl.inline]/7
If an inline function or variable that is attached to a named module is declared in
a definition domain, it shall be defined in that domain.

The patch also amends diagnostic output by excluding the PMF sub-module from the
set considered as sources of missing decls.  There is no point in telling the user
that the import of a PMF object is missing - since such objects are never reachable
to an importer.  We still show the definition (as unreachable), to help point out
this.

Differential Revision: https://reviews.llvm.org/D128328
2022-08-21 10:19:46 +01:00
Anlun Xu 9a764ffeb6 [mlir][Bazel] Fix Bazel build
Differential Revision: https://reviews.llvm.org/D132264
2022-08-21 01:02:21 -07:00
Kazu Hirata 8b1b0d1d81 Revert "Use std::is_same_v instead of std::is_same (NFC)"
This reverts commit c5da37e42d.

This patch seems to break builds with some versions of MSVC.
2022-08-20 23:00:39 -07:00
Kazu Hirata c5da37e42d Use std::is_same_v instead of std::is_same (NFC) 2022-08-20 22:36:26 -07:00
Kazu Hirata ec5eab7e87 Use range-based for loops (NFC) 2022-08-20 21:18:32 -07:00
Kazu Hirata 8e494b85a5 Use llvm::drop_begin (NFC) 2022-08-20 21:18:30 -07:00
Kazu Hirata 258531b7ac Remove redundant initialization of Optional (NFC) 2022-08-20 21:18:28 -07:00
Kazu Hirata 06b551c944 Use llvm::is_contained (NFC) 2022-08-20 21:18:27 -07:00
Kazu Hirata 6b1bc80188 [Scalar] Qualify auto in range-based for loops (NFC)
Identified with readability-qualified-auto.
2022-08-20 21:18:25 -07:00
Kazu Hirata ce377df57e Ensure newlines at the end of files (NFC) 2022-08-20 21:18:23 -07:00
Gabriel Ravier dad00daa7a [libunwind] Fixed a number of typos
I went over the output of the following mess of a command:

`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D130948
2022-08-20 18:09:03 -07:00
Joe Loser 1b08b276ae
[mlir] Use std::is_invocable instead of llvm::is_invocable
Now that MLIR is built with C++17, use the standard library equivalent of
`llvm::is_invocable`: `std::is_invocable`.

Differential Revision: https://reviews.llvm.org/D132318
2022-08-20 17:33:51 -06:00
Kazu Hirata 01ffe31cbb [llvm] Remove llvm::is_trivially_{copy/move}_constructible (NFC)
This patch removes llvm::is_trivially_{copy/move}_constructible in
favor of std::is_trivially_{copy/move}_constructible.

The previous attempt to remove them in Dec 2020,
c8d406c93c, broke builds with "some
versions of GCC" according to
6cd9608fb3.

It's been 20 months since then, and the minimum requirement for GCC
has been updated to 7.1 from 5.1.

FWIW, I was able to build llvm with gcc 8.4.0.

Differential Revision: https://reviews.llvm.org/D132311
2022-08-20 14:06:42 -07:00
Lang Hames e0fc85e092 [JITLink] Fix LinkGraph::makeAbsolute, add unit test.
makeAbsolute was not updating the symbol address when applied to external
symbols.

This commit adds a unit test for makeAbsolute, and updates the makeExternal unit
test to check that makeExternal works correctly for absolute symbols.
2022-08-20 13:43:21 -07:00
Mark de Wever 00da9e9a07 [libc++][string] Removes obsolete constexpr.
Addresses the final review comment of D131421.

Reviewed By: philnik, #libc

Differential Revision: https://reviews.llvm.org/D131857
2022-08-20 20:42:46 +02:00
Nico Weber 804d4594cb [gn build] Fix oversight in 3adda398ce 2022-08-20 13:39:45 -04:00
John Ericson 90dcdc4b6e [bolt][llvm][cmake] Use `CMAKE_INSTALL_LIBDIR` too
Working back towards D130586.

Bolt didn't use `LLVM_LIBDIR_SUFFIX` before, and has no in-tree reverse
dependencies, it seems easier to add.

The change in LLVM itself is to prevent some unexpected `lib64` from
cropping up due to the `CMAKE_INSTALL_LIBDIR` defaulting logic.

Differential Revision: https://reviews.llvm.org/D132297
2022-08-20 13:08:06 -04:00
John Ericson 3adda398ce [clang][lldb][cmake] Use new `*_INSTALL_LIBDIR_BASENAME` CPP macro
Use this instead of `*_LIBDIR_SUFFIX`, from which it is computed.

This gets us ready for D130586, in which `*_LIBDIR_SUFFIX` is
deprecated.

Differential Revision: https://reviews.llvm.org/D132300
2022-08-20 12:52:21 -04:00
Kazu Hirata 7dec4648c4 [ADT] Simplify llvm::sort with constexpr if (NFC)
Differential Revision: https://reviews.llvm.org/D132305
2022-08-20 09:34:36 -07:00
Kazu Hirata abb6271d80 [ADT] Deprecate Any::hasValue
This patch deprecates Any::hasValue as I've migrated all known uses of
it to Any::has_value.  I'm planning to remove the deprecated method in
3 months or so.

Differential Revision: https://reviews.llvm.org/D132304
2022-08-20 09:34:35 -07:00
Kazu Hirata fc4d3a1109 [clang] Use Any::has_value instead of Any::hasValue (NFC) 2022-08-20 08:40:18 -07:00
Peixin Qiao 6d1a685172 [flang] Add semantic checks for interoperability of derived type (C1806)
As Fortran 2018 C1806, each component of a derived type with the BIND
attribute shall be a nonpointer, nonallocatable data component with
interoperable type.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D131585
2022-08-20 23:34:47 +08:00
Peixin Qiao aa41460311 [flang][OpenMP] Handle the data race for firstprivate and lastprivate
Remove barriers for firstprivate except if the variable is also
lastprivatized. Re-arrange code and put all last-privates inside a
single scf.if.

As OpenMP Spec 5.0, to avoid the data races, concurrent updates of the
original list item must be synchronized with the read of the original
list item that occurs as a result of the firstprivate clause. Adding
barrier(s) before and/or after the worksharing region would remove the
data races, and it is the application(user)'s job. However, when
one list item is in both firstprivate and lastprivate clauses, the
standard (https://www.openmp.org/spec-html/5.0/openmpsu105.html) states
the following:
```
If a list item appears in both firstprivate and lastprivate clauses, the
update required for the lastprivate clause occurs after all
initializations for the firstprivate clause.
```

So, the synchronization should be ensured by compiler such as emiting
one barrier since the lastprivate clause follows the reads of the
original list item performed for the initialization of each of the
firstprivate list item.

Add FIXME for two special cases, sections construct and linear clause.

The data race problem for single construct will be handled later.

This implementation is based on the discussion with OpenMP committee and
clang code (clang/lib/CodeGen/CGStmtOpenMP.cpp).

Reviewed By: kiranchandramohan, NimishMishra

Differential Revision: https://reviews.llvm.org/D131832
2022-08-20 23:31:13 +08:00
Kazu Hirata 347c462e97 [lldb] Use Any::has_value instead of ANy::hasValue (NFC) 2022-08-20 07:28:06 -07:00
Kazu Hirata e15359debf [ADT] Implement Any::has_value
This patch implements Any::has_value for consistency with std::any in
C++17.

My plan is to deprecate Any::hasValue after migrating all of its uses
to Any::has_value.  Since I am about to do so, this patch simply
replaces hasValue with has_value in the unit test instead of adding
tests for has_value.

Differential Revision: https://reviews.llvm.org/D132278
2022-08-20 07:28:04 -07:00
Kazu Hirata 0e0e638249 [ADT] Simplify llvm::reverse with constexpr if (NFC)
Differential Revision: https://reviews.llvm.org/D132279
2022-08-20 07:28:03 -07:00
Sanjay Patel 2981a94902 [EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0), part 2
Follow-up to 7f1262a322. That patch avoided removing the
call, but it still allowed the constant-folded result. This
makes the behavior consistent with 1-arg libm folding: if the
call potentially raises an exception, then we just bail out.

It seems likely that there are other corner-cases like this,
but the tests are incomplete, so we have lived with these
discrepancies for a long time. This was untested before the
the constant folding was expanded in D127964.
2022-08-20 10:16:06 -04:00
Simon Pilgrim fa96383506 [X86] Fold PMULUDQ(X,1) -> AND(X,(1<<32)-1) 'getZeroExtendInReg'
Fix cases where shl/srem/urem expansion results in a mulh/mul_lohi(x,1) 'pass through' that gets lowered to pmuludq.

Fixes #56684
2022-08-20 14:58:25 +01:00
Simon Pilgrim 8faf515a36 [X86] Add vector test coverage of 'one-bit-diff' and/or icmp ne/eq patterns 2022-08-20 14:13:44 +01:00
Mark de Wever 2ede992c01 [libc++][doc] Updates status of P2291R3.
Work on the paper has started but it's blocked by PR52954.
Updating the status to avoid duplicated effort implementing this paper.
2022-08-20 14:45:17 +02:00
Tom Stellard 1f0b4f4da0 More llvm-docs-sphinx buildbot fixes
Broken by 7225c0bd01 and
662a11bd06.
2022-08-20 01:51:48 -07:00
Tom Stellard eba370e133 Fix llvm-docs-sphinx buildbot after 7225c0bd01 2022-08-20 01:31:32 -07:00
Tom Stellard 7225c0bd01 HowToReleaseLLVM: Add annual release schedule template
Reviewed By: ldionne, thieta

Differential Revision: https://reviews.llvm.org/D95114
2022-08-20 01:25:14 -07:00
Tom Stellard 662a11bd06 HowToReleaseLLVM: Add some more details about website updates
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D131634
2022-08-20 01:22:03 -07:00
Tom Stellard 99020b3c73 workflows/llvm-project-tests: Workaround an issue with lldb builds on Windows
For some reason cmake started selecting a 32-bit version of python on
Windows instead of the 64-bit version when building windows.  Explicitly
setting the default python to 3.10 fixes this problem.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D132280
2022-08-20 00:15:18 -07:00
Kazu Hirata 9e296584ce Fix unused variable warnings
These warnings came up with gcc-11.3.0.
2022-08-20 00:12:35 -07:00
Michał Górny d92f49fc4b Reland "[lldb] [test] Disable new CommunicationTests on Windows"
This change was wrongly reverted and re-broke the Windows buildbot.

Sponsored by: The FreeBSD Foundation
2022-08-20 08:32:55 +02:00