Min-Yih Hsu [Thu, 1 Jul 2021 00:12:47 +0000 (17:12 -0700)]
Reapply "[M68k][GloballSel] Formal arguments lowering in IRTranslator"
Implementation of formal arguments lowering in the IRTranslator for the
M68k backend
Differential Revision: https://reviews.llvm.org/D104542
Richard Smith [Thu, 1 Jul 2021 00:11:32 +0000 (17:11 -0700)]
Fix test following Clang change ef227b3.
Geoffrey Martin-Noble [Mon, 28 Jun 2021 20:09:48 +0000 (13:09 -0700)]
[Bazel] Rework LLVM target selection
This patch introduces a custom rule for expanding the LLVM target
enumeration .def files. This provides a slightly cleaner API for these
rules, but is mostly to permit selects to be used when determining which
LLVM targets to build. Right now the target list is generated at Bazel
configure time, but this will allows us to add functionality to also
control which targets are built based on config settings.
Tested: Ran `bazel test --config=rbe ... @llvm-project//...`
Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D104969
Geoffrey Martin-Noble [Wed, 30 Jun 2021 23:46:55 +0000 (16:46 -0700)]
[Bazel] Update README with examples
Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D105245
thomasraoux [Wed, 30 Jun 2021 23:22:31 +0000 (16:22 -0700)]
[mlir][vector] Extend vector distribution to all elementwise and contract
Uses elementwise interface to generalize canonicalization pattern and add a new
pattern for vector.contract case.
Differential Revision: https://reviews.llvm.org/D104343
Sanjay Patel [Wed, 30 Jun 2021 21:27:10 +0000 (17:27 -0400)]
[InstCombine] fold icmp ult of offset value with constant
This is one sibling of the fold added with
c7b658aeb526 .
(X + C2) <u C --> X >s ~C2 (if C == C2 + SMIN)
I'm still not sure how to describe it best, but we're
translating 2 constants from an unsigned range comparison
to signed because that eliminates the offset (add) op.
This could be extended to handle the more general (non-constant)
pattern too:
https://alive2.llvm.org/ce/z/K-fMBf
define i1 @src(i8 %a, i8 %c2) {
%t = add i8 %a, %c2
%c = add i8 %c2, 128 ; SMIN
%ov = icmp ult i8 %t, %c
ret i1 %ov
}
define i1 @tgt(i8 %a, i8 %c2) {
%not_c2 = xor i8 %c2, -1
%ov = icmp sgt i8 %a, %not_c2
ret i1 %ov
}
Sanjay Patel [Wed, 30 Jun 2021 21:10:54 +0000 (17:10 -0400)]
[InstCombine][test] add tests for icmp ult with constant and offset; NFC
This is the 'ult' sibling pattern for:
c7b658aeb526c3e6
Jez Ng [Wed, 30 Jun 2021 22:55:38 +0000 (18:55 -0400)]
[lld-macho] Only enable `__DATA_CONST` for newer platforms
Matches ld64.
Reviewed By: #lld-macho, alexander-shaposhnikov
Differential Revision: https://reviews.llvm.org/D105080
Jez Ng [Wed, 30 Jun 2021 22:55:36 +0000 (18:55 -0400)]
[lld-macho] -section_rename should work on synthetic sections too
Previously, we only applied the renames to
ConcatOutputSections.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D105079
Siva Chandra Reddy [Wed, 30 Jun 2021 06:28:42 +0000 (06:28 +0000)]
[libc][NFC] Remove few deprecated FPUtil header files and test patterns.
Few tests have been converted to the new test patterns to facilitate
this.
Jeremy Morse [Wed, 30 Jun 2021 16:48:19 +0000 (17:48 +0100)]
[LiveDebugValues][InstrRef][2/2] Emit entry value variable locations
This patch adds support to the instruction-referencing LiveDebugValues
implementation for emitting entry values. The instruction referencing
implementations tracking by value rather than location means that we can
get around two of the issues with VarLocs. DBG_VALUE instructions that
re-assign the same value to a variable are no longer a problem, because we
can "see through" to the value being assigned. We also don't need to do
anything special during the dataflow stages: the "variable value problem"
doesn't need to know whether a value is available most of the time, and the
times it deoes need to know are always when entry values need to be
terminated.
The patch modifies the "TransferTracker" class, adding methods to identify
when a variable ias an entry value candidate, and when a machine value is
an entry value. recoverAsEntryValue tests these two things and emits an
entry-value expression if they're true. It's used when we clobber or
otherwise lose a value and can't find a replacement location for the value
it contained.
Differential Revision: https://reviews.llvm.org/D88406
Matt Arsenault [Wed, 9 Jun 2021 00:22:45 +0000 (20:22 -0400)]
GlobalISel: Use LLT in memory legality queries
This enables proper lowering of non-byte sized loads. We still aren't
faithfully preserving memory types everywhere, so the legality checks
still only consider the size.
Jon Chesterfield [Wed, 30 Jun 2021 21:40:06 +0000 (22:40 +0100)]
[libomptarget][nfc] Replace out arguments with struct return
A step towards making this function adequately self contained that it
can be tested easily. No functional change intended here, left variable
names unchanged.
Reviewed By: ronlieb
Differential Revision: https://reviews.llvm.org/D105229
Arthur O'Dwyer [Wed, 30 Jun 2021 21:37:43 +0000 (17:37 -0400)]
[libc++] graph_header_deps.py: Detect files that include themselves.
This wasn't happening before, which led to one slipping in.
Artem Belevich [Wed, 30 Jun 2021 20:12:57 +0000 (13:12 -0700)]
[Clang] allow overriding -fbasic-block-sections
We should not error out on non-x86 targets if `-fbasic-block-sections=none` is in effect.
Also, filter it out for GPU-side compilations, as we do with other options not
supported on the GPU.
Differential Revision: https://reviews.llvm.org/D105226
Richard Smith [Wed, 30 Jun 2021 21:05:34 +0000 (14:05 -0700)]
Add dumping support for RequiresExpr.
In passing, fix an ast-print bug that inserted a spurious extra `;`
after a concept definition.
Jon Chesterfield [Wed, 30 Jun 2021 21:23:34 +0000 (22:23 +0100)]
[libomptarget][amdgpu][nfc] Fix build warnings, drop some headers
Removes stdarg header, drops uses of iostream, fix some format string errors.
Also changes a C style struct to C++ style to avoid a warning from clang/
Reviewed By: pdhaliwal
Differential Revision: https://reviews.llvm.org/D104923
Matt Arsenault [Tue, 8 Jun 2021 21:11:12 +0000 (17:11 -0400)]
GlobalISel: Lower non-byte loads and stores
Previously we didn't preserve the memory type and had to blindly
interpret a number of bytes. Now that non-byte memory accesses are
representable, we can handle these correctly.
Ported from DAG version (minus some weird special case i1 legality
checking which I don't fully understand, and we don't have a way to
query for)
For now, this is NFC and the test changes are placeholders. Since the
legality queries are still relying on byte-flattened memory sizes, the
legalizer can't actually see these non-byte accesses. This keeps this
change self contained without merging it with the larger patch to
switch to LLT memory queries.
Matt Arsenault [Wed, 9 Jun 2021 13:19:36 +0000 (09:19 -0400)]
GlobalISel: Preserve memory type when reducing load/store width
Matt Arsenault [Wed, 9 Jun 2021 02:46:49 +0000 (22:46 -0400)]
AMDGPU/GlobalISel: Remove some problematic testcases
These testcases are a bit nonsensical and won't be handled correctly
for a long time. Remove them to unblock load/store legalization work.
Jonas Paulsson [Mon, 28 Jun 2021 23:18:25 +0000 (18:18 -0500)]
[MCStreamer] Move emission of attributes section into MCELFStreamer
Enable the emission of a GNU attributes section by reusing the code for
emitting the ARM build attributes section.
The GNU attributes follow the exact same section format as the ARM
BuildAttributes section, so this can be factored out and reused for GNU
attributes generally.
The immediate motivation for this is to emit a GNU attributes section for the
vector ABI on SystemZ (https://reviews.llvm.org/D105067).
Review: Logan Chien, Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D102894
Aleksandr Platonov [Wed, 30 Jun 2021 20:40:13 +0000 (21:40 +0100)]
[clangd][nfc] Show more information in logs when compiler instance prepare fails
Without this patch clangd silently process compiler instance prepare failure and only LSP errors "Invalid AST" could be found in logs.
E.g. the reason of the problem https://github.com/clangd/clangd/issues/734 is impossible to understand without verbose logs or with disabled background index.
This patch adds more information into logs to help understand the reason of such failures.
Logs without this patch:
```
E[...] Could not build a preamble for file test.cpp version 1
```
Logs with this patch:
```
E[...] Could not build a preamble for file test.cpp version 1: CreateTargetInfo() return null
..
E[...] Failed to prepare a compiler instance: unknown target ABI 'lp64'
```
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D104056
Matt Arsenault [Thu, 20 May 2021 02:25:51 +0000 (22:25 -0400)]
CodeGen: Print/parse LLTs in MachineMemOperands
This will currently accept the old number of bytes syntax, and convert
it to a scalar. This should be removed in the near future (I think I
converted all of the tests already, but likely missed a few).
Not sure what the exact syntax and policy should be. We can continue
printing the number of bytes for non-generic instructions to avoid
test churn and only allow non-scalar types for generic instructions.
This will currently print the LLT in parentheses, but accept parsing
the existing integers and implicitly converting to scalar. The
parentheses are a bit ugly, but the parser logic seems unable to deal
without either parentheses or some keyword to indicate the start of a
type.
Siva Chandra [Wed, 30 Jun 2021 20:45:38 +0000 (13:45 -0700)]
[libc][NFC] Clear all exceptions in exception_flags_test before raising another.
This is because, raising some exceptions can raise other ones. For
example, raising FE_OVERFLOW can raise FE_INEXACT. So, we need to clear all
exceptions if we want a clean slate.
Martin Storsjö [Tue, 29 Jun 2021 20:49:31 +0000 (23:49 +0300)]
[CMake] Don't use -Bsymbolic-functions for MinGW targets
This is an ELF specific option which isn't supported for Windows/MinGW
targets, even if the MinGW linker otherwise uses an ld.bfd like linker
interface.
Differential Revision: https://reviews.llvm.org/D105148
Valentin Churavy [Wed, 30 Jun 2021 19:44:54 +0000 (21:44 +0200)]
[Orc] Run the examples as part of the tests
Enable the Orc C-Bindings for testing.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D104637
Valentin Churavy [Wed, 30 Jun 2021 19:39:34 +0000 (21:39 +0200)]
[Orc] Fix name of LLVMOrcIRTransformLayerSetTransform
In https://reviews.llvm.org/D103855 we added access to IRTransformLayer, but I
just noticed that the function name is following the wrong pattern.
Differential Revision: https://reviews.llvm.org/D104840
Shilei Tian [Wed, 30 Jun 2021 19:39:43 +0000 (15:39 -0400)]
[OpenMP][Offloading] Replace all calls to `isSPMDMode` with `__kmpc_is_spmd_exec_mode`
In our ongoing work, we are using `AbstractAttributor` to deduct execution model
of device functions, and potententially remove unnecessary function calls to
`__kmpc_is_spmd_exec_mode`. In current device runtime, we have mixed use of
`isSPMDMode` and `__kmpc_is_spmd_exec_mode`, but in fact in `__kmpc_is_spmd_exec_mode`
it simply calls `isSPMDMode`. Since all functions starting with `__kmpc` is C
function, which doesn't have things like name mangling. It is more optimization
friendly. In this patch, we simply replaced all calls to `isSPMDMode` with
`__kmpc_is_spmd_exec_mode` to pave the way for the optimization.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D105211
Jon Roelofs [Wed, 30 Jun 2021 00:56:18 +0000 (17:56 -0700)]
[GISel] Support llvm.memcpy.inline
Differential revision: https://reviews.llvm.org/D105072
Suraj Sudhir [Wed, 30 Jun 2021 19:22:38 +0000 (12:22 -0700)]
[mlir][tosa] Use 3D tensors in tosa.matmul
Signed-off-by: Suraj Sudhir <suraj.sudhir@arm.com>
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D105213
Florian Hahn [Wed, 30 Jun 2021 18:41:57 +0000 (19:41 +0100)]
[BasicAA] Use separate scale variable for GCD.
Use separate variable for adjusted scale used for GCD computations. This
fixes an issue where we incorrectly determined that all indices are
non-negative and returned noalias because of that.
Follow up to
91fa3565da16.
Florian Hahn [Wed, 30 Jun 2021 17:00:36 +0000 (18:00 +0100)]
[BasicAA] Add test for incorrectly inferring noalias due to scale sign.
This patch adds a test where we currently incorrectly determine noalias,
because the sign of Scale is adjusted after
91fa3565da16.
LLVM GN Syncbot [Wed, 30 Jun 2021 18:49:16 +0000 (18:49 +0000)]
[gn build] Port
381ded345bdd
Nico Weber [Wed, 30 Jun 2021 18:49:00 +0000 (14:49 -0400)]
[gn build] (manually) port
f617ab104451 (DoublerPlugin)
Philip Reames [Wed, 30 Jun 2021 18:47:30 +0000 (11:47 -0700)]
autogen two tests for ease of update
Stanislav Mekhanoshin [Mon, 28 Jun 2021 20:24:24 +0000 (13:24 -0700)]
[AMDGPU] Add S_MOV_B64_IMM_PSEUDO for wide constants
This is to allow 64 bit constant rematerialization. If a constant
is split into two separate moves initializing sub0 and sub1 like
now RA cannot rematerizalize a 64 bit register.
This gives 10-20% uplift in a set of huge apps heavily using double
precession math.
Fixes: SWDEV-292645
Differential Revision: https://reviews.llvm.org/D104874
Xun Li [Wed, 30 Jun 2021 18:38:14 +0000 (11:38 -0700)]
[Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened
Relevant discussion can be found at: https://lists.llvm.org/pipermail/llvm-dev/2021-January/148197.html
In the existing design, An SCC that contains a coroutine will go through the folloing passes:
Inliner -> CoroSplitPass (fake) -> FunctionSimplificationPipeline -> Inliner -> CoroSplitPass (real) -> FunctionSimplificationPipeline
The first CoroSplitPass doesn't do anything other than putting the SCC back to the queue so that the entire pipeline can repeat.
As you can see, we run Inliner twice on the SCC consecutively without doing any real split, which is unnecessary and likely unintended.
What we really wanted is this:
Inliner -> FunctionSimplificationPipeline -> CoroSplitPass -> FunctionSimplificationPipeline
(note that we don't really need to run Inliner again on the ramp function after split).
Hence the way we do it here is to move CoroSplitPass to the end of the CGSCC pipeline, make it once for real, insert the newly generated SCCs (the clones) back to the pipeline so that they can be optimized, and also add a function simplification pipeline after CoroSplit to optimize the post-split ramp function.
This approach also conforms to how the new pass manager works instead of relying on an adhoc post split cleanup, making it ready for full switch to new pass manager eventually.
By looking at some of the changes to the tests, we can already observe that this changes allows for more optimizations applied to coroutines.
Reviewed By: aeubanks, ChuanqiXu
Differential Revision: https://reviews.llvm.org/D95807
Ahmed Taei [Tue, 22 Jun 2021 19:50:10 +0000 (12:50 -0700)]
Add linalg.batch_matvec named op
Similarly to batch_mat vec outer most dim is a batching dim
and this op does |b| matrix-vector-products :
C[b, i] = sum_k(A[b, i, k] * B[b, k])
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D104739
Fangrui Song [Wed, 30 Jun 2021 18:35:50 +0000 (11:35 -0700)]
[ELF] Preserve section order within an INSERT AFTER command
For
```
SECTIONS {
text.0 : {}
text.1 : {}
text.2 : {}
} INSERT AFTER .data;
```
the current order is `.data text.2 text.1 text.0`. It makes more sense to
preserve the specified order and thus improve compatibility with GNU ld.
For
```
SECTIONS { text.0 : {} } INSERT AFTER .data;
SECTIONS { text.3 : {} } INSERT AFTER .data;
```
GNU ld somehow collects sections with `INSERT AFTER .data` together (IMO
inconsistent) but I think it makes more sense to execute the commands in order
and get `.data text.3 text.0` instead.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D105158
Leonard Chan [Wed, 30 Jun 2021 18:20:49 +0000 (11:20 -0700)]
[clang][Fuchsia] Remove relative-vtables multilibs
As of D102374, relative vtables is enabled on Fuchsia by default, so we don't need any of the RV multilibs.
Differential revision: https://reviews.llvm.org/D105145
David Green [Wed, 30 Jun 2021 18:19:03 +0000 (19:19 +0100)]
[ARM] Set the immediate cost of GEP operands to 0
This prevents constant gep operands from being hoisted by the Constant
Hoisting pass, leaving them to CodegenPrepare which can usually do a
better job at splitting large offsets. This can, in general, improve
performance and decrease codesize, especially for v6m where many
constants have a high cost.
Differential Revision: https://reviews.llvm.org/D104877
Michael Liao [Wed, 30 Jun 2021 18:03:14 +0000 (14:03 -0400)]
Fix shared build.
zhijian [Wed, 30 Jun 2021 17:56:37 +0000 (13:56 -0400)]
[AIX][XCOFF][BUG-Fixed] need to switch back to text section after emit a dumy eh structure
Summary:
in the patch https://reviews.llvm.org/D103651 [AIX][XCOFF] generate eh_info when vector registers are saved according to the traceback table.
when generate eh_info, it switch to other section, when it done, it need to switch back to text section again.
Reviewers: Jason Liu
Differential Revision: https://reviews.llvm.org/105195
Simon Pilgrim [Wed, 30 Jun 2021 15:22:53 +0000 (16:22 +0100)]
[X86] Canonicalize SGT/UGT compares with constants to use SGE/UGE to reduce the number of EFLAGs reads. (PR48760)
This demonstrates a possible fix for PR48760 - for compares with constants, canonicalize the SGT/UGT condition code to use SGE/UGE which should reduce the number of EFLAGs bits we need to read.
As discussed on PR48760, some EFLAG bits are treated independently which can require additional uops to merge together for certain CMOVcc/SETcc/etc. modes.
I've limited this to cases where the constant increment doesn't result in a larger encoding or additional i64 constant materializations.
Differential Revision: https://reviews.llvm.org/D101074
Sanjay Patel [Wed, 30 Jun 2021 17:32:53 +0000 (13:32 -0400)]
[InstCombine] fold icmp of offset value with constant
There must be a better way to describe this pattern in words?
(X + C2) >u C --> X <s -C2 (if C == C2 + SMAX)
This could be extended to handle the more general (non-constant)
pattern too:
https://alive2.llvm.org/ce/z/rdfNFP
define i1 @src(i8 %a, i8 %c1) {
%t = add i8 %a, %c1
%c2 = add i8 %c1, 127 ; SMAX
%ov = icmp ugt i8 %t, %c2
ret i1 %ov
}
define i1 @tgt(i8 %a, i8 %c1) {
%neg_c1 = sub i8 0, %c1
%ov = icmp slt i8 %a, %neg_c1
ret i1 %ov
}
The pattern was noticed as a by-product of D104932.
Sanjay Patel [Wed, 30 Jun 2021 17:00:08 +0000 (13:00 -0400)]
[InstCombine][test] add tests for icmp with constant and offset; NFC
Siva Chandra Reddy [Mon, 28 Jun 2021 07:25:21 +0000 (07:25 +0000)]
[libc] Allow reading and writing __FE_DENORM if available on x86_64.
Some libcs define __FE_DENORM on x86_64. This change allows reading the
bits corresponding to that non-standard exception.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D105004
Siva Chandra Reddy [Tue, 29 Jun 2021 06:37:56 +0000 (06:37 +0000)]
[libc] Clear all exceptions before setting in fesetexceptflag.
Previously, exceptions from the flag were being added. This patch
changes it such that only the exceptions in the flag will be set.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D105085
Philip Reames [Wed, 30 Jun 2021 17:25:41 +0000 (10:25 -0700)]
[instcombine] Precommit tests for umin(a,b) ne/eq 0 fold
Siva Chandra Reddy [Mon, 28 Jun 2021 23:52:01 +0000 (23:52 +0000)]
[libc] Fix feclearexcept for x86_64.
Previously, feclearexcept cleared all exceptions irrespective of the
argument. This change brings it in line with the aarch64 flavors wherein
only those exceptions listed in the argument will be cleared.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D105081
Philip Reames [Wed, 30 Jun 2021 17:18:38 +0000 (10:18 -0700)]
[instcombine] umin(x, 1) == zext(x != 0)
We already implemented this for the select form, but the intrinsic form was missing. Note that this doesn't change poison behavior as 1 is non-poison, and the optimized form is still poison exactly when x is.
Tomas Matheson [Fri, 25 Jun 2021 13:37:02 +0000 (14:37 +0100)]
[NPM] Resolve llvmGetPassPluginInfo to the plugin being loaded
Dynamically loaded plugins for the new pass manager are initialised by
calling llvmGetPassPluginInfo. This is defined as a weak symbol so that
it is continually redefined by each plugin that is loaded. When loading
a plugin from a shared library, the intention is that
llvmGetPassPluginInfo will be resolved to the definition in the most
recent plugin. However, using a global search for this resolution can
fail in situations where multiple plugins are loaded.
Currently:
* If a plugin does not define llvmGetPassPluginInfo, then it will be
silently resolved to the previous plugin's definition.
* If loading the same plugin twice with another in between, e.g. plugin
A/plugin B/plugin A, then the second load of plugin A will resolve to
llvmGetPassPluginInfo in plugin B.
* The previous case can also occur when a dynamic library defines both
NPM and legacy plugins; the legacy plugins are loaded first and then
with `-fplugin=A -fpass-plugin=B -fpass-plugin=A`: A will be loaded as
a legacy plugin and define llvmGetPassPluginInfo; B will be loaded
and redefine it; and finally when A is loaded as an NPM plugin it will
be resolved to the definition from B.
Instead of searching globally, restrict the symbol lookup to the library
that is currently being loaded.
Differential Revision: https://reviews.llvm.org/D104916
Yaxun (Sam) Liu [Sat, 21 Mar 2020 21:06:39 +0000 (17:06 -0400)]
[AMDGPU] Add builtin functions image_bvh_intersect_ray
Reviewed by: Stanislav Mekhanoshin, Matt Arsenault
Differential Revision: https://reviews.llvm.org/D104946
Nico Weber [Wed, 30 Jun 2021 16:58:59 +0000 (12:58 -0400)]
[gn build] add dep needed after
b56e5f8a10c1e
Nico Weber [Wed, 30 Jun 2021 16:52:01 +0000 (12:52 -0400)]
[clangd] Unbreak mac build after
0c96a92d8666b8
That commit removed the include of Features.inc from ClangdLSPServer.h,
but ClangdMain.cpp relied on this include to pull in Features.inc for
the #if at the bottom of Transport.h.
Since the include is needed in Transport.h, just add it to there
directly.
Fangrui Song [Wed, 30 Jun 2021 16:43:28 +0000 (09:43 -0700)]
[ELF] -pie: produce dynamic relocations for absolute relocations referencing undef weak
See the comment for my understanding of -no-pie and -shared expectation.
-no-pie has freedom on choices. We choose dynamic relocations to be consistent
with the handling of GOT-generating relocations.
Note: GNU ld has arch-varying behaviors and its x86 -pie has a very
complex rule:
if there is at least one GOT-generating or PLT-generating relocation and
-z dynamic-undefined-weak (enabled by default) is in effect, generate a
dynamic relocation.
We don't emulate its rule.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D105164
David Goldman [Fri, 11 Jun 2021 14:16:19 +0000 (10:16 -0400)]
[clangd] Fix highlighting for implicit ObjC property refs
Objective-C lets you use the `self.prop` syntax as sugar for both
`[self prop]` and `[self setProp:]`, but clangd previously did not
provide a semantic token for `prop`.
Now, we provide a semantic token, treating it like a normal property
except it's backed by a `ObjCMethodDecl` instead of a
`ObjCPropertyDecl`.
Differential Revision: https://reviews.llvm.org/D104117
Caroline Tice [Tue, 29 Jun 2021 21:50:10 +0000 (14:50 -0700)]
[lldb] Replace SVE_PT* macros in NativeRegisterContextLinux_arm64.{cpp,h} with their equivalent defintions in LinuxPTraceDefines_arm64sve.h
Commit
090306fc80dbf (August 2020) changed most of the arm64 SVE_PT*
macros, but apparently did not make the changes in the
NativeRegisterContextLinux_arm64.* files (or those files were pulled
over from someplace else after that commit). This change replaces the
macros NativeRegisterContextLinux_arm64.cpp with the replacement
definitions in LinuxPTraceDefines_arm64sve.h. It also includes
LinuxPTraceDefines_arm64sve.h in NativeRegisterContextLinux_arm64.h.
Differential Revision: https://reviews.llvm.org/D104826
thomasraoux [Wed, 30 Jun 2021 07:00:11 +0000 (00:00 -0700)]
[mlir] Fix wrong type in WmmaConstantOpToNVVMLowering
InsertElement takes a scalar integer attribute not an array of integer.
Differential Revision: https://reviews.llvm.org/D105174
thomasraoux [Wed, 30 Jun 2021 07:02:47 +0000 (00:02 -0700)]
[mlir][VectorToGPU] Support converting vetor.broadcast to MMA op
Differential Revision: https://reviews.llvm.org/D105175
LLVM GN Syncbot [Wed, 30 Jun 2021 15:57:43 +0000 (15:57 +0000)]
[gn build] Port
0c96a92d8666
Jeremy Morse [Tue, 29 Jun 2021 17:50:24 +0000 (18:50 +0100)]
[LiveDebugValues][InstrRef][1/2] Recover more clobbered variable locations
In various circumstances, when we clobber a register there may be
alternative locations that the value is live in. The classic example would
be a value loaded from the stack, and then clobbered: the value is still
available on the stack. InstrRefBasedLDV was coping with this at block
starts where it's forced to pick a location, however it wasn't searching
for alternative locations when values were clobbered.
This patch notifies the "Transfer Tracker" object when clobbers occur, and
it's able to find alternatives and issue DBG_VALUEs for that location. See:
the added test.
Differential Revision: https://reviews.llvm.org/D88405
Joseph Huber [Wed, 30 Jun 2021 14:55:14 +0000 (10:55 -0400)]
[OpenMP] Change analysis remarks to not emit on cold functions
The remarks will trigger on some functions that are marked cold, such as the
`__muldc3` intrinsic functions. Change the remarks to avoid these functions.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D105196
Sam McCall [Thu, 11 Mar 2021 00:20:36 +0000 (01:20 +0100)]
[clangd] Show padding following a field on field hover.
This displays as: `Size: 4 bytes (+4 padding)`
Also stop showing (byte) offset/size for bitfields. They're not
meaningful and using them to calculate padding is dangerous!
Differential Revision: https://reviews.llvm.org/D98377
Sam McCall [Thu, 15 Apr 2021 12:29:57 +0000 (14:29 +0200)]
[clangd] Log feature configuration (linux+asan+grpc) of the clangd build
Included in logs, --version, remote index queries, and LSP serverInfo.
Differential Revision: https://reviews.llvm.org/D100553
Sam McCall [Wed, 16 Jun 2021 13:24:23 +0000 (15:24 +0200)]
[clangd] Correct SelectionTree behavior around anonymous field access.
struct A { struct { int b; }; };
A().^b;
This should be considered a reference to b, but currently it's
considered a reference to the anonymous struct field.
Fixes https://github.com/clangd/clangd/issues/798
Differential Revision: https://reviews.llvm.org/D104376
Philip Reames [Wed, 30 Jun 2021 15:31:13 +0000 (08:31 -0700)]
[SCEV] Fold (0 udiv %x) to 0
We have analogous rules in instsimplify, etc.., but were missing the same in SCEV. The fold is near trivial, but came up in the context of a larger change.
Philip Reames [Wed, 30 Jun 2021 15:26:18 +0000 (08:26 -0700)]
[test] precommit a test for missing (0 /u %x) SCEV fold
Louis Dionne [Wed, 30 Jun 2021 15:11:52 +0000 (11:11 -0400)]
[libc++] Remove broken links and outdated information in the docs
The various design docs have been moved to RST, and the linked blog post
does not apply anymore since libc++ is the default library used by Clang
on Apple platforms.
Craig Topper [Tue, 29 Jun 2021 23:21:26 +0000 (16:21 -0700)]
[ARM] Fix incorrect assignment of Changed variable in MVEGatherScatterLowering::optimiseOffsets.
I believe this Changed flag should be initialized to false,
otherwise the if (!Changed) is always dead. This doesn't
manifest in a functional issue because the PHINode checks will
fail if nothing changed. They are identical to the earlier
checks that must have already failed to get into this else block.
While there remove an else after return to reduce indentation.
Differential Revision: https://reviews.llvm.org/D105159
Louis Dionne [Fri, 18 Jun 2021 17:33:14 +0000 (13:33 -0400)]
[lit] Add the ability to parse regexes in Lit boolean expressions
This patch augments Lit with the ability to parse regular expressions
in boolean expressions. This includes REQUIRES:, XFAIL:, UNSUPPORTED:,
and all other special Lit markup that evaluates to a boolean expression.
Regular expressions can be specified by enclosing them in {{...}},
similarly to how FileCheck handles such regular expressions. The regular
expression can either be on its own, or it can be part of an identifier.
For example, a match expression like {{.+}}-apple-darwin{{.+}} would match
the following variables:
x86_64-apple-darwin20.0
arm64-apple-darwin20.0
arm64-apple-darwin22.0
etc...
In the long term, this could be used to remove the need to handle the
target triple specially when parsing boolean expressions.
Differential Revision: https://reviews.llvm.org/D104572
Florian Mayer [Wed, 30 Jun 2021 13:48:57 +0000 (14:48 +0100)]
[hwasan] Add missing newline in report.
Reviewed By: glider
Differential Revision: https://reviews.llvm.org/D105190
Simon Pilgrim [Wed, 30 Jun 2021 14:01:51 +0000 (15:01 +0100)]
[CostModel][X86] Adjust fp<->int vXi32 AVX1+ costs based on llvm-mca reports
Based off the worse case numbers generated by D103695, the AVX1/2/512 sitofp/uitofp/fptosi/fptoui costs were higher than necessary (based off instruction counts instead of actual throughput).
The SSE costs still need further fixes, but I hit an issue with the order in which SSE costs are checked - we need to check CUSTOM costs (with non-legal types) first, and then fallback to LEGALIZED types. I'm looking at this now, and this should let us start thinning out a lot of the duplicates in the costs tables.
Then we can finally start work on vXi64 / vXi16 / vXi8 / vXi1 integers, which should let us look at sub-128-bit vectorization (D103925).
Nico Weber [Wed, 30 Jun 2021 14:21:33 +0000 (10:21 -0400)]
Revert "[Coroutine] Add statistics for the number of elided coroutine"
This reverts commit
1d9539cf49a585e7c3cd8faa1b8e7291e0ce285c.
Test fails in LLVM_ENABLE_ASSERTIONS=OFF builds (such as regular
release builds).
William S. Moses [Wed, 30 Jun 2021 14:09:42 +0000 (10:09 -0400)]
[MLIR] Update description of SCF.execute_region op
See https://reviews.llvm.org/D104865
William S. Moses [Fri, 25 Jun 2021 23:40:35 +0000 (19:40 -0400)]
[MLIR][SCF] Inline ExecuteRegion if parent can contain multiple blocks
The executeregionop is used to allow multiple blocks within SCF constructs. If the container allows multiple blocks, inline the region
Differential Revision: https://reviews.llvm.org/D104960
Melanie Blower [Mon, 28 Jun 2021 16:45:56 +0000 (12:45 -0400)]
[clang][patch] Add builtin __arithmetic_fence and option fprotect-parens
This patch adds a new clang builtin, __arithmetic_fence. The purpose of the
builtin is to provide the user fine control, at the expression level, over
floating point optimization when -ffast-math (-ffp-model=fast) is enabled.
The builtin prevents the optimizer from rearranging floating point expression
evaluation. The new option fprotect-parens has the same effect on
parenthesized expressions, forcing the optimizer to respect the parentheses.
Reviewed By: aaron.ballman, kpn
Differential Revision: https://reviews.llvm.org/D100118
Joseph Huber [Tue, 29 Jun 2021 21:05:31 +0000 (17:05 -0400)]
[OpenMP] Add additional remarks for OpenMPOpt
This patch adds additional remarks, suggesting the use of `noescape` for failed
globalization and indicating when internalization failed.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D105150
William S. Moses [Thu, 10 Jun 2021 19:12:04 +0000 (15:12 -0400)]
[MLIR] Eliminate unnecessary affine stores
Deduce circumstances where an affine load could not possibly be read by an operation (such as an affine load), and if so, eliminate the load
Differential Revision: https://reviews.llvm.org/D105041
Florian Hahn [Wed, 30 Jun 2021 12:28:09 +0000 (13:28 +0100)]
[Matrix] Add tests for hoisting address computations.
Peter Smith [Fri, 25 Jun 2021 10:39:47 +0000 (11:39 +0100)]
[LLD][ELF][ARM] Tidy up test to hook up missing filecheck patterns [NFC]
A couple of filecheck patterns had not been hooked up with
the patterns suffering from some drift. As this test is old
and llvm-objdump has improved a lot, take this opportunity to
hide the instruction encoding. I've also taken out a lot of
the explanatory comments that llvm-objdump improvements make
redundant, as these comments oftern don't get updated when addresses
change.
Differential Revision: https://reviews.llvm.org/D104907
alex-t [Wed, 30 Jun 2021 12:48:02 +0000 (15:48 +0300)]
[AMDGPU] PHI node cost should not be counted for the size and latency.
Details: https://reviews.llvm.org/D96805 changed the GCNTTIImpl::getCFInstrCost to return 1 for the PHI nodes
for the TTI::TCK_CodeSize and TTI::TCK_SizeAndLatency. This is incorrect because the value moves that are the
result of the PHI lowering are inserted into the basic block predecessors - not into the block itself.
As a result of this change LoopRotate and LoopUnroll were broken because of the incorrect Loop header and loop
body size/cost estimation.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D105104
Peter Smith [Fri, 25 Jun 2021 09:52:15 +0000 (10:52 +0100)]
[LLD][ELF][ARM] Fix case of patched unrelocated BLX
There are a couple of problems with the code to patch
unrelocated BLX instructions:
1. The calculation of the PC needs to take into account
the alignment of the instruction. The Thumb BLX
uses alignDown(PC, 4) for the source address.
2. The calculation of the PC bias is hard-coded to 4
which works for Thumb, but when there is a BLX the
branch will be in Arm state so it needs an 8 byte
PC bias.
No asssembler generates an unrelocated BLX instruction
so these problems do not affect real world programs.
However we should still fix them.
Differential Revision: https://reviews.llvm.org/D104905
Bradley Smith [Mon, 28 Jun 2021 12:39:07 +0000 (13:39 +0100)]
[TargetLowering][AArch64][SVE] Take into account accessed type when clamping address
When clamping the index for a memory access to a stacked vector we must
take into account the entire type being accessed, not just assume that
we are accessing only a single element.
Differential Revision: https://reviews.llvm.org/D105016
Tobias Gysi [Wed, 30 Jun 2021 12:26:33 +0000 (12:26 +0000)]
[mlir][linalg][python] Update the OpDSL doc (NFC).
Update the OpDSL documentation to reflect recent changes. In particular, the updated documentation discusses:
- Attributes used to parameterize index expressions
- Shape-only tensor support
- Scalar parameters
Differential Revision: https://reviews.llvm.org/D105123
Saiyedul Islam [Wed, 9 Jun 2021 13:19:45 +0000 (18:49 +0530)]
[clang-offload-bundler] Add unbundling of archives containing bundled object files into device specific archives
This patch adds unbundling support of an archive file. It takes an
archive file along with a set of offload targets as input.
Output is a device specific archive for each given offload target.
Input archive contains bundled code objects bundled using
clang-offload-bundler. Each generated device specific archive contains
a set of device code object files which are named as
<Parent Bundle Name>-<CodeObject-GPUArch>.
Entries in input archive can be of any binary type which is
supported by clang-offload-bundler, like *.bc. Output archives will
contain files in same type.
Example Usuage:
clang-offload-bundler --unbundle --inputs=lib-generic.a -type=a
-targets=openmp-amdgcn-amdhsa--gfx906,openmp-amdgcn-amdhsa--gfx908
-outputs=devicelib-gfx906.a,deviceLib-gfx908.a
Reviewed By: jdoerfert, yaxunl
Differential Revision: https://reviews.llvm.org/D93525
Simon Pilgrim [Wed, 30 Jun 2021 10:36:06 +0000 (11:36 +0100)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning.
Alexey Bataev [Tue, 29 Jun 2021 19:26:37 +0000 (12:26 -0700)]
[OPENMP]Fix PR50929: Ignored initializer clause in user-defined reduction.
No need to try to create the default constructor for private copy, it
will be called automatically in the initializer of the declare
reduction. Fixes balance between constructors/destructors calls.
Differential Revision: https://reviews.llvm.org/D105143
Zhouyi Zhou [Wed, 30 Jun 2021 11:46:35 +0000 (19:46 +0800)]
[clang] NFC: add line break at the end of if expressions
Hi,
In function TransformTemplateArgument,
would it be better to add line break at the end of "if" expressions?
I use clang-format to do the job for me.
Thanks a lot
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D104604
madhur13490 [Fri, 18 Jun 2021 08:14:54 +0000 (13:44 +0530)]
[AMDGPU] Simplify getReservedNumSGPRs
This is a followup patch on D103636 where
it seemed checking on amdgpu-calls and
amdgpu-stack-objects is unnecessary. Removing these
checks didn't regress any tests functionally.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D104513
Florian Hahn [Wed, 30 Jun 2021 08:45:50 +0000 (09:45 +0100)]
[ConstantRanges] Use APInt for constant case for urem/srem.
Currently UREM & SREM on constant ranges produces overly pessimistic
results for single element constant ranges.
Delegate to APInt's implementation if both operands are single element
constant ranges. We already do something similar for other binary
operators, like binary AND.
Fixes PR49731.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D105115
Florian Mayer [Mon, 28 Jun 2021 13:19:43 +0000 (14:19 +0100)]
[hwasan] Make sure we retag with a new tag on free.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D105021
David Sherwood [Tue, 29 Jun 2021 15:12:17 +0000 (16:12 +0100)]
[NFC] Rename shadowed variable in InnerLoopVectorizer::createInductionVariable
Avoid creating a IRBuilder stack variable with the same name as the
class member.
Florian Mayer [Tue, 29 Jun 2021 19:11:41 +0000 (20:11 +0100)]
[MTE] Remove redundant helper function.
Looking at PostDominatorTree::dominates, we can see that has the same
logic (with the addition of handling Phi nodes - which are not used as inputs in
this pass) as the helper function.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D105141
Jay Foad [Fri, 25 Jun 2021 16:08:36 +0000 (17:08 +0100)]
[TableGen] Allow identical MnemonicAliases with no predicate
My use case for this is illustrated in the test case: I want to define
the same instruction twice with different (disjoint) predicates, because
the instruction has different operands on different subtargets. It's
convenient to do this with a multiclass that also defines an alias for
the instruction.
Previously tablegen would complain if this alias was defined twice with
no predicate. One way to fix this would be to add a predicate on each
definition of the alias, matching the predicate on the instruction. But
this (a) is slightly awkward to do in the real world use case I had, and
(b) leads to an inefficient matcher that will do something like this:
if (Mnemonic == "foo_alias") {
if (Features.test(Feature_Subtarget1Bit))
Mnemonic == "foo";
else if (Features.test(Feature_Subtarget2Bit))
Mnemonic == "foo";
return;
}
It would be more efficient to skip the feature tests and return "foo"
unconditionally.
Overall it seems better to allow multiple definitions of the identical
alias with no predicate.
Differential Revision: https://reviews.llvm.org/D105033
Valeriy Savchenko [Wed, 30 Jun 2021 09:49:31 +0000 (12:49 +0300)]
[analyzer][satest][NFC] Relax dependencies requirements
Igor Kudrin [Wed, 30 Jun 2021 09:34:52 +0000 (16:34 +0700)]
[ARMInstPrinter] Print the target address of a branch instruction
This follows other patches that changed printing immediate values of
branch instructions to target addresses, see D76580 (x86), D76591 (PPC),
D77853 (AArch64).
As observing immediate values might sometimes be useful, they are
printed as comments for branch instructions.
// llvm-objdump -d output (before)
000200b4 <_start>:
200b4: ff ff ff fa blx #-4 <thumb>
000200b8 <thumb>:
200b8: ff f7 fc ef blx #-8 <_start>
// llvm-objdump -d output (after)
000200b4 <_start>:
200b4: ff ff ff fa blx 0x200b8 <thumb> @ imm = #-4
000200b8 <thumb>:
200b8: ff f7 fc ef blx 0x200b4 <_start> @ imm = #-8
// GNU objdump -d.
000200b4 <_start>:
200b4:
faffffff blx 200b8 <thumb>
000200b8 <thumb>:
200b8: f7ff effc blx 200b4 <_start>
Differential Revision: https://reviews.llvm.org/D104701
Tobias Gysi [Wed, 30 Jun 2021 08:59:22 +0000 (08:59 +0000)]
[mlir][linalg][python] Explicit shape and dimension order in OpDSL.
Extend the OpDSL syntax with an optional `domain` function to specify an explicit dimension order. The extension is needed to provide more control over the dimension order instead of deducing it implicitly depending on the formulation of the tensor comprehension. Additionally, the patch also ensures the symbols are ordered according to the operand definitions of the operation.
Differential Revision: https://reviews.llvm.org/D105117
Igor Kudrin [Wed, 30 Jun 2021 08:54:53 +0000 (15:54 +0700)]
[ARM][NFC] Remove an unused method
`ARMInstPrinter::printMveAddrModeQOperand()` was added in D62680, but
was never used. It looks like `printT2AddrModeImm8Operand<false>()` is
used instead.
Differential Revision: https://reviews.llvm.org/D105124
Stephan Herhut [Tue, 29 Jun 2021 14:47:58 +0000 (16:47 +0200)]
[mlir][llvm] Add a test for memref.copy lowering to llvm
This was missing and also there was a bug in the lowering itself, which went unnoticed due to it.
Differential Revision: https://reviews.llvm.org/D105122