Commit Graph

344482 Commits

Author SHA1 Message Date
Nikita Popov a99b97b818 [InstSimplify] Add additional icmp of gep folding test; NFC 2020-03-04 18:27:01 +01:00
Nikita Popov 0940c32385 [InstSimplify] Regenerate compare.ll checks; NFC 2020-03-04 18:26:42 +01:00
Nikita Popov 0e890cd4d4 [ConstantFolding] Always return something from ConstantFoldConstant
Spin-off from D75407. As described there, ConstantFoldConstant()
currently returns null for non-ConstantExpr/ConstantVector inputs,
but otherwise always returns non-null, independently of whether
any folding has happened or not.

This is confusing and makes consumer code more complicated.
I would expect either that ConstantFoldConstant() returns only if
it actually folded something, or that it always returns non-null.
I'm going to the latter possibility here, which appears to be more
useful considering existing usage.

Differential Revision: https://reviews.llvm.org/D75543
2020-03-04 18:24:47 +01:00
Jeremy Morse d4f9675b55 [analyzer] decode() a bytes object to make Python3 happy
The output of subprocess.check_output is decode()'d through the rest of
this python program, but one appears to have been missed for the output
of the call to "clang -print-file-name=include".

On Windows, with Python 3.6, this leads to the 'args' array being a mix of
bytes and strings, which causes exceptions later down the line.

I can't easily test with python2 on Windows, but python2 on Ubuntu 18.04
was happy with this change.
2020-03-04 17:12:48 +00:00
Craig Topper 06de426426 [X86] Directly form VBROADCAST_LOAD in lowerShuffleAsBroadcast on AVX targets.
If we would emit a VBROADCAST node, we can instead directly emit
a VBROADCAST_LOAD. This allows us to get rid of the special case
to use an f64 load on 32-bit targets for vXi64.

I believe there is more cleanup we can do later in this function,
but I'll do that in follow ups.
2020-03-04 09:11:57 -08:00
Simon Pilgrim f24d90c0a6 [X86] Add tests showing failure to combine consecutive loads + FSHR into a single load
Similar to some of the regressions seen in D75114
2020-03-04 17:07:03 +00:00
Simon Pilgrim 4c411d2419 [X86] Add tests showing failure to combine consecutive loads + FSHL into a single load
Similar to some of the regressions seen in D75114
2020-03-04 17:07:02 +00:00
Michael Park 5b1e5b4338 [libc++][P0174] Deprecated/removed parts of default allocator.
Differential Revision: https://reviews.llvm.org/D70117
2020-03-04 12:06:26 -05:00
Raphael Isemann 0ab109d43d [lldb][NFC] Modernize logging UserExpression 2020-03-04 09:04:54 -08:00
Raphael Isemann 8673def9c1 Fix modules build after MatrixBuilder patch
The addition of MatrixBuilder.h broke the modules build:
```
While building module 'LLVM_intrinsic_gen' imported from llvm-project/llvm/lib/IR/AbstractCallSite.cpp:19:
While building module 'LLVM_IR' imported from llvm-project/llvm/include/llvm/IR/Argument.h:19:
In file included from <module-includes>:6:
llvm-project/llvm/include/llvm/IR/MatrixBuilder.h:19:10: fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen
         ^
While building module 'LLVM_intrinsic_gen' imported from llvm-project/llvm/lib/IR/AbstractCallSite.cpp:19:
In file included from <module-includes>:1:
llvm-project/llvm/include/llvm/IR/Argument.h:19:10: fatal error: could not build module 'LLVM_IR'
 ~~~~~~~~^~~~~~~~~~~~~~~~~
llvm-project/llvm/lib/IR/AbstractCallSite.cpp:19:10: fatal error: could not build module 'LLVM_intrinsic_gen'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
```
2020-03-04 09:03:34 -08:00
Louis Dionne a2fe17cdc6 [libc++] Fix reverse_iterator test when UBSan is enabled
The goal of the test was only to check that we could access the
`this->current` member of std::reverse_iterator from a derived
class, but in doing so we incremented a null iterator, which is UB.
2020-03-04 11:35:34 -05:00
Sanjay Patel 71a316883d [PassManager] adjust VectorCombine placement
The initial placement of vector-combine in the opt pipeline revealed phase ordering bugs:
https://bugs.llvm.org/show_bug.cgi?id=45015
https://bugs.llvm.org/show_bug.cgi?id=42022

This patch contains a few independent changes:

1. Move the pass up in the pipeline, so it happens just after loop-vectorization.
   This is only to keep vectorization passes together in the pipeline at the moment.
   I don't have evidence of interaction between these yet.
2. Add an -early-cse pass after -vector-combine to clean up redundant ops. This was
   partly proposed as far back as rL219644 (which is why it's effectively being moved
   in the old PM code). This is important because the subsequent -instcombine doesn't
   work as well without EarlyCSE. With the CSE, -instcombine is able to squash
   shuffles together in 1 of the tests (because those are simple "select" shuffles).
3. Remove the -vector-combine pass that was running after SLP. We may want to do that
   eventually, but I don't have a test case to support it yet.

Differential Revision: https://reviews.llvm.org/D75145
2020-03-04 11:10:49 -05:00
Balazs Benics 95a94df5a9 [analyzer][NFC] Use CallEvent checker callback in GenericTaintChecker
Summary:
Intended to be a non-functional change but it turned out CallEvent handles
constructor calls unlike CallExpr which doesn't triggered for constructors.

All in all, this change shouldn't be observable since constructors are not
yet propagating taintness like functions.
In the future constructors should propagate taintness as well.

This change includes:
 - NFCi change all uses of the CallExpr to CallEvent
 - NFC rename some functions, mark static them etc.
 - NFC omit explicit TaintPropagationRule type in switches
 - NFC apply some clang-tidy fixits

Reviewers: NoQ, Szelethus, boga95

Reviewed By: Szelethus

Subscribers: martong, whisperity, xazax.hun, baloghadamsoftware, szepet,
a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72035
2020-03-04 17:03:59 +01:00
Sanjay Patel 29a2b20ab3 [SDAG] simplify FP binops to undef
As discussed in the commit thread for rGa253a2a and D73978, we can do more undef folding for FP ops.
The nnan and ninf fast-math-flags specify that if an operand is the disallowed value, the result is
poison, so we can produce an undef result.

But this doesn't work as expected (the undef operand cases remain) because of a Flags propagation
problem in SelectionDAGBuilder.

I've added DAGCombiner calls to enable these for the other cases because we've shown in other
patches that (because of the limited way that SDAG iterates), it is possible to miss simplifications
like this if they are done only at node creation time.

Several potential follow-ups to expand on this patch are possible.

Differential Revision: https://reviews.llvm.org/D75576
2020-03-04 10:42:16 -05:00
Alex Zinenko aff6bf4ff8 [mlir] support conversion of parallel reduction loops to std
Recently introduced support for converting sequential reduction loops to
CFG of basic blocks in the Standard dialect makes it possible to perform
a staged conversion of parallel reduction loops into a similar CFG by
using sequential loops as an intermediate step. This is already the case
for parallel loops without reduction, so extend the pattern to support
an additional use case.

Differential Revision: https://reviews.llvm.org/D75599
2020-03-04 16:37:17 +01:00
Jeremy Morse 16c6e0f387 Quote a python executable path
On my Windows machine at least, the path to python contains a space.
2020-03-04 15:23:48 +00:00
Alexey Bataev 4f29d30f7c [OPENMP50]'source' and 'sink' kinds are not allowed in depobj.
Do not allow to use 'sink' and 'source' dependency kinds in 'depobj'
directive.
2020-03-04 10:17:42 -05:00
AndreyChurbanov 95df6747cf [openmp] OpenMP 5.1 omp_display_env function implementation.
Patch by Michael Klemm.

Differential Revision: https://reviews.llvm.org/D74956
2020-03-04 18:15:05 +03:00
Louis Dionne 06dac0c39a [libc++] Mark the shared_future.wait_for test as being flaky
It is timing sensitive and it fails from time to time. If marking it as
flaky doesn't help, we can try tweaking the time outs.
2020-03-04 10:10:50 -05:00
John Brawn 2bb3fb05e2 Handle PluginAttrInstances using ManagedStatic
We need to make sure that PluginAttrInstances is deleted before shared libraries
are unloaded, because otherwise when deleting its contents we'll try to access
a virtual destructor which no longer exists.

As shared libraries are managed using ManagedStatic we can do this by also using
ManagedStatic for PluginAttrInstances as ManagedStatics are deleted in reverse
order of construction and we know that PluginAttrInstances will only be
accessed, and thus constructed, after shared libraries have been loaded.
2020-03-04 15:03:13 +00:00
Mikhail Maltsev 00c5793ede Revert "Promote nameless lambda used by dl_iterate_phdr to named function to clean up control flow inside findUnwindSections. Also, expose the data structure"
This reverts commit d93371238e.

The commit broke the build in several configurations (including
Windows and bare-metal). For details see comments in
https://reviews.llvm.org/D75480
2020-03-04 14:54:24 +00:00
Alexander Belyaev ffcb492327 [MLIR] Add a comment to `requiredOperandCount` arg in LoopOps.cpp.
Differential Revision: https://reviews.llvm.org/D75578
2020-03-04 15:48:23 +01:00
Tatyana Krasnukha b1324e74da [lldb][NFC] Move local variables near to their usage 2020-03-04 16:56:51 +03:00
Tatyana Krasnukha 6c17cc531f [lldb] Make BreakpointResolver hold weak_ptr instead of raw pointer to breakpoint
This prevents calling Breakpoint::shared_from_this of an object that is not owned by any shared_ptr.

Differential Revision: https://reviews.llvm.org/D74557
2020-03-04 16:56:50 +03:00
David Green 587feec07e [ARM] Change all tests from "thumbv8.1-m.main" to "thumbv8.1m.main". NFC 2020-03-04 13:47:35 +00:00
Stephan Herhut 573c9d666c [lld] Avoid creating files outside of work directory.
Summary:
A test is passing `-o -` to lld in the hope of writing the output to
standard out but that is not the case. Instead it creates a file named
`-.lto.o`. This fixes it by creating a temporary file in the work
directory.

Differential Revision: https://reviews.llvm.org/D75605
2020-03-04 14:46:12 +01:00
Evgeniy Brevnov e60c28746b Lost regression test from commit 5a63813dc7. 2020-03-04 19:52:42 +07:00
Pavel Labath 3245dd59b1 [lldb] Reduce duplication in CommandObjectDisassemble
This command had nearly identical code for the "then" and "else"
branches of the "if (m_options.num_instructions != 0)" condition.

This patch factors out the common parts of the two blocks to reduce
duplication.
2020-03-04 13:47:35 +01:00
Jonathan Coe 7d2fdd3f66 [clang-format] parse C# object initialisers
Summary:
Treat C# object initializers as braced lists.

Allow lambdas inside C# braced lists.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits, MyDeveloperDay

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D75473
2020-03-04 12:14:00 +00:00
Adrian Kuegel 91acb5b3e1 Add rsqrt op to Standard dialect and lower it to LLVM dialect.
Summary:
This adds an rsqrt op to the standard dialect, and lowers
it as 1 / sqrt to the LLVM dialect.

Differential Revision: https://reviews.llvm.org/D75353
2020-03-04 13:13:31 +01:00
Pavel Labath bddab92858 Use new DWARFDataExtractor::getInitialLength in DWARFDebugFrame 2020-03-04 13:01:35 +01:00
Pavel Labath 2458492a9a Use new DWARFDataExtractor::getInitialLength in DWARFDebugPubTable 2020-03-04 13:01:35 +01:00
Pavel Labath c9579271b3 Use new DWARFDataExtractor::getInitialLength in DWARFUnit 2020-03-04 13:01:35 +01:00
Pavel Labath a8bc9c3f0f Use new DWARFDataExtractor::getInitialLength in DWARFVerifier 2020-03-04 13:01:34 +01:00
Pavel Labath eb2b17eea7 Use DWARFDataExtractor::getInitialLength in debug_aranges
Summary:
getInitialLength is a *DWARF*DataExtractor method so I had to "upgrade"
some DataExtractors to be able to make use of it.

Reviewers: ikudrin, jhenderson, probinson

Subscribers: aprantl, hiraditya, llvm-commits, dblaikie

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75535
2020-03-04 13:01:07 +01:00
Pavel Labath 38385630ad Use DWARFDataExtractor::getInitialLength in DWARFDebugAddr
Reviewers: ikudrin, jhenderson, probinson

Subscribers: hiraditya, dblaikie, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75532
2020-03-04 13:00:15 +01:00
Kerry McLaughlin f5502c7035 [AArch64][SVE] Add SVE2 intrinsic for xar
Summary: Implements the @llvm.aarch64.sve.xar intrinsic

Reviewers: andwar, c-rhodes, dancgr, efriedma, rengolin

Reviewed By: andwar

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75160
2020-03-04 11:44:32 +00:00
Kadir Cetinkaya 2128a79c46
[clangd] Fix buildbots 2020-03-04 12:41:26 +01:00
Evgeniy Brevnov 5a63813dc7 [DependenceAnalysis] Dependecies for loads marked with "ivnariant.load" should not be shared with general accesses(PR42151).
Summary:
This is second attempt to fix the problem with incorrect dependencies reported in presence of invariant load. Initial fix (https://reviews.llvm.org/D64405) was reverted due to a regression reported in https://reviews.llvm.org/D70516.

The original fix changed caching behavior for invariant loads. Namely such loads are not put into the second level cache (NonLocalDepInfo). The problem with that fix is the first level cache  (CachedNonLocalPointerInfo) still works as if invariant loads were in the second level cache. The solution is in addition to not putting dependence results into the second level cache avoid putting info about invariant loads into the first level cache as well.

Reviewers: jdoerfert, reames, hfinkel, efriedma

Reviewed By: jdoerfert

Subscribers: DaniilSuchkov, hiraditya, bmahjour, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73027
2020-03-04 18:40:02 +07:00
Simon Pilgrim 94885431e1 Fix some getAs/castAs null dereference static analyzer warnings.
Use castAs if we know the cast should succeed (or we're dereferencing without check), the castAs will assert as well so we can remove local non-null asserts.
2020-03-04 11:25:50 +00:00
Simon Pilgrim e2f0093800 [AMDGPU] performCvtF32UByteNCombine - revisit node after src operand simplification.
If SimplifyDemandedBits succeeds in simplifying the byte src, add the CVT_F32_UBYTE node back to the worklist as we might be able to simplify further.

Yet another step towards removing SelectionDAG::GetDemandedBits.
2020-03-04 11:25:50 +00:00
Florian Hahn 2a70db245d [Matrix] Add IR MatrixBuilder.
This builder provides a convenient way for targets to lower various matrix
operations to LLVM IR, making use of matrix intrinsics where available.

Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor, LuoYuanke

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D72280
2020-03-04 11:14:20 +00:00
Kadir Cetinkaya a8706b22a6
[clangd] Fix windows buildbots 2020-03-04 12:07:23 +01:00
gbreynoo 5e0f9d5d3c [llvm-ar][test] Add to llvm-ar test coverage
- Added handling of thin archives to symtab.test.
- Added handling of newlines to response.test.
- 62fa3332c9 exposed behaviour
  regarding the use of -- on the command line. Added
  double-hyphen.test to cover this.

Differential Revision: https://reviews.llvm.org/D73333
2020-03-04 10:56:48 +00:00
Ilya Biryukov ec3060c72d [AST] Refactor propagation of dependency bits. NFC
Summary:
This changes introduces an enum to represent dependencies as a bitmask
and extract common patterns from code that computes dependency bits into
helper functions.

Reviewers: rsmith, martong, shafik, ilya-biryukov, hokein

Subscribers: hokein, sammccall, Mordante, riccibruno, merge_guards_bot, rnkovacs, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D71920
2020-03-04 11:25:17 +01:00
evgeny 670a40360e Attempt to fix buildbot after 497c110e 2020-03-04 13:05:02 +03:00
Kadir Cetinkaya ec7c8bae84
[clangd] Make use of syntax tokens in ReplayPreamble
Summary: Replace usage of RawLexer with syntax tokens inside ReplayPreamble.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74842
2020-03-04 11:01:35 +01:00
Kadir Cetinkaya e6b8181895
[clangd] Fix early selection for non-vardecl declarators
Summary:
Selection tree was performing an early claim only for VarDecls, but
there are other cases where we can have declarators, e.g. FieldDecls. This patch
extends the early claim logic to all types of declarators.

Fixes https://github.com/clangd/clangd/issues/292

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75106
2020-03-04 11:01:35 +01:00
evgeny 497c110e87 [lld][ELF][COFF] Fix archived bitcode files naming
Differential revision: https://reviews.llvm.org/D75422
2020-03-04 12:46:31 +03:00
Georgii Rymar 1c991f907a [Object/ELF] - Fix the offset type used in ELFFile<ELFT>::getEntry().
We use size_t for a file offset what is wrong, because size_t is 32-bit
value on 32-bit platforms.

I was reported that after my 0b511c2302
"[llvm-readobj] - Report warnings instead of errors for broken relocations."

The following error is observed on 32-bit Arch Linux:

[100%] Running all regression tests
FAIL: LLVM :: tools/llvm-readobj/ELF/relocation-errors.test (52954 of 54768)
******************** TEST 'LLVM :: tools/llvm-readobj/ELF/relocation-errors.test' FAILED ***

...
llvm-project/llvm/test/tools/llvm-readobj/ELF/relocation-errors.test:9:14:error: LLVM-NEXT: expected string not found in input
# LLVM-NEXT: warning: '[[FILE]]': unable to print relocation 1 in section 3: unable to access section [index 6] data at 0x17e7e7e8b0: offset goes past the end of file
             ^
<stdin>:9:1: note: scanning from here
/llvm-project/build/bin/llvm-readobj: warning: 'llvm-project/build/test/tools/llvm-readobj/ELF/Output/relocation-errors.test.tmp64': unable to print relocation 1 in section 3: unable to access section [index 6] data at 0xe7e7e8b0: offset goes past the end of file

This patch should fix the issue.
2020-03-04 12:33:10 +03:00