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.
Florian Hahn [Mon, 30 Mar 2020 10:13:41 +0000 (11:13 +0100)]
[Matrix] Rename emitChainedMatrixMultiply to emitMatrixMultiply (NFC).
The Chained in the name potentially leads to confusion. Also updated the
comment to drop the unnecessary mention of tile-sized.
Florian Hahn [Mon, 30 Mar 2020 09:59:54 +0000 (10:59 +0100)]
[AMDGPU] Drop const for value that is copied (NFC).
This fixes
warning: loop variable 'Def' of type 'const llvm::Register' creates a copy from type 'const llvm::Register' [-Wrange-loop-analysis]
llvm::Register just contains a single unsigned and should be copied.
Reviewers: rampitec
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D77011
Florian Hahn [Sun, 29 Mar 2020 18:17:16 +0000 (19:17 +0100)]
[CVP] Add additional icmp for ranges with undef to test.
Raphael Isemann [Mon, 30 Mar 2020 09:50:55 +0000 (11:50 +0200)]
[lldb] Make Fix-Its also apply to top-level expressions
Summary:
Currently top-level expressions won't automatically get Fix-Its applied. The reason
for that is that we only set the `m_fixed_text` member if we have a wrapping
source code (I.e. `m_source_code` is not zero and is wrapping some expressions).
This patch just always sets `m_fixed_text` to get this working.
Reviewers: labath, jingham
Reviewed By: labath
Subscribers: JDevlieghere
Differential Revision: https://reviews.llvm.org/D77042
Qiu Chaofan [Mon, 30 Mar 2020 09:46:12 +0000 (17:46 +0800)]
[NFC] [PowerPC] Update and add tests for ori
Use script to update test for ori with 32-bit imms, and add test for
ori with 64-bit imms.
Raphael Isemann [Mon, 30 Mar 2020 08:46:18 +0000 (10:46 +0200)]
[lldb][NFC] Cleanup Fix-It code
Sam Parker [Mon, 30 Mar 2020 08:54:25 +0000 (09:54 +0100)]
[ARM][LowOverheadLoops] Add horizontal reduction support
Add a bit more logic into the 'FalseLaneZeros' tracking to enable
horizontal reductions and also make the VADDV variants
validForTailPredication.
Differential Revision: https://reviews.llvm.org/D76708
Haojian Wu [Fri, 27 Mar 2020 20:40:30 +0000 (21:40 +0100)]
[AST] Fix a crash on invalid bitwidth exprs when preserving the recoveryexprs.
Summary:
If the bitwith expr contains errors, we mark the field decl invalid.
This patch also tweaks the behavior of ObjCInterfaceDecl to be consistent with
existing RecordDecl -- getObjCLayout method is only called with valid decls.
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76953
Balázs Kéri [Mon, 30 Mar 2020 07:23:07 +0000 (09:23 +0200)]
[Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.
Summary:
The kernel kmalloc function may return a constant value ZERO_SIZE_PTR
if a zero-sized block is allocated. This special value is allowed to
be passed to kfree and should produce no warning.
This is a simple version but should be no problem. The macro is always
detected independent of if this is a kernel source code or any other
code.
Reviewers: Szelethus, martong
Reviewed By: Szelethus, martong
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76830
Hanhan Wang [Mon, 30 Mar 2020 08:20:08 +0000 (01:20 -0700)]
[mlir] Fix typos in DeclarativeRewrites.md
Differential Revision: https://reviews.llvm.org/D77040
Raphael Isemann [Mon, 30 Mar 2020 07:41:06 +0000 (09:41 +0200)]
[lldb] Run TestFixIts on non-Darwin platforms
This test also passes on my Linux machine, so this seems too strict.
Raphael Isemann [Mon, 30 Mar 2020 07:19:59 +0000 (09:19 +0200)]
[lldb][NFC] Cleanup TestFixIts.py
Guillaume Chatelet [Fri, 27 Mar 2020 16:09:31 +0000 (16:09 +0000)]
[Alignment][NFC] Return Align for SelectionDAGNodes::getOriginalAlignment/getAlignment
Summary:
Also deprecate getOriginalAlignment, getAlignment will take much more time as it is pervasive through the codebase (including TableGened files).
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, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76933
Adam Balogh [Mon, 30 Mar 2020 07:22:10 +0000 (09:22 +0200)]
[Analyzer] Rename test `iterator-modelling.cpp` to `iterator-modeling.cpp`
Typo fix.
Adam Balogh [Thu, 5 Mar 2020 19:09:15 +0000 (20:09 +0100)]
[Analyzer] Fix for incorrect use of container and iterator checkers
Iterator checkers (and planned container checkers) need the option
aggressive-binary-operation-simplification to be enabled. Without this
option they may cause assertions. To prevent such misuse, this patch adds
a preventive check which issues a warning and denies the registartion of
the checker if this option is disabled.
Differential Revision: https://reviews.llvm.org/D75171
David Green [Sat, 28 Mar 2020 16:22:05 +0000 (16:22 +0000)]
[ARM] MVE VMOV.i64
In the original batch of MVE VMOVimm code generation VMOV.i64 was left
out due to the way it was done downstream. It turns out that it's fairly
simple though. This adds the codegen for it, similar to NEON.
Bigendian is technically incorrect in this version, which John is fixing
in a Neon patch.
Craig Topper [Mon, 30 Mar 2020 03:19:04 +0000 (20:19 -0700)]
[TTI][X86] Fix the value passed to IsUnsigned for cost modeling of experimental.vector.reduce.smin/smax/umin/umax.
We were passing true for smax/smin and false for umax/umin.
Max Kazantsev [Mon, 30 Mar 2020 05:13:02 +0000 (12:13 +0700)]
[NFC] Remove obsolete checks followed by fix of isGuaranteedToTransferExecutionToSuccessor
In past, isGuaranteedToTransferExecutionToSuccessor contained some weird logic
for volatile loads/stores that was ultimately removed by patch D65375. It's time to
remove a piece of dependent logic that used to be a workaround for the code which
is now deleted.
Reviewed By: uenoku
Differential Revision: https://reviews.llvm.org/D76918
River Riddle [Mon, 30 Mar 2020 05:00:26 +0000 (22:00 -0700)]
[mlir][NFC] Update dialect/op documentation to be consistent
Summary:
This revision performs a lot of different cleanups on operation documentation to ensure that they are consistent, e.g. using mlir code blocks, formatting, etc.
This revision also includes the auto-generated documentation into the hand-written documentation for the dialects that have a specific top-level dialect file. This updates the documentation for all dialects aside from SPIRV and STD. These dialects will be updated in a followup.
Differential Revision: https://reviews.llvm.org/D76734
River Riddle [Mon, 30 Mar 2020 04:49:44 +0000 (21:49 -0700)]
[mlir][NFC] Use the auto-generated op documentation in the standard dialect documentation
Summary: This revision updates the dialect documentation to use the auto-generated markdown for operations. This allows for updating some out-of-date bits of documentation, and allows for displaying a large of number of newly added operations that did not have a counter part in Standard.md.
Differential Revision: https://reviews.llvm.org/D76743
River Riddle [Mon, 30 Mar 2020 04:38:11 +0000 (21:38 -0700)]
[mlir][Diagnostics] Don't print note source line if it is the same as the previous diagnostic
Summary: This revision updates the SourceMgrDiagnosticHandler to not print the source location of a note if it is the same location as the previously printed diagnostic. This helps avoid redundancy, and potential confusion, when looking at the diagnostic output.
Differential Revision: https://reviews.llvm.org/D76787
Juneyoung Lee [Sat, 28 Mar 2020 06:11:09 +0000 (15:11 +0900)]
[LangRef] Clarify the semantics of branch on undef
Summary:
This patch clarifies the semantics of branching on undef value.
Defining `br undef` as undefined behavior explains optimizations that use branch conditions, such as CVP (D76931) and GVN (propagateEquality).
For `switch cond`, it is defined to raise UB if cond is an expression containing undef && cond is not frozen &&
it may yield different values.
This allows that at the destination block the branch condition can be assumed to be frozen already (otherwise UB was already triggered).
This condition is slightly stricter than MemorySanitizer, which allows undef-y condition if it always leads to the same destination,
but it does not break MemorySanitizer because we are giving stricter constraint.
Reviewers: efriedma, fhahn, nikic, spatel, jdoerfert, nlopes
Reviewed By: nlopes
Subscribers: regehr, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76973
Richard Smith [Mon, 30 Mar 2020 02:31:21 +0000 (19:31 -0700)]
PR45350: Handle unsized array CXXConstructExprs in constant evaluation
of array new expressions with runtime bound.
Jun Ma [Fri, 27 Mar 2020 07:27:05 +0000 (15:27 +0800)]
[Coroutines 2/2] Improve symmetric control transfer feature
Differential Revision: https://reviews.llvm.org/D76913
Jun Ma [Fri, 27 Mar 2020 07:15:28 +0000 (15:15 +0800)]
[Coroutines 1/2] Improve symmetric control transfer feature
Differential Revision: https://reviews.llvm.org/D76911
Alexandre Ganea [Mon, 30 Mar 2020 01:51:45 +0000 (21:51 -0400)]
[LLD][ELF] Put back rounding which was lost in
8404aeb56a73ab24f9b295111de3b37a37f0b841
David Zarzycki [Sun, 29 Mar 2020 01:25:07 +0000 (21:25 -0400)]
Revert "[libc++] NFC: Simplify substitutions by using lit recursive substitutions"
This reverts commit
cd7f9751c30092033a5e97591876f972daf61989 which has
unintended breakage to non-libcxx projects when using the documented way
of building LLVM. (See the Getting Started guide. I.e. one big CMake setup.)
Craig Topper [Sun, 29 Mar 2020 22:54:34 +0000 (15:54 -0700)]
[X86] Add sse4.1 RUNs lines to the min/max reduction cost model tests.
Mostly this matches the sse4.2 we already had command lines for.
Except in the i64 case since sse4.1 doesn't have pcmpgtq.
Daan Sprenkels [Sun, 29 Mar 2020 21:25:39 +0000 (17:25 -0400)]
[InstCombine] Add tests for trunc (extelt x); (NFC)
Baseline tests for D76983 (PR45314)
Differential Revision: https://reviews.llvm.org/D77024
Craig Topper [Sun, 29 Mar 2020 07:27:33 +0000 (00:27 -0700)]
[X86] Add sse4.2 command lines to min/max reduction tests.
SSE4.2 has the pcmpgtq instruction which we will use in
vXi64 reductions when its available.
Benjamin Kramer [Sun, 29 Mar 2020 20:30:06 +0000 (22:30 +0200)]
[ARMMVE] Create fewer temporary SmallVectors
Shrinks clang by 40k.
Richard Smith [Sun, 29 Mar 2020 20:13:57 +0000 (13:13 -0700)]
Don't claim template names that name non-templates are undeclared.
Fangrui Song [Thu, 19 Mar 2020 05:28:21 +0000 (22:28 -0700)]
[ELF][test] Improve arm-exidx-output.s to test different output text sections
Delete arm-exidx-link.s which is now covered by arm-exidx-output.s
Differential Revision: https://reviews.llvm.org/D76409
David Green [Sat, 28 Mar 2020 16:11:37 +0000 (16:11 +0000)]
[ARM] VMOV.64 immediate tests. NFC
LLVM GN Syncbot [Sun, 29 Mar 2020 19:24:34 +0000 (19:24 +0000)]
[gn build] Port
854f268ca62
Benjamin Kramer [Sun, 29 Mar 2020 19:09:07 +0000 (21:09 +0200)]
[MC] Move deprecation infos from MCTargetDesc to MCInstrInfo
This allows emitting it only when the feature is used by a target.
Shrinks Release+Asserts clang by 900k.
Nathan Ridge [Sun, 29 Mar 2020 19:13:13 +0000 (15:13 -0400)]
[clangd] Handle clang-tidy suppression comments for diagnostics inside macro expansions
Summary:
Not handling this was a side-effect of being overly cautious when trying
to avoid reading files for which clangd doesn't have the source mapped.
Fixes https://github.com/clangd/clangd/issues/266
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet,
usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75286
Nathan Ridge [Sun, 29 Mar 2020 19:12:58 +0000 (15:12 -0400)]
clang-format fixes in ClangTidyDiagnosticConsumer.cpp and DiagnosticsTets.cpp
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77023
Simon Pilgrim [Sun, 29 Mar 2020 18:44:39 +0000 (19:44 +0100)]
[X86][AVX] Combine 128/256-bit lane shuffles with zeroable upper subvectors to EXTRACT_SUBVECTOR (PR40720)
As explained on PR40720, EXTRACTF128 is always as good/better than VPERM2F128/SHUF128, and we can use the implicit zeroing of the uppers.
Simon Pilgrim [Sun, 29 Mar 2020 18:40:42 +0000 (19:40 +0100)]
Fix -Wdocumentation warning. NFC.
gcc was misinterpreting the template code snippet as html.
Simon Pilgrim [Sun, 29 Mar 2020 17:48:02 +0000 (18:48 +0100)]
[X86] Add isAnyZero shuffle mask helper
Nikita Popov [Sun, 29 Mar 2020 17:20:11 +0000 (19:20 +0200)]
[InstCombine] Erase old mul when creating umulo
As we don't return the result of replaceInstUsesWith(), we are
responsible for erasing the instruction.
There is a small subtlety here in that we need to do this after
the other uses of Builder, which uses the original multiply as
the insertion point.
NFC apart from worklist order changes.
Nikita Popov [Sun, 29 Mar 2020 18:07:46 +0000 (20:07 +0200)]
[InstCombine] Use replaceOperand() in demanded elements simplification
To make sure that dead operands get DCEd. This fixes the largest
source of leftover dead operands we see in tests.
NFC apart from worklist changes.
Uday Bondhugula [Sat, 28 Mar 2020 18:36:10 +0000 (00:06 +0530)]
[MLIR] Add missing asserts in interchangeLoops util, doc comment update
Add missing assert checks for input to mlir::interchangeLoops utility.
Rename interchangeLoops -> permuteLoops; update doc comments to clarify
inputs / return val. Other than the assert checks, this is NFC.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D77003