Kazu Hirata [Mon, 22 Aug 2022 18:11:30 +0000 (11:11 -0700)]
[CodeGen] Fix unused variable warnings
Usman Nadeem [Mon, 22 Aug 2022 17:24:49 +0000 (10:24 -0700)]
[Flang][Driver] Add support for PIC
This patch does the following:
- Consumes the PIC flags (fPIC/fPIE/fropi/frwpi etc) in flang-new.
tools::ParsePICArgs() in ToolChains/CommonArgs.cpp is used for this.
- Adds FC1Option to "-mrelocation-model", "-pic-level", and "-pic-is-pie"
command line options.
- Adds the above options to flang/Frontend/CodeGenOptions' data structure.
- Sets the relocation model in the target machine, and
- Sets module flags for the respective PIC/PIE type in LLVM IR.
I have tried my best to replicate how clang does things.
Differential Revision: https://reviews.llvm.org/D131533
Change-Id: I68fe64910be28147dc5617826641cea71b92d94d
Philip Reames [Mon, 22 Aug 2022 17:41:28 +0000 (10:41 -0700)]
[TTI] Remove OperandValueKind/Properties from getArithmeticInstrCost interface [nfc]
This completes the client side transition to the OperandValueInfo version of this routine. Backend TTI implementations still use the prior versions for now.
Nemanja Ivanovic [Mon, 22 Aug 2022 15:34:19 +0000 (10:34 -0500)]
[GTest] Change detection of libpthread
We currently use CMake's find_library function to detect whether
libpthread exists on the system to determine if pthread should
be added on the link step. However, there are configurations in
which CMake's path checking fails to find the library even though
the toolchain has it.
One such case is with Clang 14.0.0 on PowerPC. Due to a recent
change, the build puts libc++ and related libraries in a
subdirectory that appears to depend on the default target triple.
CMake then uses that subdirectory to determine the architecture
and adds that name to its search paths. However, the triple for
the system GNU toolchain is different so CMake fails to find it.
Namely, Clang 14.0.0's default target triple and the subdirectory
name is powerpc64le-unknown-linux-gnu whereas the system GNU
toolchain has powerpc64le-linux-gnu. Clang's driver has no trouble
finding either the GNU includes/libraries or Clang's own. But
CMake seems to get this wrong.
The net result of this is that we can't do a shared libraries
build of ToT with Clang 14.0.0.
This patch proposes using HAVE_LIBPTHREAD which CMake seems to
determine by compiling a test file with -lpthread (or perhaps
-pthread, I can't really get CMake to tell me how it is figuring
this out). If that variable tells CMake that the build compiler
accepts the pthread option, it seems reasonable to depend on
that variable to determine if we should add it to the link step
when building the llvm_gtest library.
Kazu Hirata [Mon, 22 Aug 2022 17:57:16 +0000 (10:57 -0700)]
[LiveDebugValues] Fix a warning
This patch fixes:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h:330:5: error:
anonymous types declared in an anonymous union are an extension
[-Werror,-Wnested-anon-types]
Mike Rice [Fri, 19 Aug 2022 23:44:55 +0000 (16:44 -0700)]
[OpenMP][NFC] Use OMPInteropInfo in the OMPDeclareVariantAttr attribute
In preparation for allowing the prefer_type list in the append_args clause,
use the OMPInteropInfo in the attribute for 'declare variant'.
This requires adding a new Argument kind to the attribute code. This change
adds a specific attribute to pass an array of OMPInteropInfo. It implements
new tablegen needed to handle the interop-type part of the structure. When
prefer_type is added, more work will be needed to dump, instantiate, and
serialize the PreferTypes field in OMPInteropInfo.
Differential Revision: https://reviews.llvm.org/D132270
Tarun Prabhu [Mon, 22 Aug 2022 17:21:47 +0000 (11:21 -0600)]
[flang] Fold F08 parity intrinsic
Perform compile-time folding of the F08 parity intrinsic when all parameters are compile-time constants.
Differential Revision: https://reviews.llvm.org/D129785
Philip Reames [Mon, 22 Aug 2022 16:59:59 +0000 (09:59 -0700)]
[TTI] Migrate getOperandInfo to OperandVaueInfo [nfc]
This is part of merging OperandValueKind and OperandValueProperties.
Arthur Eubanks [Mon, 22 Aug 2022 17:02:30 +0000 (10:02 -0700)]
[bazel][docs] Mention how to provide path to compiler
And some other cleanups/clarifications.
Reviewed By: saugustine
Differential Revision: https://reviews.llvm.org/D132396
Arthur Eubanks [Mon, 22 Aug 2022 17:12:10 +0000 (10:12 -0700)]
[bazel] Move some CI flags into .bazelrc
Stephen Tozer [Fri, 17 Jun 2022 15:20:06 +0000 (16:20 +0100)]
[DebugInfo][NFC] Represent DbgValues with multiple ops in IRefLDV
In preparation for allowing InstrRefBasedLDV to handle DBG_VALUE_LIST,
this patch updates the internal representation that it uses to represent
debug values to store a list of values. This is one of the more
significant changes in terms of line count, but is fairly simple and
should not affect the output of this pass.
Differential Revision: https://reviews.llvm.org/D128177
River Riddle [Mon, 22 Aug 2022 17:02:18 +0000 (10:02 -0700)]
[mlir:Bytecode] Fix asan failure
We were accessing the region state after it got popped from the stack.
Dmitry Preobrazhensky [Mon, 22 Aug 2022 16:51:31 +0000 (19:51 +0300)]
[AMDGPU][MC][GFX10][NFC] Consolidate tests by encoding
Differential Revision: https://reviews.llvm.org/D132235
Philip Reames [Mon, 22 Aug 2022 15:58:15 +0000 (08:58 -0700)]
[TTI] Start process of merging OperandValueKind and OperandValueProperties [nfc]
OperandValueKind and OperandValueProperties both provide facts about the operands of an instruction for purposes of cost modeling. We've discussed merging them several times; before I plumb through more flags, let's go ahead and do so.
This change only adds the client side interface for getArithmeticInstrCost and makes a couple of minor changes in client code to prove that it works. Target TTI implementations still use the split flags. I'm deliberately splitting what could be one big change into a series of smaller ones so that I can lean on the compiler to catch errors along the way.
Arthur Eubanks [Mon, 22 Aug 2022 16:36:23 +0000 (09:36 -0700)]
[bazel] Add note about using -c opt for CI
Matthias Braun [Wed, 17 Aug 2022 17:54:12 +0000 (10:54 -0700)]
RegisterClassInfo: Fix CSR cache invalidation
`RegisterClassInfo` caches information like allocation orders and reuses
it for multiple machine functions where possible. However the `MCPhysReg
*CalleeSavedRegs` field used to test whether the set of callee saved
registers changed did not work: After D28566
`MachineRegisterInfo::getCalleeSavedRegs()` can return dynamically
computed CSR sets that are only valid while the `MachineRegisterInfo`
object of the current function exists.
This changes the code to make a copy of the CSR list instead of keeping
a possibly invalid pointer around.
Differential Revision: https://reviews.llvm.org/D132080
Nico Weber [Fri, 19 Aug 2022 18:45:32 +0000 (14:45 -0400)]
clang/apple: Infer simulator env from -mios-simulator-version-min= flag
Before this patch, open-source clang would consider
`-target x86_64-apple-darwin -mios-simulator-version-min=11.0` as
targeting the iOS simulator, due to the mios flag informing it
that we want to target iOS, and logic in the driver then realizing
that x86 iOS builds must be the simulator.
However, for `-target arm64-apple-darwin -mios-simulator-version-min=11.0`
that didn't work and clang thought that it's building for actual iOS,
and not for the simulator.
Due to this, building compiler-rt for arm64 iossim would lead to
all .o files in RTSanitizerCommonSymbolizer.iossim.dir being built
for iOS instead of for iOS simulator, and clang would ask ld64 to
link for iOS, but using the iPhoneSimulator sysroot. This would then
lead to many warnings from ld64 looking like:
ld: warning: building for iOS, but linking in .tbd file
(.../iPhoneSimulator.sdk/usr/lib/libc++abi.tbd) built for iOS Simulator
Worse, with ld64.lld, this diagnostic is currently an error instead
of a warning.
This patch makes it so that the presence of -mios-simulator-version-min=
now informs clang that we're building for simulator. That way, all the
.o files are built for simulator, the linker is informed that we're
building for simulator, and everything Just Works.
(Xcode's clang already behaves like this, so this makes open-source clang
match Xcode clang.)
We can now likely remove the hack to treat non-mac darwin x86 as
simulator, but doing that feels slightly risky, so I'm leaving that
for a follow-up patch.
(This patch is made necessary by the existence of arm64 macs.)
Differential Revision: https://reviews.llvm.org/D132258
Goran Flegar [Mon, 22 Aug 2022 15:59:51 +0000 (17:59 +0200)]
[mlir] Fix compile errors with bytecode support
Guillaume Chatelet [Mon, 22 Aug 2022 15:40:57 +0000 (15:40 +0000)]
[NFC][libc] clarify CPP folder documentation
Stephen Tozer [Thu, 16 Jun 2022 14:08:13 +0000 (15:08 +0100)]
[DebugInfo][NFC] Update LDV to use generic DBG_VALUE* MI interface
Currently, InstrRefLDV only handles DBG_VALUE instructions, not
DBG_VALUE_LIST, and as a result of this it handles these instructions
using functions that only work for that type of debug value, i.e. using
getOperand(0) to get the debug operand. This patch changes this to use
the generic debug value functions, such as getDebugOperand and
isDebugOffsetImm, as well as adding an IsVariadic field to the
DbgValueProperties class and a few other minor changes to acknowledge
DBG_VALUE_LISTs. Note that this patch does not add support for
DBG_VALUE_LIST here, but is a precursor to other patches that do add
that support.
Differential Revision: https://reviews.llvm.org/D128174
Guillaume Chatelet [Mon, 22 Aug 2022 15:25:14 +0000 (15:25 +0000)]
[libc][NFC] Use STL case for string_view
Matthias Springer [Mon, 22 Aug 2022 14:59:36 +0000 (16:59 +0200)]
[mlir][tensor][bufferize] Bufferize tensor.pad
tensor.pad is lowered to tensor.generate + tensor.insert_slice during bufferization. For best performance with constant padding values, users should vectorize the IR before bufferizing it.
This change also relaxes tje restriction that no new ops that bufferize to a memory write should be added during bufferization. Since bufferization has been split into two steps a while ago (tensor copy insertion + bufferization), it is reasonable to allow this now.
Differential Revision: https://reviews.llvm.org/D132355
Matthias Springer [Mon, 22 Aug 2022 14:48:17 +0000 (16:48 +0200)]
[mlir][linalg][transform] Support dynamic tile sizes in TileToForeachThreadOp
TileToForeachThreadOp now accepts mixed SSA value operands / index attributes for tile_sizes and num_threads. (Reusing OperandsOrIntegersSizesList.) In case of an operand, a PDL_Operation must be specified that is mapped to a payload op that returns the tile size or number of threads.
Differential Revision: https://reviews.llvm.org/D131949
Denis Antrushin [Mon, 22 Aug 2022 14:00:51 +0000 (21:00 +0700)]
Reapply "[NFC] Precommit test for D132255".
Changed check line to accomodate assertion text difference on
mac and windows; added 'REQUIRES: asserts' line.
This reverts commit
89aaae57eacf77a6902ef8d4af5c92a3d6c642c2.
Chuanqi Xu [Mon, 22 Aug 2022 14:15:24 +0000 (22:15 +0800)]
[docs] Adjust the example command line in DebuggingCoroutines.rst
The original commandline example was not correct in some environments.
Adjust the example to avoid any misunderstanding.
Phoebe Wang [Mon, 22 Aug 2022 01:59:42 +0000 (09:59 +0800)]
[X86][AVX512FP16] Add the missing const modifiers. NFCI
This patch fixes lit fails after D132342.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D132372
Stephen Tozer [Tue, 17 May 2022 14:35:27 +0000 (15:35 +0100)]
[DebugInfo] Handle joins PHI+Def values in InstrRef LiveDebugValues
In the InstrRefBasedImpl for LiveDebugValues, we attempt to propagate
debug values through basic blocks in part by checking to see whether all
a variable's incoming debug values to a BB "agree", i.e. whether their
properties match and they refer to the same underlying value.
Prior to this patch, the check for agreement between incoming values
relied on exact equality, which meant that a VPHI and a Def DbgValue
that referred to the same underlying value would be seen as disagreeing.
This patch changes this behaviour to treat them as referring to the same
value, allowing the shared value to propagate into the BB.
Differential Revision: https://reviews.llvm.org/D125953
Aaron Ballman [Mon, 22 Aug 2022 13:46:12 +0000 (09:46 -0400)]
Add N2562 to the C status page
It was originally left off thinking the paper only impacts the C
standard library, but Clang supports diagnostics for incorrect use of
a format specifier, so this paper has some frontend impacts as well.
Michael Buch [Fri, 19 Aug 2022 14:11:26 +0000 (15:11 +0100)]
[lldb][ClangExpression] Remove storage-class check when creating AsmLabel
This check was put in place to prevent static functions
from translation units outside the one that the current
expression is evaluated from taking precedence over functions
in the global namespace. However, this is really a different
bug. LLDB lumps functions from all CUs into a single AST and
ends up picking the file-static even when C++ context rules
wouldn't allow that to happen.
This patch removes the check so we apply the AsmLabel to all
FunctionDecls we create from DWARF if we have a linkage name
available. This makes the code-path easier to reason about and
allows calling static functions in contexts where we previously
would've chosen the wrong function.
We also flip the XFAILs in the API test to reflect what effect
this change has.
**Testing**
* Fixed API tests and added XFAIL
Differential Revision: https://reviews.llvm.org/D132231
Michael Buch [Sat, 20 Aug 2022 00:47:41 +0000 (01:47 +0100)]
[lldb][Test] Replace expect() with expect_expr() in TestNamespaceLookup.py
This will be useful in preparation for some reshuffling
of assertions in this file since we won't have to
adjust the persitent variable names during the process.
sed commands:
```
s/expect("expr -- /expect_expr("/g
s/startstr="(int) [$0-9]* = /result_type="int", result_value="/g
```
**Testing**
* API tests still pass
Differential Revision: https://reviews.llvm.org/D132271
Florian Hahn [Mon, 22 Aug 2022 12:11:26 +0000 (13:11 +0100)]
[LAA] Add test cases where BTC can be used to rule out dependences.
Test cases for using the backedge-taken-count to rule out dependencies between
an invariant and strided accesses.
isuckatcs [Sat, 13 Aug 2022 13:41:51 +0000 (15:41 +0200)]
[analyzer] Handling non-POD multidimensional arrays in ArrayInitLoopExpr
This patch makes it possible for lambdas, implicit copy/move ctors
and structured bindings to handle non-POD multidimensional arrays.
Differential Revision: https://reviews.llvm.org/D131840
Martin Storsjö [Mon, 22 Aug 2022 11:53:29 +0000 (14:53 +0300)]
[lldb] Silence a GCC warning about missing returns after a fully covered switch. NFC.
David Green [Mon, 22 Aug 2022 11:44:57 +0000 (12:44 +0100)]
[AArch64] Add SK_Splice fixed-width costs
A fixed length SK_Splice shuffle vector is lowered to a Ext under
AArch64, which should have a cost of 1.
Differential Revision: https://reviews.llvm.org/D132299
Simon Pilgrim [Mon, 22 Aug 2022 11:40:07 +0000 (12:40 +0100)]
[CostModel][X86] Fix a off-by-one typo in the v64i8 splice shuffle test
isuckatcs [Tue, 16 Aug 2022 07:31:24 +0000 (09:31 +0200)]
[analyzer] Remove pattern matching of lambda capture initializers
Prior to this patch we handled lambda captures based on their
initializer expression, which resulted in pattern matching. With
C++17 copy elision the initializer expression can be anything,
and this approach proved to be fragile and a source of crashes.
This patch removes pattern matching and only checks whether the
object is under construction or not.
Differential Revision: https://reviews.llvm.org/D131944
Guillaume Chatelet [Mon, 22 Aug 2022 10:52:14 +0000 (10:52 +0000)]
[NFC][libc] Remove ArrayRef which is replaced with span
Simon Pilgrim [Mon, 22 Aug 2022 10:26:30 +0000 (11:26 +0100)]
[CostModel][X86] Add some basic SK_Splice shuffle test coverage
These are currently recognised as SK_PermuteTwoSrc
Guillaume Chatelet [Mon, 22 Aug 2022 10:26:48 +0000 (10:26 +0000)]
[NFC][libc] Switch File impl to span instead of ArrayRef
Goran Flegar [Mon, 22 Aug 2022 10:06:47 +0000 (12:06 +0200)]
[mlir][Bazel] Fix bazel build
Add fixes for https://reviews.llvm.org/D131747
Emmmer [Mon, 22 Aug 2022 08:28:43 +0000 (16:28 +0800)]
[LLDB] Fix: make m_target_arch private
Using GetTargetArchitecture() instead of m_target_arch, and set m_target_arch to private.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D132353
Guillaume Chatelet [Mon, 22 Aug 2022 09:56:38 +0000 (09:56 +0000)]
[NFC][libc] Switch mem* tests from ArrayRef to span
David Green [Mon, 22 Aug 2022 09:58:14 +0000 (10:58 +0100)]
[ARM] Add a couple of MVE fixed-order-reduction tests. NFC
Simon Pilgrim [Mon, 22 Aug 2022 09:50:57 +0000 (10:50 +0100)]
[CostModel][X86] getShuffleCost - treat SK_Splice as SK_PermuteTwoSrc
SK_Splice should be equivalent to a PALIGNR instruction etc. - but as discussed on D132308, until full fixed vector support for SK_Splice is in place, just assume its a SK_PermuteTwoSrc.
Guillaume Chatelet [Mon, 22 Aug 2022 09:42:53 +0000 (09:42 +0000)]
[libc] Allow span views over mutable data
Kadir Cetinkaya [Mon, 22 Aug 2022 08:56:57 +0000 (10:56 +0200)]
[clangd] Disable IncludeCleaner for ObjC
Florian Hahn [Mon, 22 Aug 2022 09:21:11 +0000 (10:21 +0100)]
[DSE] Add additional uses to tests to ensure stores be removed.
Make some tests a bit more robust with respect to future changes.
Christian Sigg [Mon, 22 Aug 2022 08:39:49 +0000 (10:39 +0200)]
[MLIR][GPU] Detect bounds with `arith.minsi ` in loops-to-gpu
Previously, `arith.constant`, `arith.muli` and `affine.min` were supported when deriving upper loop bounds when converting parallel loops to GPU.
Reviewed By: akuegel
Differential Revision: https://reviews.llvm.org/D132354
Valentin Clement [Mon, 22 Aug 2022 09:12:20 +0000 (11:12 +0200)]
[flang] Add bind(C) to buitlin C_PTR
D131585 Adds couple of semantics check for the components of BIND(C)
derived-type. This would raise an error when a component is of C_PTR
type. Add `bind(c)` to the `__builtin_c_ptr` type so the wrong error
is not triggered.
Reviewed By: peixin, jeanPerier
Differential Revision: https://reviews.llvm.org/D132350
Guillaume Chatelet [Mon, 22 Aug 2022 08:54:13 +0000 (08:54 +0000)]
[libc] Allow construction of const span from mutable span
Victor Campos [Fri, 19 Aug 2022 07:46:55 +0000 (08:46 +0100)]
[ARM] Fix bug in also_compatible_with attribute parser
Check ScopedPrinter pointer before attempting to print the attribute's
parsed information.
Patch by Michael Platings and Victor Campos
Reviewed By: pratlucas
Differential Revision: https://reviews.llvm.org/D132214
River Riddle [Mon, 22 Aug 2022 08:31:31 +0000 (01:31 -0700)]
[mlir] Fix bots after bytecode support was added in D131747
* Fix ambiguous Twine constructor call
* Ensure shift is 64-bit (for MSVC)
* Disable bytecode tests on s390x (we don't support big endian right now)
Guillaume Chatelet [Mon, 22 Aug 2022 08:09:23 +0000 (08:09 +0000)]
[reland][NFC][libc] Use span instead of ArrayRef
Guillaume Chatelet [Mon, 22 Aug 2022 08:14:22 +0000 (08:14 +0000)]
Revert "[NFC][libc] Use span instead of ArrayRef"
This reverts commit
e7b250b8a6e2bd7e2cb85e0a90d77b1a3326814b.
Guillaume Chatelet [Mon, 22 Aug 2022 08:09:23 +0000 (08:09 +0000)]
[NFC][libc] Use span instead of ArrayRef
River Riddle [Fri, 12 Aug 2022 03:06:33 +0000 (20:06 -0700)]
[mlir] Add initial support for a binary serialization format
This commit adds a new bytecode serialization format for MLIR.
The actual serialization of MLIR to binary is relatively straightforward,
given the very very general structure of MLIR. The underlying basis for
this format is a variable-length encoding for integers, which gets heavily
used for nearly all aspects of the encoding (given that most of the encoding
is just indexing into lists).
The format currently does not provide support for custom attribute/type
serialization, and thus always uses an assembly format fallback. It also
doesn't provide support for resources. These will be added in followups,
the intention for this patch is to provide something that supports the
basic cases, and can be built on top of.
https://discourse.llvm.org/t/rfc-a-binary-serialization-format-for-mlir/63518
Differential Revision: https://reviews.llvm.org/D131747
Max Kazantsev [Mon, 22 Aug 2022 06:09:20 +0000 (13:09 +0700)]
[SCEV] Prove condition invariance via context, try 2
Initial implementation had too weak requirements to positive/negative
range crossings. Not crossing zero with nuw is not enough for two reasons:
- If ArLHS has negative step, it may turn from positive to negative
without crossing 0 boundary from left to right (and crossing right to
left doesn't count for unsigned);
- If ArLHS crosses SINT_MAX boundary, it still turns from positive to
negative;
In fact we require that ArLHS always stays non-negative or negative,
which an be enforced by the following set of preconditions:
- both nuw and nsw;
- positive step (looks liftable);
Because of positive step, boundary crossing is only possible from left
part to the right part. And because of no-wrap flags, it is guaranteed
to never happen.
Guillaume Chatelet [Fri, 19 Aug 2022 17:52:36 +0000 (17:52 +0000)]
[libc] Add a span facility
This is intended to replace ArrayRef.
Differential Revision: https://reviews.llvm.org/D132254
owenca [Mon, 22 Aug 2022 04:32:50 +0000 (21:32 -0700)]
Revert "[clang-format][NFC] Fix a bug in setting type FunctionLBrace"
This reverts commit
35f7dd601d33219fafa2c0d308e187df3e36847a.
Fixes #57200.
Max Kazantsev [Mon, 22 Aug 2022 06:01:35 +0000 (13:01 +0700)]
[Test] And one more test for PR57247
Vitaly Buka [Mon, 22 Aug 2022 05:39:23 +0000 (22:39 -0700)]
[clang] Fix warning after D116203
The warning was:
SemaType.cpp:9469:3: error: default label in switch
which covers all enumeration values
[-Werror,-Wcovered-switch-default]
wanglei [Mon, 22 Aug 2022 05:10:29 +0000 (13:10 +0800)]
[LoongArch][test] Regenerate loongarch_generated_funcs.test checks
This patch fix test failure due to D132006.
Differential Revision: https://reviews.llvm.org/D132346
Max Kazantsev [Mon, 22 Aug 2022 05:22:49 +0000 (12:22 +0700)]
[Test] One more test for PR57247
Show that the issue also exists with positive steps.
Shao-Ce SUN [Mon, 22 Aug 2022 03:53:16 +0000 (11:53 +0800)]
[RISCV] Add zihintntl instructions
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D121670
gonglingqin [Mon, 22 Aug 2022 02:58:29 +0000 (10:58 +0800)]
[LoongArch] Support Load and Store with 14-bit signed immediate operands
Differential Revision: https://reviews.llvm.org/D131954
Christopher Di Bella [Mon, 22 Aug 2022 01:07:08 +0000 (01:07 +0000)]
[libcxx][NFC] utilises compiler builtins for unary transform type-traits
Depends on D116203
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D131732
Christopher Di Bella [Mon, 22 Aug 2022 00:27:10 +0000 (00:27 +0000)]
[clang] adds unary type transformations as compiler built-ins
Adds
* `__add_lvalue_reference`
* `__add_pointer`
* `__add_rvalue_reference`
* `__decay`
* `__make_signed`
* `__make_unsigned`
* `__remove_all_extents`
* `__remove_extent`
* `__remove_const`
* `__remove_volatile`
* `__remove_cv`
* `__remove_pointer`
* `__remove_reference`
* `__remove_cvref`
These are all compiler built-in equivalents of the unary type traits
found in [[meta.trans]][1]. The compiler already has all of the
information it needs to answer these transformations, so we can skip
needing to make partial specialisations in standard library
implementations (we already do this for a lot of the query traits). This
will hopefully improve compile times, as we won't need use as much
memory in such a base part of the standard library.
[1]: http://wg21.link/meta.trans
Co-authored-by: zoecarver
Reviewed By: aaron.ballman, rsmith
Differential Revision: https://reviews.llvm.org/D116203
Ting Wang [Mon, 22 Aug 2022 02:20:40 +0000 (22:20 -0400)]
[PowerPC][Coroutines] Add tail-call check with call information for coroutines
Fixes #56679.
Reviewed By: ChuanqiXu, shchenz
Differential Revision: https://reviews.llvm.org/D131953
wanglian [Fri, 19 Aug 2022 08:37:53 +0000 (16:37 +0800)]
[AArch64][NFC] Replace setOperationAction and AddPromotedToType
with setOperationPromotedToType.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D132213
Vitaly Buka [Mon, 22 Aug 2022 01:41:55 +0000 (18:41 -0700)]
[sanitizer] use ../runtimes path to build libcxx
owenca [Thu, 18 Aug 2022 05:12:07 +0000 (22:12 -0700)]
[clang-format] Fix BeforeHash indent of comments above PPDirective
Fixes #56326.
Differential Revision: https://reviews.llvm.org/D132097
Joe Loser [Sun, 21 Aug 2022 00:48:05 +0000 (18:48 -0600)]
[ADT] Remove `is_invocable` from `STLExtras.h`
As a follow-up of https://reviews.llvm.org/D132318, now that the callers have
been adjusted to use `std::is_invocable`, remove `llvm::is_invocable` and its
tests.
Differential Revision: https://reviews.llvm.org/D132321
Joe Loser [Sun, 21 Aug 2022 16:41:13 +0000 (10:41 -0600)]
[ADT] Clarify llvm::bit_cast implementation comment
When reviewing https://reviews.llvm.org/D132330, I noticed a few pre-existing
comments regarding the implementation of `llvm::bit_cast`. One comment is a bit
misleading since `std::bit_cast` is a C++20 standard library thing, not a
C++17 one (otherwise we could use it directly). Clarify that in the comment.
Differential Revision: https://reviews.llvm.org/D132332
Craig Topper [Sun, 21 Aug 2022 20:14:31 +0000 (13:14 -0700)]
[RISCV] Remove impossible TODO in RISCVRedundantCopyElimination. NFC
If there are multiple conditional branches we shouldn't do any
optimization.
Craig Topper [Sun, 21 Aug 2022 18:46:05 +0000 (11:46 -0700)]
[RISCV] Optimize x <s -1 ? x : -1. Improve x >u 1 ? x : 1.
Similar to D132211, we can optimize x <s -1 ? x : -1 -> x <s 0 ? x : -1
Also improve the unsigned case from D132211 to use x != 0 which
will give a bnez instruction which might be compressible.
Differential Revision: https://reviews.llvm.org/D132252
Craig Topper [Sun, 21 Aug 2022 17:56:24 +0000 (10:56 -0700)]
[RISCV] Be more strict about LUI+ADDI macrofusion pre-RA.
Don't macrofuse if the LUI has more than 1 user. That will likely
require the LUI to have a different destination register post-RA.
LUI+ADDI can only be fused if they write the same register.
Kazu Hirata [Sun, 21 Aug 2022 17:39:21 +0000 (10:39 -0700)]
[ADT] Simplify llvm::bit_cast (NFC)
This patch removes macro tricks to check GCC versions.
The commit message from
19262fc5966ab569f21f3d440f8b001bca666f17
states that "is_trivially_copyable is only in GCC 5.1 and later".
Note that we now require GCC 7.1 or higher.
Since both std::is_trivially_constructible and
std::is_trivially_copyable are C++11 features, and we now require
C++17, we probably don't need to worry about the availability of the
C++11 features.
Differential Revision: https://reviews.llvm.org/D132330
Kazu Hirata [Sun, 21 Aug 2022 17:39:19 +0000 (10:39 -0700)]
Remove llvm::is_trivially_copyable (NFC)
This patch removes llvm::is_trivially_copyable as it seems to be dead.
Once I remove it, HAVE_STD_IS_TRIVIALLY_COPYABLE has no users, so this
patch removes the macro also.
The comment on llvm::is_trivially_copyable mentions GCC 4.9, but note
that we now require GCC 7.1 or higher.
Differential Revision: https://reviews.llvm.org/D132328
Sesha Kalyur [Sun, 21 Aug 2022 16:53:51 +0000 (22:23 +0530)]
[flang][OpenMP] Parser support for Target directive and Device clause
This patch adds support for the device clause on `Target` directive.
Device clause was added in OpenMP specification version 4.5 to
create a device data environment for the extent of a region. On
target construct, the device expression be either be `ancestor`
(taking after the parent) or assign a new `device_num`.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D126441
Simon Pilgrim [Sun, 21 Aug 2022 16:42:05 +0000 (17:42 +0100)]
[CostModel][X86] Add CodeSize handling for fadd/fsub/fmul/fsqrt ops
Eventually this will be part of the cost table lookup
Joe Loser [Sat, 20 Aug 2022 23:53:58 +0000 (17:53 -0600)]
[ADT] Replace `void_t` equivalent with `std::void_t`
Use `std::void_t` instead of defining our own equivalent in `STLExtras.h` now
that C++17 is available for use.
Differential Revision: https://reviews.llvm.org/D132319
Simon Pilgrim [Sun, 21 Aug 2022 15:51:45 +0000 (16:51 +0100)]
Revert rG15de7aaae52ef4be9f9ff3b130804e5b5ccd29f4 "[CostModel][X86] Add CodeSize/SizeLatency handling for fadd/fsub/fmul/fsqrt ops"
This is unintentionally affecting some backend tests
Simon Pilgrim [Sun, 21 Aug 2022 15:39:47 +0000 (16:39 +0100)]
[CostModel][X86] Add CodeSize/SizeLatency handling for fadd/fsub/fmul/fsqrt ops
Eventually this will be part of the cost table lookup
Mark de Wever [Sun, 21 Aug 2022 15:16:14 +0000 (17:16 +0200)]
[NFC][libc++][doc] Improves rst formatting.
Kai Sasaki [Sun, 21 Aug 2022 14:54:44 +0000 (20:24 +0530)]
[NFC][mlir][affine] Typo in Affine Analysis test
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D132201
Joe Loser [Sat, 20 Aug 2022 23:21:13 +0000 (17:21 -0600)]
[libc++] Fix typos in deprecation messages for experimental searchers
Fix the typo in the deprecated messages for these searchers:
`s/exprerimental/experimental`.
Differential Revision: https://reviews.llvm.org/D132317
Sanjay Patel [Sun, 21 Aug 2022 13:42:14 +0000 (09:42 -0400)]
[InstCombine] reassociate bitwise logic chains based on uses
(X op Y) op Z --> (Y op Z) op X
This isn't a complete solution (see TODO tests for possible refinements),
but it shows some nice wins and doesn't seem to cause any harm. I think
the most potential danger is from conflicting with other folds and causing
an infinite loop - that's the reason for avoiding patterns with constant
operands.
Alternatively, we could try this in the reassociate pass, but we would not
immediately see all of the logic folds that instcombine provides. I also
looked at improving ValueTracking's isImpliedCondition() (and we should
still add some enhancements there), but that would not work in general for
bitwise logic reduction.
The tests that reduce completely to 0/-1 are motivated by issue #56653.
Differential Revision: https://reviews.llvm.org/D131356
John Ericson [Sun, 21 Aug 2022 12:57:01 +0000 (08:57 -0400)]
[CMake] Weaken
176db3b3ab25ff8a9b2405f50ef5a8bd9304a6d5
That commit (D132324) made putting libc++ in LLVM_ENABLE_RUNTIMES a hard
error, but ther are some out-of-tree CI jobs (especially docs that need
fixing).
I am thus making it a "soft error" for now, until that is resolved.
Simon Pilgrim [Sun, 21 Aug 2022 12:39:55 +0000 (13:39 +0100)]
[PhaseOrdering][X86] Regenerate vdiv.ll
Noticed while cleaning up x86 cost tables for upcoming cost kind support and it affected this test
LiaoChunyu [Fri, 19 Aug 2022 08:14:19 +0000 (16:14 +0800)]
[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
John Ericson [Sat, 20 Aug 2022 15:04:41 +0000 (11:04 -0400)]
[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
John Ericson [Sun, 21 Aug 2022 01:47:45 +0000 (21:47 -0400)]
[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
Simon Pilgrim [Sun, 21 Aug 2022 11:33:10 +0000 (12:33 +0100)]
[CostModel][X86] Add trunc cost kinds tests
Simon Pilgrim [Sun, 21 Aug 2022 11:03:01 +0000 (12:03 +0100)]
[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.
Anubhab Ghosh [Sat, 20 Aug 2022 20:19:34 +0000 (01:49 +0530)]
[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
Anubhab Ghosh [Sat, 20 Aug 2022 20:13:20 +0000 (01:43 +0530)]
[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
Anubhab Ghosh [Sat, 20 Aug 2022 20:00:15 +0000 (01:30 +0530)]
[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
Anubhab Ghosh [Sat, 20 Aug 2022 19:49:48 +0000 (01:19 +0530)]
[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
Simon Pilgrim [Sun, 21 Aug 2022 10:49:27 +0000 (11:49 +0100)]
[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.
Tung D. Le [Sat, 20 Aug 2022 02:00:28 +0000 (07:30 +0530)]
[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