Commit Graph

327922 Commits

Author SHA1 Message Date
Richard Smith bf322b7cdd Always rebuild a DeclRefExpr if its FoundDecl would change.
Fixes a regression introduced by r369999.

llvm-svn: 373022
2019-09-26 22:28:32 +00:00
Craig Topper c898724974 [X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32imm0) to use masked MOVSS from memory.
Similar for f64 and having a non-zero passthru value.

We were previously not trying to fold the load at all. Using
a CodeGenOnly instruction allows us to use FR32X/FR64X as the
register class to avoid a bunch of COPY_TO_REGCLASS.

llvm-svn: 373021
2019-09-26 22:23:09 +00:00
Jordan Rupprecht f98d2c099a Revert [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")
This reverts r372626 (git commit 6a278d9073)

llvm-svn: 373019
2019-09-26 22:09:17 +00:00
Kit Barton 50bc610460 [LoopFusion] Add ability to fuse guarded loops
Summary:
This patch extends the current capabilities in loop fusion to fuse guarded loops
(as defined in https://reviews.llvm.org/D63885). The patch adds the necessary
safety checks to ensure that it safe to fuse the guarded loops (control flow
equivalent, no intervening code, and same guard conditions). It also provides an
alternative method to perform the actual fusion of guarded loops. The mechanics
to fuse guarded loops are slightly different then fusing non-guarded loops, so I
opted to keep them separate methods. I will be cleaning this up in later
patches, and hope to converge on a single method to fuse both guarded and
non-guarded loops, but for now I think the review will be easier to keep them
separate.

Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65464

llvm-svn: 373018
2019-09-26 21:42:45 +00:00
Zhaoshi Zheng 1128fa0924 [Unroll] Do NOT unroll a loop with small runtime upperbound
For a runtime loop if we can compute its trip count upperbound:

Don't unroll if:
1. loop is not guaranteed to run either zero or upperbound iterations; and
2. trip count upperbound is less than UnrollMaxUpperBound
Unless user or TTI asked to do so.

If unrolling, limit unroll factor to loop's trip count upperbound.

Differential Revision: https://reviews.llvm.org/D62989

Change-Id: I6083c46a9d98b2e22cd855e60523fdc5a4929c73
llvm-svn: 373017
2019-09-26 21:40:27 +00:00
Alex Langford 7dfb095b88 [lldb-vscode] correctly handle multiple sourceMap entries
Summary:
`lldb-vscode` concatenates a string of sourceMap entries
specified in the config, but fails to put a space between
each entry, which causes the settings command to fail.
This patch adds a space between each mapping.

Patch by Richard Howell

Differential Revision: https://reviews.llvm.org/D67569

llvm-svn: 373016
2019-09-26 21:18:37 +00:00
Stanislav Mekhanoshin 486cd9a90d [AMDGPU] copy OtherPredicates from pseudo to VOP3_Real
Differential Revision: https://reviews.llvm.org/D68102

llvm-svn: 373015
2019-09-26 21:06:17 +00:00
Roman Lebedev 3a5ca1c8b5 [DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext
llvm-svn: 373014
2019-09-26 20:49:49 +00:00
Roman Lebedev 86b40b0bbf [InstCombine][NFC] Add tests for shift-by-signext
llvm-svn: 373013
2019-09-26 20:49:30 +00:00
Roman Lebedev d1ef2e48fb [InstCombine][NFC] Regenerate load-cmp.ll test
llvm-svn: 373012
2019-09-26 20:49:21 +00:00
Whitney Tsang 9c5fbcf920 [LOOPGUARD] Disable loop with multiple loop exiting blocks.
Summary: As discussed in the loop group meeting. With the current
definition of loop guard, we should not allow multiple loop exiting
blocks. For loops that has multiple loop exiting blocks, we can simply
unable to find the loop guard.
When getUniqueExitBlock() obtains a vector size not equals to one, that
means there is either no exit blocks or there exists more than one
unique block the loop exit to.
If we don't disallow loop with multiple loop exit blocks, then with our
current implementation, there can exist exit blocks don't post dominated
by the non pre-header successor of the guard block.
Reviewer: reames, Meinersbur, kbarton, etiotto, bmahjour
Reviewed By: Meinersbur, kbarton
Subscribers: fhahn, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66529

llvm-svn: 373011
2019-09-26 20:20:42 +00:00
Alexey Bataev 1202614d16 [OPENMP50]Emit warnings if the functions was defined/used before marked
declare variant.

We can use the original function if it was used/emitted already. So,
just use warnings for these cases, not errors.

llvm-svn: 373010
2019-09-26 20:04:15 +00:00
Xiangling Liao 3b808fb330 [AIX]Emit function descriptor csect in assembly
This patch emits the function descriptor csect for functions with definitions
under both 32-bit/64-bit mode on AIX.

Differential Revision: https://reviews.llvm.org/D66724

llvm-svn: 373009
2019-09-26 19:38:32 +00:00
Bob Haarman 4061a9b63a [NFC][emacs] remove out-of-date comment from tablegen-mode.el
Summary:
The syntax table was originally based on and attributed to
jasmin.el, but was rewritten in r45192, so the comment that
says the code comes from jasmin.el is no longer accurate. This
change removes the comment, shortening the code a bit.

Reviewers: MaskRay, lattner

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68042

llvm-svn: 373008
2019-09-26 19:36:01 +00:00
Alex Lorenz 15d5f5dd35 [clang-scan-deps] Allow continuation line backslashes followed by whitespace
in the dependency source minimizer

Clang allows continuations that have whitespace between the backslash and the newline.
This patch ensures that the dependency source minimizer can handle the whitespace between
the backslash and the newline when looking for a line continuation.

Differential Revision: https://reviews.llvm.org/D68052

llvm-svn: 373007
2019-09-26 19:28:51 +00:00
David Bolvansky f1a5a93157 [NFC] Precommit tests for D68089
llvm-svn: 373006
2019-09-26 19:01:18 +00:00
Artem Dergachev 214f68e7a1 Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."
This reverts commit r372940 which was an overreaction to a flaky buildbot.

llvm-svn: 373005
2019-09-26 18:52:00 +00:00
Reid Kleckner e440d23195 Only pass -coverage-notes-file when emitting coverage
The only functional change here is that -coverage-notes-file is not
passed to -cc1 in some situations.

This code appears to be trying to put the gcno and gcda output next to
the final object file, but it's doing that in a really convoluted way
that needs to be re-examined. It looks for -c or -S in the original
command, and then looks at the -o argument if present in order to handle
the -fno-integrated-as case. However, this doesn't work if this is a
link command with multiple inputs. I looked into fixing this, but the
check-profile test suite has a lot of dependencies on this behavior, so
I left it all alone.

llvm-svn: 373004
2019-09-26 18:13:19 +00:00
Lawrence D'Anna 2fce1137c7 Convert FileSystem::Open() to return Expected<FileUP>
Summary:
This patch converts FileSystem::Open from this prototype:

Status
Open(File &File, const FileSpec &file_spec, ...);

to this one:

llvm::Expected<std::unique_ptr<File>>
Open(const FileSpec &file_spec, ...);

This is beneficial on its own, as llvm::Expected is a more modern
and recommended error type than Status.  It is also a necessary step
towards https://reviews.llvm.org/D67891, and further developments
for lldb_private::File.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67996

llvm-svn: 373003
2019-09-26 17:54:59 +00:00
Kevin P. Neal 875d20bcde Document requirement of function attributes with constrained floating
point.

Reviewed by:    andrew.w.kaylor, uweigand, efriedma
Approved by:    andrew.w.kaylor
Differential Revision:  https://reviews.llvm.org/D67839

llvm-svn: 373002
2019-09-26 17:50:25 +00:00
Simon Pilgrim 22d225a2b2 DAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer cast_or_null<CheckTypeMatcher> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, replace with an null/isa assertion and cast<CheckTypeMatcher>.

llvm-svn: 373001
2019-09-26 17:38:47 +00:00
Craig Topper 46721bb7f5 [InstCombine] Use m_Zero instead of isNullValue() when checking if a GEP index is all zeroes to prevent an infinite loop.
The test case here previously infinite looped. Only one element from the GEP is used so SimplifyDemandedVectorElts would replace the other lanes in each index with undef leading to the first index being <0, undef, undef, undef>. But there's a GEP transform that tries to replace an index into a 0 sized type with a zero index. But the zero index check only works on ConstantInt 0 or ConstantAggregateZero so it would turn the index back to zeroinitializer. Resulting in a loop.

The fix is to use m_Zero() to allow a vector of zeroes and undefs.

Differential Revision: https://reviews.llvm.org/D67977

llvm-svn: 373000
2019-09-26 17:20:50 +00:00
Reid Kleckner adc1830187 Move normalization of `\` in #includes from -fms-compatibility to -fms-extensions
Handling backslashes in include paths in the implementation isn't
non-conforming.

llvm-svn: 372999
2019-09-26 17:19:22 +00:00
Pavel Labath e8f0613185 SystemInitializer: Define macros for experimental targets too
llvm-svn: 372998
2019-09-26 17:15:18 +00:00
Simon Pilgrim 5c6ea055f6 TGParser::ParseOperation - silence static analyzer dyn_cast<TypedInit> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<TypedInit> directly and if not assert will fire for us.

I've also pulled out the repeated getType() call which was the only user of the pointer.

llvm-svn: 372997
2019-09-26 17:11:02 +00:00
Fangrui Song f1e1451946 [ELF] Set SectionBase::partition in processSectionCommands
Fixes PR43461 (regression caused by D67504)

The partition field of a SECTIONS-specified section is not set after
D67504. The 0 value affects findSection() which checks if the partition
field is 1.

So `Out::initArray = findSection(".init_array")` is null, and
DT_INIT_ARRAYSZ is not set.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D68087

llvm-svn: 372996
2019-09-26 17:10:09 +00:00
Matt Davis 4d17cdc704 [lld][mach-o] Avoid segfaulting when handling an empty section list.
Summary:
The following patch avoids segfaulting if the section list is empty when writing a mach-o MH_OBJECT.  I ran into this case from a more complicated example trying to dead_strip while using '-r' in lld.

I'm not sure if having empty sections is a legal mach-o, but it does seem that other llvm-binutils tools can ingest such a boring object with out issue.  Would it be better to emit an error, emit a warning, or do nothing?  It seems that adding a warning diagnostic might be helpful to users, as I did not expect to have a section-less object when the linker was done.

Reviewers: kledzik, ruiu

Subscribers: llvm-commits, jrm

Tags: #lld, #llvm

Differential Revision: https://reviews.llvm.org/D67735

llvm-svn: 372995
2019-09-26 17:03:20 +00:00
Reid Kleckner 01ba7d5efe Un-XFAIL coverage_no_integrated_as.c test on Windows
You can't use -fno-integrated-as for *-msvc triples because no usable
standalone assembler exists. Perhaps we could teach clang to emit a .s
and then reinvoke itself, but that's a bit silly.

Anyway, fix the test by using an Itanium ABI triple, which will become
mingw, which will assume gnu as is a usable assembler.

llvm-svn: 372994
2019-09-26 16:56:25 +00:00
Simon Pilgrim 514e6b6e6e ConstantFold - silence static analyzer dyn_cast<ExtractValueInst> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<ExtractValueInst> directly and if not assert will fire for us.

llvm-svn: 372993
2019-09-26 16:30:36 +00:00
Simon Pilgrim 2cf54d7b71 ARMBaseInstrInfo getOperandLatency - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 372992
2019-09-26 16:05:55 +00:00
Jinsong Ji be13c43e08 [PowerPC] Fix typo in rL372985
llvm-svn: 372991
2019-09-26 15:49:11 +00:00
Wei Mi 67d93f0d91 [LoopInfo] Limit the iterations to check whether a loop has dedicated exits
for extreme large case.

We had a case that a single loop which has 4000 exits and the average number
of predecessors of each exit is > 1000, and we found compiling the case spent
a significant amount of time on checking whether a loop has dedicated exits.
This patch adds a limit for the iterations to the check. With the patch, the
time to compile our testcase reduced from 1000s to 200s (clang release build).

Differential Revision: https://reviews.llvm.org/D67359

llvm-svn: 372990
2019-09-26 15:36:25 +00:00
Jakub Kuderski d98cb81cd1 Handle successor's PHI node correctly when flattening CFG merges two if-regions
Summary:
FlattenCFG merges two 'if' basicblocks by inserting one basicblock
to another basicblock. The inserted basicblock can have a successor
that contains a PHI node whoes incoming basicblock is the inserted
basicblock. Since the existing code does not handle it, it becomes
a badref.

if (cond1)
  statement
if (cond2)
  statement
successor - contains PHI node whose predecessor is cond2

-->
if (cond1 || cond2)
  statement
(BB for cond2 was deleted)
successor - contains PHI node whose predecessor is cond2 --> bad ref!

Author: Jaebaek Seo

Reviewers: asbirlea, kuhar, tstellar, chandlerc, davide, dexonsmith

Reviewed By: kuhar

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68032

llvm-svn: 372989
2019-09-26 15:20:17 +00:00
Matt Arsenault df3af00421 Fix typo
llvm-svn: 372988
2019-09-26 15:20:16 +00:00
Guillaume Chatelet 6200a5689a [NFC] Rearrange Value::getPointerAlignment
Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67918

llvm-svn: 372987
2019-09-26 15:13:05 +00:00
Sean Fertile ed97f8042b Updated comments in LWZtoc pseudo expansion.
Refined a couple of the comments in the LWZtoc expansion code based on
a post commit review comment.

llvm-svn: 372986
2019-09-26 15:12:30 +00:00
Jinsong Ji eaf6746db0 [PowerPC] Add missing pattern for VSX Scalar Negative Multiply-Subtract Single Precision
Summary:
This was found during review of https://reviews.llvm.org/D66050.
In the simple test of fdiv, we miss to fold
```
        fneg 2, 2
        xsmaddasp 3, 2, 0
```
to
```
        xsnmsubasp 3, 2, 0
```
We have the patterns for Double Precision and vectors, just missing
Single Precision, the patch add that.

Reviewers: #powerpc, hfinkel, nemanjai, steven.zhang

Reviewed By: #powerpc, steven.zhang

Subscribers: wuzish, hiraditya, kbarton, MaskRay, shchenz, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67595

llvm-svn: 372985
2019-09-26 15:11:33 +00:00
Hans Wennborg 603256b1d7 build_llvm_package.bat: Bootstrap with VS 2019
llvm-svn: 372984
2019-09-26 14:57:55 +00:00
Louis Dionne e16f2cb678 [libc++] Take 2: Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

This was previously committed as r372777 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65161

llvm-svn: 372983
2019-09-26 14:51:10 +00:00
Haojian Wu 1822087fac [clangd] Bump vscode-clangd v0.0.18
CHANGELOG:
- enable semantic highlighting by default
- upgrade the LSP dependencies to pickup the incoming LSP v3.15.0

llvm-svn: 372981
2019-09-26 14:11:23 +00:00
Haojian Wu 2745e5ea4a [clangd][vscode] Add npm helper commands to package/release the extension.
Summary: Help to fix https://github.com/clangd/clangd/issues/159.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68080

llvm-svn: 372980
2019-09-26 14:04:52 +00:00
Dmitri Gribenko bb7a9dcd42 Return results by value from ClangTidyCheckFactories::createChecks
llvm-svn: 372979
2019-09-26 13:55:01 +00:00
Dmitri Gribenko 5338ffcfa1 Use std::unique_ptr in ClangTidyCheckFactories
I had to explicitly define some destructors that could only be defined
in the corresponding .cpp files.

llvm-svn: 372978
2019-09-26 13:47:29 +00:00
Simon Pilgrim c15cd009ac [FlattenCFG] Silence static analyzer dyn_cast<BranchInst> null dereference warnings. NFCI.
The static analyzer is warning about a potential null dereferences, but we should be able to use cast<BranchInst> directly and if not assert will fire for us.

llvm-svn: 372977
2019-09-26 13:33:15 +00:00
Jan Kratochvil e7bef0f183 [lldb] Code cleanup: Simplify SBCommandReturnObject
A simplification for D67589. m_opaque_up can never be nullptr (unless one calls
a ctor with nullptr or one uses SetLLDBObjectPtr with nullptr).

Also protected SetLLDBObjectPtr is not used anywhere (I haven't found it would
ever be used).

Differential revision: https://reviews.llvm.org/D68083

llvm-svn: 372976
2019-09-26 13:31:59 +00:00
Sven van Haastregt 6c22eda160 [OpenCL] Add -Wconversion to fdeclare-opencl-builtins test
Add the -Wconversion -Werror options to check no unexpected conversion
is done.

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D67714

llvm-svn: 372975
2019-09-26 13:31:36 +00:00
Raphael Isemann fe0de7e5e1 [lldb][modern-type-lookup] Fix crash when activating modern-type-lookup on Linux
There is no ClangModulesDeclVendor on Linux so that cast is triggering an assert.
Let's just remove it as it just casts the type to itself.

llvm-svn: 372974
2019-09-26 12:33:48 +00:00
Owen Reynolds b4e2d471f7 [llvm-ar][test] Move MRI tests from "llvm/test/Object/"
llvm/test/Object/ contains tests for the ArchiveWriter library, however
support for MRI scripts is found in llvm-ar and not the library. This
diff moves the MRI related tests and removes those that are duplicates.

Differential Revision: https://reviews.llvm.org/D68038

llvm-svn: 372973
2019-09-26 12:32:11 +00:00
Bjorn Pettersson 163c54d288 [InstCombine] Don't assume CmpInst has been visited in getFlippedStrictnessPredicateAndConstant
Summary:
Removing an assumption (assert) that the CmpInst already has been
simplified in getFlippedStrictnessPredicateAndConstant. Solution is
to simply bail out instead of hitting the assertion. Instead we
assume that any profitable rewrite will happen in the next iteration
of InstCombine.

The reason why we can't assume that the CmpInst already has been
simplified is that the worklist does not guarantee such an ordering.

Solves https://bugs.llvm.org/show_bug.cgi?id=43376

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68022

llvm-svn: 372972
2019-09-26 12:16:01 +00:00
Raphael Isemann f685aa73aa [lldb][www] Update bot links
llvm-svn: 372971
2019-09-26 11:48:45 +00:00