Ahmed Taei [Tue, 31 Mar 2020 00:36:05 +0000 (17:36 -0700)]
Fix linalg.generic access of hoisted constants
Summary: Otherwise the added @generic_const_int will fail
Reviewers: nicolasvasilache, rriddle, mravishankar
Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77109
QingShan Zhang [Tue, 31 Mar 2020 02:47:14 +0000 (02:47 +0000)]
[PowerPC] Don't do the folding if the operand is R0/X0
We have this transformation in PowerPC peephole:
Replace instruction:
renamable $x28 = ADDI8 renamable $x7, -8
renamable $x28 = ADD8 killed renamable $x28, renamable $x0
STFD killed renamable $f0, -8, killed renamable $x28 :: (store 8 into %ir._ind_cast99.epil)
with:
renamable $x28 = ADDI8 renamable $x7, -16
STFDX killed renamable $f0, $x0, killed $x28 :: (store 8 into %ir._ind_cast99.epil)
It is invalid as the '$x0' in STFDX is constant 0, not register r0.
Reviewed By: Nemanjai
Differential Revision: https://reviews.llvm.org/D77034
Nico Weber [Tue, 31 Mar 2020 02:15:26 +0000 (22:15 -0400)]
[gn build] re-run "gn format" on all .gn and .gni files
Nico Weber [Tue, 31 Mar 2020 02:07:23 +0000 (22:07 -0400)]
[gn build] minor tweaks to sync script
- only complain about duplicate 'sources' lines if they contain
more than 1 elements each (before, 0 and 1 element lists were
counted too). In practice, this only has an effect for
clang/lib/Headers/BUILD.gn
- make the '# NOSORT' diag actually work. This too only affects
clang/lib/Headers/BUILD.gn.
In aggregate, changes to clang/lib/Headers/BUILD.gn still can't
be auto-merged, but for a slighly better reason.
Nico Weber [Tue, 31 Mar 2020 02:06:36 +0000 (22:06 -0400)]
[gn build] (manually) ort
5074776de47
Jessica Paquette [Mon, 30 Mar 2020 22:19:29 +0000 (15:19 -0700)]
[GlobalISel] Implement identity transforms for x op x -> x
When we have
```
a = G_OR x, x
```
or
```
b = G_AND y, y
```
We can drop the G_OR/G_AND and just use x/y respectively.
Also update arm64-fallback.ll because there was an or in there which hits this
transformation.
Differential Revision: https://reviews.llvm.org/D77105
Juneyoung Lee [Sat, 28 Mar 2020 08:38:27 +0000 (17:38 +0900)]
[LegalizeTypes] Add SoftenFloatRes_FREEZE
Summary: This adds SoftenFloatRes_FREEZE.
Reviewers: bkramer, JamesNagurne, craig.topper, efriedma
Reviewed By: craig.topper
Subscribers: AbigailLinden, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76980
Yaxun (Sam) Liu [Sat, 28 Mar 2020 13:03:13 +0000 (09:03 -0400)]
Rename options --cuda-gpu-arch and --no-cuda-gpu-arch
Per discussion
http://lists.llvm.org/pipermail/llvm-dev/2017-February/109930.html
Rename -cuda-gpu-arch and --no-cuda-gpu-arch to
--offload-arch and --no-offload-arch.
The original options will be alias to the new options.
Differential Revision: https://reviews.llvm.org/D76987
Richard Smith [Tue, 31 Mar 2020 00:19:30 +0000 (17:19 -0700)]
Fix crash if base specifier parsing hits an invalid type annotation.
Also change type annotation representation from ParsedType to TypeResult
to make it clearer to consumers that they can represent invalid types.
Thomas Lively [Fri, 27 Mar 2020 23:34:27 +0000 (16:34 -0700)]
[WebAssembly] Import wasm_simd128.h from Emscripten
Summary:
As the WebAssembly SIMD proposal nears stabilization, there is desire
to use it with toolchains other than Emscripten. Moving the intrinsics
header to clang will make it available to WASI toolchains as well.
Reviewers: aheejin, sunfish
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76959
Jessica Paquette [Mon, 23 Mar 2020 20:14:10 +0000 (13:14 -0700)]
[GlobalISel] Combine (x op 0) -> x for operations with a right identity of 0
Implement identity combines for operations like the following:
```
%a = G_SUB %b, 0
```
This can just be replaced with %b.
Over CTMark, this gives some minor size improvements at -O3.
Differential Revision: https://reviews.llvm.org/D76640
Eli Friedman [Mon, 30 Mar 2020 23:44:41 +0000 (16:44 -0700)]
[SVE][SelectionDAG] Fix dumping of EVTs to use correct API for element count.
This makes "-debug" output for SVE SelectionDAG readable.
Matt Arsenault [Mon, 17 Feb 2020 19:40:44 +0000 (14:40 -0500)]
Revert "[GISel]: Fix incorrect IRTranslation while translating null pointer types"
This reverts commit
b3297ef05179e1fee616b97b1c65b58e4c7fef17.
This change is incorrect. The current semantic of null in the IR is a
pointer with the bitvalue 0. It is not a cast from an integer 0, so
this should preserve the pointer type.
Nick Desaulniers [Mon, 30 Mar 2020 22:32:02 +0000 (15:32 -0700)]
[SelectionDAGISel] small cleanup to INLINEASM_BR selection. NFC
Summary:
This code was throwing away the opcode for a boolean, which was then
reconstructing the opcode from that boolean. Just pass the opcode, and
forget the boolean.
Reviewers: srhines
Reviewed By: srhines
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77100
Fangrui Song [Mon, 30 Mar 2020 21:37:46 +0000 (14:37 -0700)]
[ELF][test] Add linkerscript/linkorder-linked-to.s
Delete relocatable-linkorder.s which is covered.
Jonas Devlieghere [Mon, 30 Mar 2020 22:09:03 +0000 (15:09 -0700)]
[lldb/Reproducers] Always collect the whole dSYM in the reproducer
The FileCollector in LLDB collects every files that's used during a
debug session when capture is enabled. This ensures that the reproducer
only contains the files necessary to reproduce. This approach is not a
good fit for the dSYM bundle, which is a directory on disk, but should
be treated as a single unit.
On macOS LLDB have automatically find the matching dSYM for a binary by
its UUID. Having a incomplete dSYM in a reproducer can break debugging
even when reproducers are disabled.
This patch adds a was to specify a directory of interest to the
reproducers. It is called from SymbolVendorMacOSX with the path of the
dSYMs used by LLDB.
Differential revision: https://reviews.llvm.org/D76672
Matt Arsenault [Thu, 6 Feb 2020 13:34:18 +0000 (08:34 -0500)]
AMDGPU/GlobalISel: Fix crashing on weird G_INSERT sources
No test since these cases shouldn't really be getting through the
legalizer.
Louis Dionne [Mon, 30 Mar 2020 22:00:47 +0000 (18:00 -0400)]
Recommit "[libc++] NFC: Simplify substitutions by using lit recursive substitutions"
This re-commits
cd7f9751c300, which was reverted in
12f6b024f9f5 because
it broke the LLVM `check-all` target. This commit addresses the underlying
issue by not setting the lit_config.recursiveExpansionLimit parameter of
the libc++ test suite, which is otherwise picked up by other test suites
in LLVM.
Once we've settled on a fix for the underlying issue with
lit_config.recursiveExpansionLimit, we can start using it
again in libc++, but for now we can just work around it.
Daan Sprenkels [Mon, 30 Mar 2020 21:58:54 +0000 (23:58 +0200)]
Recommit "[InstCombine] Update assertions in InstCombine test; NFC"
Matt Arsenault [Sun, 29 Mar 2020 14:26:16 +0000 (10:26 -0400)]
AMDGPU: Form v_cvt_ubyte* with f16 results
We get 2 conversion instructions anyway. Previously we would get a
conversion with SDWA reading from a byte source, which has a larger
encoding.
Louis Dionne [Thu, 12 Mar 2020 22:01:20 +0000 (18:01 -0400)]
Enforce that libc++ and libc++abi are built in a monorepo layout
We will soon start removing technical debt and sharing code between the
two directories, so this first step is meant to discover potential places
where the libraries are built outside of a monorepo layout. I imagine
this could happen as a remnant of the pre-monorepo setup.
This was discussed on the libcxx-dev mailing list and we got overall
consensus on the direction. All consumers of libc++ and libc++abi
should already be doing so through the monorepo, however it is
possible that we catch some stragglers with this patch, in which
case it may need to be reverted temporarily.
Differential Revision: https://reviews.llvm.org/D76102
Matt Arsenault [Wed, 25 Mar 2020 14:45:07 +0000 (10:45 -0400)]
AMDGPU/GlobalISel: Form CVT_F32_UBYTE0
Matt Arsenault [Sun, 9 Feb 2020 00:08:34 +0000 (19:08 -0500)]
AMDGPU/GlobalISel: Handle image atomics
Matt Arsenault [Sat, 8 Feb 2020 04:37:54 +0000 (23:37 -0500)]
AMDGPU/GlobalISel: Start selecting image intrinsics
Does not handled atomics yet.
Matt Arsenault [Tue, 28 Jan 2020 16:28:51 +0000 (11:28 -0500)]
AMDGPU: Account for dmask when computing image mem size
Only the number of elements in the dmask will really be accessed.
Davide Italiano [Mon, 30 Mar 2020 21:15:56 +0000 (14:15 -0700)]
Recommit "[lldb] Make Fix-Its also apply to top-level expressions""
This reverts commit
fe5cb1c25fd6c07bbe3c0c698f36b74e6d04946f as it
was not responsible for breaking the bots. Sorry.
Davide Italiano [Mon, 30 Mar 2020 21:15:29 +0000 (14:15 -0700)]
Recommit "[lldb] Make TestExprDiagnostics.py pass again after enabling Fix-Its in test"
This reverts commit
55ed09d32e2602eba1dbb8aba1985246739c3909 as
it was not responsible for breaking the bots. Sorry.
Jay Foad [Mon, 30 Mar 2020 13:33:55 +0000 (14:33 +0100)]
AMDGPU: Implement getMemcpyLoopLoweringType
Summary: Based on a patch by Matt Arsenault.
Reviewers: rampitec, kerbowa, nhaehnle, arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77057
Francesco Petrogalli [Tue, 24 Mar 2020 22:38:12 +0000 (22:38 +0000)]
[llvm][IR][CastInst] Update `castIsValid` for scalable vectors.
Reviewers: sdesmalen
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76738
Davide Italiano [Mon, 30 Mar 2020 21:04:14 +0000 (14:04 -0700)]
Revert "[lldb][NFC] Refactor Fix-It filter for warnings"
This reverts commit
11a5caee2aeae2546213366e7fc54095bb8163b9 as
it broke the bots.
Alexey Bataev [Mon, 30 Mar 2020 20:28:59 +0000 (16:28 -0400)]
[OPENMP50]Do not imply lvalue as base expression in array shaping
expression.
We should not assume that the base expression in the array shaping
operation is an lvalue of some form, it may be an rvalue.
Matt Arsenault [Sat, 8 Feb 2020 21:53:04 +0000 (16:53 -0500)]
AMDGPU/GlobalISel: Round up image operations with 5, 6 or 7 addresses
The instruction definitions are missing for these register types, so
round up to 8 like the DAG.
Matt Arsenault [Sat, 8 Feb 2020 14:28:27 +0000 (09:28 -0500)]
AMDGPU/GlobalISel: Start handling _L to _LZ optimization
We currently don't have a way to map to the equivalent intrinsic
opcode, so track immediate 0s in place of the address for the
selection to know to change the final opcode.
Davide Italiano [Mon, 30 Mar 2020 20:58:18 +0000 (13:58 -0700)]
Revert "[lldb] Make TestExprDiagnostics.py pass again after enabling Fix-Its in test"
This reverts commit
502a06fcdafa637a9890da16c2734bc1a36010f6 as it
breaks the macOS bots. Raph will take a look and re-commit.
Davide Italiano [Mon, 30 Mar 2020 20:53:31 +0000 (13:53 -0700)]
[TypeSystemClang] Add missing case in a switch. NFC'ish.
Daan Sprenkels [Mon, 30 Mar 2020 20:41:33 +0000 (22:41 +0200)]
Revert "[InstCombine] Update assertions in InstCombine test; NFC"
This reverts commit
4243bd494d67b0a8048ee9719e27778a3743838a.
Davide Italiano [Mon, 30 Mar 2020 20:23:58 +0000 (13:23 -0700)]
Revert "[lldb] Make Fix-Its also apply to top-level expressions"
This reverts commit
83c81c0a469482888482983c302c09c02680ae7c as
it broke the macOS lldb bots.
Jonas Devlieghere [Mon, 30 Mar 2020 19:58:21 +0000 (12:58 -0700)]
Re-land "[FileCollector] Add a method to add a whole directory and it contents."
Extend the FileCollector's API with addDirectory which adds a directory
and its contents to the VFS mapping.
Differential revision: https://reviews.llvm.org/D76671
Daan Sprenkels [Mon, 30 Mar 2020 20:10:12 +0000 (22:10 +0200)]
[InstCombine] Update assertions in InstCombine test; NFC
Mehdi Amini [Mon, 30 Mar 2020 20:12:47 +0000 (20:12 +0000)]
Fix test: add `-allow-unregistered-dialect` to Affine/loop-permute.mlir test (missed during rebase)
Sanjay Patel [Mon, 30 Mar 2020 19:49:27 +0000 (15:49 -0400)]
[InstCombine] do not exclude min/max from icmp with casted operand fold
InstCombine has a mess of logic that tries to preserve min/max patterns,
but AFAICT, this one is not necessary because we can always narrow the
corresponding select in this sequence to match the narrow compare.
The biggest danger for this patch is inducing infinite looping or
assert from exceeding max iterations. If any bots hit that in the
vicinity of this commit, this is the likely patch to blame.
Sam Clegg [Fri, 14 Feb 2020 04:25:55 +0000 (20:25 -0800)]
[ADT] Allow empty string in StringSet
Also add a test case to wasm-ld that asserts without this change.
Internally wasm-ld builds a StringMap of exported functions and it seems
like allowing empty string in the set is preferable to adding checks.
This assert looks like it was most likely just a historical accident.
It started life here purely to support InputLanguagesSet:
eeac27e38c5c567d63bbfa5410620d955696491b
Then got extracted here:
e57a4033385c5976cbb17af1e962b1224a61183b
Then got moved to AST here
5c48bae209bcbd261886f63abac695b1e30544e6
With the `InLang` paramater name still intact which suggested is
InputLanguagesSet origins.
Differential Revision: https://reviews.llvm.org/D74589
Eli Friedman [Wed, 25 Mar 2020 19:28:47 +0000 (12:28 -0700)]
[llvm-cov] Improve error message for missing profdata
I got a report recently that a user was having trouble interpreting the
meaning of the error message. Hopefully this is more readable; produces
something like the following:
error: No such file or directory: Could not read profile data!
Differential Revision: https://reviews.llvm.org/D76796
Julian Lettner [Mon, 30 Mar 2020 19:40:52 +0000 (12:40 -0700)]
[lit] Use Python's support for None in array slice indexing
Mehdi Amini [Sun, 29 Mar 2020 22:35:38 +0000 (22:35 +0000)]
Add a flag on the context to protect against creation of operations in unregistered dialects
Differential Revision: https://reviews.llvm.org/D76903
Jonas Hahnfeld [Mon, 30 Mar 2020 19:36:18 +0000 (21:36 +0200)]
Fix comment for CLANG_SYSTEMZ_DEFAULT_ARCH
Also move up, next to the other *_DEFAULT_* configurations.
Matt Arsenault [Mon, 30 Mar 2020 19:02:13 +0000 (15:02 -0400)]
CodeGen: Add missing MachineOperand setter
River Riddle [Mon, 30 Mar 2020 19:25:00 +0000 (12:25 -0700)]
[mlir] Update all dialects docs to use 'dialect-namespace' in the header
Vince Bridgers [Sun, 29 Mar 2020 12:48:26 +0000 (07:48 -0500)]
[analyzer] Fix StdLibraryFunctionsChecker NotNull Constraint Check
Summary:
This check was causing a crash in a test case where the 0th argument was
uninitialized ('Assertion `T::isKind(*this)' at line SVals.h:104). This
was happening since the argument was actually undefined, but the castAs
assumes the value is DefinedOrUnknownSVal.
The fix appears to be simply to check for an undefined value and skip
the check allowing the uninitalized value checker to detect the error.
I included a test case that I verified to produce the negative case
prior to the fix, and passes with the fix.
Reviewers: martong, NoQ
Subscribers: xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, Charusso, ASDenysPetrov, baloghadamsoftware, dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77012
Siddhartha Bagaria [Mon, 30 Mar 2020 18:20:58 +0000 (14:20 -0400)]
Setup clang-format as an Arcanist linter
Summary:
This uses clang-format-diff as a linter for Arcanist.
`arc lint` flow, also run as part of `arc diff` unless skipped with
`--nolint`, will now run the linter shell script on the changed files,
and prompt the user to accept the suggested changes.
Message when clang-format-diff is not installed:
{
F6654094}
Example of the noise during code review when clang-format-diff is not installed:
https://reviews.llvm.org/differential/changeset/?ref=1115809
Prompt when clang-format-diff is installed and suggests edits:
{
F6650223}
Reviewers: probinson, scott.linder
Reviewed By: scott.linder
Subscribers: scott.linder, MyDeveloperDay, JonasToth, danilaml, JDevlieghere, dberris, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D49116
Stella Laurenzo [Sun, 29 Mar 2020 00:49:38 +0000 (17:49 -0700)]
Add /bigobj for SPIRV dialect on MSVC.
Summary: This object file has grown beyond the default limit, and elsewhere in LLVM, we seem to be setting this flag as a one-off, so continuing that here.
Reviewers: mravishankar, antiagainst
Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77002
Matt Arsenault [Fri, 20 Mar 2020 01:25:27 +0000 (21:25 -0400)]
AMDGPU/GlobalISel: Basic legalize rules for G_FSHR
Only handles easy 32-bit cases.
Bill Wendling [Mon, 30 Mar 2020 18:45:58 +0000 (11:45 -0700)]
[Intrinsic] Give "is.constant" the "convergent" attribute
Summary:
Code frequently relies upon the results of "is.constant" intrinsics to
DCE invalid code paths. We don't want the intrinsic to be made control-
dependent on any additional values. For instance, we can't split a PHI
into a "constant" and "non-constant" part via jump threading in order
to "optimize" the constant part, because the "is.constant" intrinsic is
meant to return "false".
Reviewers: wmi, kazu, MaskRay
Reviewed By: kazu
Subscribers: jdoerfert, efriedma, joerg, lebedev.ri, nikic, xbolva00, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75799
Eli Friedman [Mon, 30 Mar 2020 18:45:39 +0000 (11:45 -0700)]
[clang analysis] Make mutex guard detection more reliable.
-Wthread-safety was failing to detect certain AST patterns it should
detect. Make the pattern detection a bit more comprehensive.
Due to an unrelated bug involving template instantiation, this showed up
as a regression in 10.0 vs. 9.0 in the original bug report. The included
testcase fails on older versions of clang, though.
Fixes https://bugs.llvm.org/show_bug.cgi?id=45323 .
Differential Revision: https://reviews.llvm.org/D76943
Nico Weber [Mon, 30 Mar 2020 18:40:05 +0000 (14:40 -0400)]
fix a comment grammar-o
Jonas Devlieghere [Mon, 30 Mar 2020 18:34:55 +0000 (11:34 -0700)]
[lldb/CMake] Make check-lldb-* work for the standalone build.
In order to run check-lldb-* we need the correct map_config directives
in llvm-lit. For the standalone build, LLVM doesn't know about LLDB, and
the lldb mappings are missing. In that case we build our own llvm-lit,
and tell LLVM to use the llvm-lit in the lldb build directory.
Differential revision: https://reviews.llvm.org/D76945
Matt Arsenault [Sun, 29 Mar 2020 00:03:44 +0000 (20:03 -0400)]
GlobalISel: Add accessor to known bits to CombinerHelper
I need to pass known bits to a target combine matcher (which for some
reason aren't methods in a subclass of CombinerHelper?)
Matt Arsenault [Fri, 20 Mar 2020 00:46:08 +0000 (20:46 -0400)]
GlobalISel: Translate llvm.fshl/llvm.fshr
Nico Weber [Sun, 29 Mar 2020 17:02:21 +0000 (13:02 -0400)]
lld: Reduce number of references to undefined printed from 10 to 3.
As of a while ago, lld groups all undefined references to a single
symbol in a single diagnostic. Back then, I made it so that we
print up to 10 references to each undefined symbol.
Having used this for a while, I never wished there were more
references, but I sometimes found that this can print a lot of
output. lld prints up to 10 diagnostics by default, and if
each has 10 references (which I've seen in practice), and each
undefined symbol produces 2 (possibly very long) lines of output,
that's over 200 lines of error output.
Let's try it with just 3 references for a while and see how
that feels in practice.
Differential Revision: https://reviews.llvm.org/D77017
Thomas Raoux [Mon, 30 Mar 2020 17:36:21 +0000 (10:36 -0700)]
[ConstantFold][NFC] Compile time optimization for large vectors
Optimize the common case of splat vector constant. For large vector
going through all elements is expensive. For splatr/broadcast cases we
can skip going through all elements.
Differential Revision: https://reviews.llvm.org/D76664
LLVM GN Syncbot [Mon, 30 Mar 2020 18:16:33 +0000 (18:16 +0000)]
[gn build] Port
3cbbded68c2
Nico Weber [Mon, 30 Mar 2020 18:11:35 +0000 (14:11 -0400)]
Move CLANG_SYSTEMZ_DEFAULT_ARCH to config.h.
Instead of using a global define; see comments on D75914.
While here, port
9c9d88d8b1b to the GN build.
Uday Bondhugula [Sat, 28 Mar 2020 18:49:09 +0000 (00:19 +0530)]
[MLIR] Fix permuteLoops utility
Rewrite mlir::permuteLoops (affine loop permutation utility) to fix
incorrect approach. Avoiding using sinkLoops entirely - use single move
approach. Add test pass.
This fixes https://bugs.llvm.org/show_bug.cgi?id=45328
Depends on D77003.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D77004
Jakub Kuderski [Mon, 30 Mar 2020 17:42:14 +0000 (13:42 -0400)]
[AMDGPU] Add Relocation Constant Support
Summary:
This change adds amdgcn.reloc.constant intrinsic to the amdgpu backend, which will compile into a relocation entry in the resulting elf.
The intrinsics takes a MetadataNode (String) as its only argument, which specifies the symbol name of the relocation entry.
`SelectionDAGBuilder::getValueImpl` is changed to allow metadata operands passed through to ISel.
Author: csyonghe <yonghe@google.com>
Reviewers: tpr, nhaehnle
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76440
Alexey Bataev [Mon, 30 Mar 2020 16:48:44 +0000 (12:48 -0400)]
[OPENMP50]Add codegen support for array shaping expression in depend
clauses.
Implemented codegen for array shaping operation in depend clauses. The
begin of the expression is the pointer itself, while the size of the
dependence data is the mukltiplacation of all dimensions in the array
shaping expression.
Sid Manning [Mon, 30 Mar 2020 17:22:35 +0000 (12:22 -0500)]
[Hexagon] MaxAtomicPromoteWidth and MaxAtomicInlineWidth are not getting set.
Noticed when building llvm's c++ library.
Differential Revision: https://reviews.llvm.org/D76546
Sameer Sahasrabuddhe [Sat, 28 Mar 2020 11:13:35 +0000 (07:13 -0400)]
Introduce unify-loop-exits pass.
For each natural loop with multiple exit blocks, this pass creates a
new block N such that all exiting blocks now branch to N, and then
control flow is redistributed to all the original exit blocks.
The bulk of the tranformation is a new function introduced in
BasicBlockUtils that an redirect control flow from a set of incoming
blocks to a set of outgoing blocks via a common "hub".
This is a useful workaround for a limitation in the structurizer which
incorrectly orders blocks when processing a nest of loops. This pass
bypasses that issue by ensuring that each natural loop is recognized
as a separate region. Since the structurizer is a region pass, it no
longer sees a nest of loops in a single region, and instead processes
each "level" in the nesting as a separate region.
The AMDGPU backend provides a new option to enable this pass before
the structurizer, which may eventually be enabled by default.
Reviewers: madhur13490, arsenm, nhaehnle
Reviewed By: nhaehnle
Differential Revision: https://reviews.llvm.org/D75865
Vedant Kumar [Mon, 30 Mar 2020 17:02:21 +0000 (10:02 -0700)]
[LoopVectorize] Fix crash on "getNoopOrZeroExtend cannot truncate!" (PR45259)
In InnerLoopVectorizer::getOrCreateTripCount, when the backedge taken
count is a SCEV add expression, its type is defined by the type of the
last operand of the add expression.
In the test case from PR45259, this last operand happens to be a
pointer, which (according to llvm::Type) does not have a primitive size
in bits. In this case, LoopVectorize fails to truncate the SCEV and
crashes as a result.
Uing ScalarEvolution::getTypeSizeInBits makes the truncation work as expected.
https://bugs.llvm.org/show_bug.cgi?id=45259
Differential Revision: https://reviews.llvm.org/D76669
Fangrui Song [Sun, 29 Mar 2020 06:12:04 +0000 (23:12 -0700)]
[ELF] Allow SHF_LINK_ORDER and non-SHF_LINK_ORDER to be mixed
Currently, `error: incompatible section flags for .rodata` is reported
when we mix SHF_LINK_ORDER and non-SHF_LINK_ORDER sections in an output section.
This is overconstrained. This patch allows mixed flags with the
requirement that SHF_LINK_ORDER sections must be contiguous. Mixing
flags is used by Linux aarch64 (https://github.com/ClangBuiltLinux/linux/issues/953)
.init.data : { ... KEEP(*(__patchable_function_entries)) ... }
When the integrated assembler is enabled, clang's -fpatchable-function-entry=N[,M]
implementation sets the SHF_LINK_ORDER flag (D72215) to fix a number of
garbage collection issues.
Strictly speaking, the ELF specification does not require contiguous
SHF_LINK_ORDER sections but for many current uses of SHF_LINK_ORDER like
.ARM.exidx/__patchable_function_entries there has been a requirement for
the sections to be contiguous on top of the requirements of the ELF
specification.
This patch also imposes one restriction: SHF_LINK_ORDER sections cannot
be separated by a symbol assignment or a BYTE command. Not allowing BYTE
is a natural extension that a non-SHF_LINK_ORDER cannot be a separator.
Symbol assignments can delimiter the contents of SHF_LINK_ORDER
sections. Allowing SHF_LINK_ORDER sections across symbol assignments
(especially __start_/__stop_) can make things hard to explain. The
restriction should not be a problem for practical use cases.
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D77007
Raul Tambre [Mon, 30 Mar 2020 16:44:15 +0000 (12:44 -0400)]
[libc++] Fix wrong default value for LIBCXX_ENABLE_ASSERTIONS in documentation
It's set to OFF by default at libcxx/CMakeLists.txt:73.
Differential Revision: https://reviews.llvm.org/D76905
Louis Dionne [Mon, 30 Mar 2020 16:00:28 +0000 (12:00 -0400)]
[libc++] Add support for a new keyword ADDITIONAL_COMPILE_FLAGS
This allows adding compilation flags for a single test, which can help
eliminate some .sh.cpp tests and some custom handling in the libc++
test format.
It also works around the issue that .sh.cpp substitutions are _not_
equivalent to the actual compiler command lines used to compile tests,
since the compiler flags can be modified in local lit configurations,
and substitutions are frozen at that point. For example using %{compile}
in a .sh.cpp test in the coroutines subdirectory will not include the
-fcoroutines-ts flag, which is added in the local lit config, because
the %{compile} substitution is created long before we add -fcoroutines-ts
to the compiler flags (in the lit.local.cfg for coroutines).
Fangrui Song [Sun, 29 Mar 2020 06:11:55 +0000 (23:11 -0700)]
[ELF][test] Improve linkerscript/linkorder.s
Yuanfang Chen [Sun, 29 Mar 2020 20:01:42 +0000 (13:01 -0700)]
[X86] make sure POP has implicit def/use of stack pointer when materializing 8-bit immediates for minsize
Summary:
Otherwise PostRA list scheduler may reorder instruction, such as
schedule this
'''
pushq $0x8
pop %rbx
lea 0x2a0(%rsp),%r15
'''
to
'''
pushq $0x8
lea 0x2a0(%rsp),%r15
pop %rbx
'''
by mistake. The patch is to prevent this to happen by making sure POP has
implicit use of SP.
Reviewers: craig.topper
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77031
Gabor Marton [Mon, 30 Mar 2020 15:05:44 +0000 (17:05 +0200)]
[analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's dependency
Reviewers: Szelethus, NoQ
Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77061
Guillaume Chatelet [Mon, 30 Mar 2020 14:45:57 +0000 (14:45 +0000)]
[Alignment][NFC] Use Align version of getMachineMemOperand
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: jyknight, sdardis, nemanjai, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, jfb, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77059
Pavel Labath [Mon, 30 Mar 2020 15:30:42 +0000 (17:30 +0200)]
Revert "[lldb] Fix TestSettings.test_pass_host_env_vars on windows"
This reverts commit because of test failures in TestHelloWorld.
It seems that this test (specifically running "ls" as a platform shell
command) depended on the implicit passing of the host environment.
The fix should be fairly simple (inherit the environment explicitly),
but it may take me a while to figure where exactly to do that. Revert
while I am figuring that out.
Matt Arsenault [Mon, 24 Feb 2020 19:08:41 +0000 (14:08 -0500)]
GlobalISel: Minor cleanups
Louis Dionne [Mon, 30 Mar 2020 15:22:04 +0000 (11:22 -0400)]
[libc++] Avoid duplicating logic in the libcxx-specific filesystem local lit config
This will become more relevant as we shift more filesystem-specific
logic to the local lit configuration in test/std/input.output/filesystems.
Matt Arsenault [Sat, 21 Mar 2020 23:19:31 +0000 (19:19 -0400)]
AMDGPU/GlobalISel: Hack to fix i24 argument lowering
I still think the call lowering type legalization logic split between
the generic code and target is too confusing, but largely induced by
the reliance on the DAG infrastructure.
Matt Arsenault [Wed, 26 Feb 2020 15:17:07 +0000 (10:17 -0500)]
AMDGPU/GlobalISel: Legalize 64-bit G_UDIV/G_UREM
Mostly ported from the DAG version. This results in much worse code
than the DAG version, largely due to a much worse expansion for
G_UMULH.
Chris Jackson [Mon, 30 Mar 2020 14:08:26 +0000 (15:08 +0100)]
[DebugInfo] Ensure that a demanded bits optimisation in
InstCombine does not result in an incorrect debuginfo variable
value
- Add an additional salvage and a test.
Reviewers: aprantl, djtodoro
Differential Revision: https://reviews.llvm.org/D76854
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=44371
Florian Hahn [Mon, 30 Mar 2020 14:20:30 +0000 (15:20 +0100)]
Revert "[Darwin] Respect -fno-unroll-loops during LTO."
As per post-commit comment at https://reviews.llvm.org/D76916, this
should better be done at the TU level.
This reverts commit
9ce198d6ed371399e9bd9ba8b48fbab0f4e60240.
Benjamin Kramer [Mon, 30 Mar 2020 14:12:14 +0000 (16:12 +0200)]
[LLDB] Initialize temporary token
Found by msan.
Pavel Labath [Wed, 25 Mar 2020 12:39:05 +0000 (13:39 +0100)]
[lldb] Fix TestSettings.test_pass_host_env_vars on windows
Summary:
A defensive check in ProcessLauncherWindows meant that we would never
attempt to launch a process with a completely empty environment -- the
host environment would be used instead. Instead, I make the function add
an extra null wchar_t at the end of an empty environment. The
documentation on this is a bit fuzzy, but it seems to be what is needed
to make windows accept these kinds of environments.
Reviewers: amccarth, friss
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76835
Louis Dionne [Thu, 26 Mar 2020 15:04:24 +0000 (11:04 -0400)]
[analyzer][MallocChecker][NFC] Split checkPostCall up, deploy CallDescriptionMap
Since its important to know whether a function frees memory (even if its a
reallocating function!), I used two CallDescriptionMaps to merge all
CallDescriptions into it. MemFunctionInfoTy no longer makes sense, it may never
have, but for now, it would be more of a distraction then anything else.
Differential Revision: https://reviews.llvm.org/D68165
Pavel Labath [Thu, 26 Mar 2020 12:23:51 +0000 (13:23 +0100)]
[lldb] Fix another crash in covariant type handling
Summary:
D73024 seems to have fixed one set crash, but it introduced another.
Namely, if a class contains a covariant method returning itself, the
logic in MaybeCompleteReturnType could cause us to attempt a recursive
import, which would result in an assertion failure in
clang::DeclContext::removeDecl.
For some reason, this only manifested itself if the class contained at
least two member variables, and the class itself was imported as a
result of a recursive covariant import.
This patch fixes the crash by not attempting to import classes which are
already completed in MaybeCompleteReturnType. However, it's not clear to
me if this is the right fix, or if this should be handled automatically
by functions lower in the stack.
Reviewers: teemperor, shafik
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76840
Chris Jackson [Mon, 30 Mar 2020 13:18:01 +0000 (14:18 +0100)]
[DebugInfo] Ensure dead store elimination can mark an operand
value as undefined
- Correct a debug info salvage and add a test
Reviewers: aprantl, vsk
Differential Revision: https://reviews.llvm.org/D76930
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45080
Louis Dionne [Wed, 11 Mar 2020 21:03:00 +0000 (17:03 -0400)]
Remove legacy CMake targets for libcxx and libcxxabi
We've been meaning to remove those targets for a while, and the fix is
simple enough cause they're all just aliases to other targets.
This is a re-application of
f383fb40b17, wich was reverted in
04d48111b
because the build bots had not been updated yet. The build bot configurations
have now been updated not to use the deprecated targets, and I verified
that they were using the non-deprecated targets, so we should be good
unless I missed a bot.
Differential Revision: https://reviews.llvm.org/D76104
Sanjay Patel [Mon, 30 Mar 2020 13:42:25 +0000 (09:42 -0400)]
[InstCombine] add test for trunc-extelt; NFC
Goes with D76983
Alexey Bataev [Wed, 5 Feb 2020 14:33:05 +0000 (09:33 -0500)]
[OPENMP50]Add basic support for array-shaping operation.
Summary:
Added basic representation and parsing/sema handling of array-shaping
operations. Array shaping expression is an expression of form ([s0]..[sn])base,
where s0, ..., sn must be a positive integer, base - a pointer. This
expression is a kind of cast operation that converts pointer expression
into an array-like kind of expression.
Reviewers: rjmccall, rsmith, jdoerfert
Subscribers: guansong, arphaman, cfe-commits, caomhin, kkwli0
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74144
Guillaume Chatelet [Mon, 30 Mar 2020 09:38:44 +0000 (09:38 +0000)]
[Alignment][NFC] Provide tightened up functions in SelectionDAG, MachineFunction and MachineMemOperand
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77046
Haojian Wu [Fri, 27 Mar 2020 15:21:36 +0000 (16:21 +0100)]
[AST] Fix crashes on decltype(recovery-expr).
Summary: We mark these decls as invalid.
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77037
Georgii Rymar [Fri, 27 Mar 2020 12:35:10 +0000 (15:35 +0300)]
[llvm-readobj] - Improve test of --elf-hash-histogram option.
This test missed the check of histograms printed for .hash sections.
It was removed by mistake in D71606 where I tried to get rid of precompiled objects
and did not realize that time that both SHT_GNU_HASH and SHT_HASH sections
were tested and not just GNU version.
Also it never tested aliases for the --elf-hash-histogram option.
Differential revision: https://reviews.llvm.org/D76920
Ulrich Weigand [Mon, 30 Mar 2020 12:20:48 +0000 (14:20 +0200)]
[SystemZ] Allow configuring default CLANG_SYSTEMZ_ARCH
On Ubuntu, we want to raise default CLANG_SYSTEMZ_ARCH to z13,
thus allow configuring this via CMake.
On Debian, we want to raise it to z196.
Author: Dimitri John Ledkov
Differential Revision: https://reviews.llvm.org/D75914
Raphael Isemann [Mon, 30 Mar 2020 09:52:20 +0000 (11:52 +0200)]
[lldb][NFC] Refactor Fix-It filter for warnings
LLDB only automatically applies Fix-Its from errors, but not from warnings.
Currently we only store Fix-Its from errors and then later apply all Fix-Its
we stored. This moves the filter to the application phase, so that we now
store *all* Fix-Its but only apply Fix-Its from errors later on.
This is NFC preparation for an upcoming patch.
scentini [Mon, 30 Mar 2020 11:38:40 +0000 (13:38 +0200)]
Fix unused-variable error when assertions are disabled
Raphael Isemann [Mon, 30 Mar 2020 11:48:26 +0000 (13:48 +0200)]
[lldb] Make TestExprDiagnostics.py pass again after enabling Fix-Its in test
Commit
83c81c0a469482888482983c302c09c02680ae7c enabled Fix-Its for top-level
expressions which change the error message of this test here as Clang comes
up with a strange Fix-It for this expression. This patch just changes the
test to declare a void variable so that Clang doesn't see a way to
recover with a Fix-It and change the error message.
Georgii Rymar [Fri, 27 Mar 2020 13:57:32 +0000 (16:57 +0300)]
[llvm-readobj][test] - Simplify hash-symbols test.
We are able to reduce `-DBITS=32/64` to reduce this test case.
I've rewrote the comments we had to generalize them and
fix wrong computations they contained.
Differential revision: https://reviews.llvm.org/D76924
Simon Pilgrim [Mon, 30 Mar 2020 11:22:06 +0000 (12:22 +0100)]
[X86][AVX] lowerV4X128Shuffle - attempt to widen to 2x256 to simplify shuffles
If we are lowering to X86ISD::SHUF128 we are going to lose track of individual 128-bit lanes that are UNDEF, so if we can widen these to guarantee that they are sequential with their neighbour we should. This helps with later shuffle combines.
Krasimir Georgiev [Mon, 30 Mar 2020 11:13:07 +0000 (13:13 +0200)]
[clang-format] only parse C# generic type constraints in C#
Commit "[clang-format] Handle C# generic type constraints",
https://github.com/llvm/llvm-project/commit/
dcbcec4822f47ec5b638dd9c20dcebd464569dae
regressed the formatting of code containing `where` as an identifier in other
languages.